From 3fa210f7276ee649c3dc2a1c4121f0db6487ae54 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 22 Sep 2022 02:03:42 +0000 Subject: [PATCH 1/2] fix!: temporarily removed language rules from Speech-to-Text V2 API BUILD.bazel file PiperOrigin-RevId: 475956674 Source-Link: https://github.com/googleapis/googleapis/commit/210422e82d7077829aa5270a9894fa667782182d Source-Link: https://github.com/googleapis/googleapis-gen/commit/43a371600cebdecaa8186f47920a9a471182dd5b Copy-Tag: eyJwIjoiamF2YS1zcGVlY2gvLk93bEJvdC55YW1sIiwiaCI6IjQzYTM3MTYwMGNlYmRlY2FhODE4NmY0NzkyMGE5YTQ3MTE4MmRkNWIifQ== --- .../cloud/speech/v1/AdaptationClient.java | 1674 ++++++ .../cloud/speech/v1/AdaptationSettings.java | 305 + .../google/cloud/speech/v1/SpeechClient.java | 483 ++ .../cloud/speech/v1/SpeechSettings.java | 241 + .../cloud/speech/v1/gapic_metadata.json | 66 + .../google/cloud/speech/v1/package-info.java | 64 + .../cloud/speech/v1/stub/AdaptationStub.java | 103 + .../v1/stub/AdaptationStubSettings.java | 669 +++ .../stub/GrpcAdaptationCallableFactory.java | 113 + .../speech/v1/stub/GrpcAdaptationStub.java | 475 ++ .../v1/stub/GrpcSpeechCallableFactory.java | 113 + .../cloud/speech/v1/stub/GrpcSpeechStub.java | 227 + .../HttpJsonAdaptationCallableFactory.java | 105 + .../v1/stub/HttpJsonAdaptationStub.java | 695 +++ .../stub/HttpJsonSpeechCallableFactory.java | 105 + .../speech/v1/stub/HttpJsonSpeechStub.java | 281 + .../cloud/speech/v1/stub/SpeechStub.java | 73 + .../speech/v1/stub/SpeechStubSettings.java | 440 ++ .../v1/AdaptationClientHttpJsonTest.java | 940 +++ .../cloud/speech/v1/AdaptationClientTest.java | 826 +++ .../cloud/speech/v1/MockAdaptation.java | 59 + .../cloud/speech/v1/MockAdaptationImpl.java | 272 + .../google/cloud/speech/v1/MockSpeech.java | 59 + .../cloud/speech/v1/MockSpeechImpl.java | 140 + .../speech/v1/SpeechClientHttpJsonTest.java | 186 + .../cloud/speech/v1/SpeechClientTest.java | 234 + .../cloud/speech/v1/AdaptationGrpc.java | 1085 ++++ .../google/cloud/speech/v1/SpeechGrpc.java | 479 ++ .../speech/v1/CreateCustomClassRequest.java | 1060 ++++ .../v1/CreateCustomClassRequestOrBuilder.java | 94 + .../speech/v1/CreatePhraseSetRequest.java | 1060 ++++ .../v1/CreatePhraseSetRequestOrBuilder.java | 94 + .../google/cloud/speech/v1/CustomClass.java | 1829 ++++++ .../cloud/speech/v1/CustomClassName.java | 227 + .../cloud/speech/v1/CustomClassOrBuilder.java | 95 + .../speech/v1/DeleteCustomClassRequest.java | 637 ++ .../v1/DeleteCustomClassRequestOrBuilder.java | 41 + .../speech/v1/DeletePhraseSetRequest.java | 602 ++ .../v1/DeletePhraseSetRequestOrBuilder.java | 31 + .../speech/v1/GetCustomClassRequest.java | 602 ++ .../v1/GetCustomClassRequestOrBuilder.java | 31 + .../cloud/speech/v1/GetPhraseSetRequest.java | 637 ++ .../v1/GetPhraseSetRequestOrBuilder.java | 41 + .../speech/v1/ListCustomClassesRequest.java | 916 +++ .../v1/ListCustomClassesRequestOrBuilder.java | 80 + .../speech/v1/ListCustomClassesResponse.java | 1045 ++++ .../ListCustomClassesResponseOrBuilder.java | 75 + .../cloud/speech/v1/ListPhraseSetRequest.java | 916 +++ .../v1/ListPhraseSetRequestOrBuilder.java | 80 + .../speech/v1/ListPhraseSetResponse.java | 1045 ++++ .../v1/ListPhraseSetResponseOrBuilder.java | 75 + .../google/cloud/speech/v1/LocationName.java | 192 + .../v1/LongRunningRecognizeMetadata.java | 1162 ++++ ...LongRunningRecognizeMetadataOrBuilder.java | 96 + .../v1/LongRunningRecognizeRequest.java | 1151 ++++ .../LongRunningRecognizeRequestOrBuilder.java | 93 + .../v1/LongRunningRecognizeResponse.java | 1611 +++++ ...LongRunningRecognizeResponseOrBuilder.java | 139 + .../com/google/cloud/speech/v1/PhraseSet.java | 1944 ++++++ .../google/cloud/speech/v1/PhraseSetName.java | 223 + .../cloud/speech/v1/PhraseSetOrBuilder.java | 91 + .../cloud/speech/v1/RecognitionAudio.java | 906 +++ .../speech/v1/RecognitionAudioOrBuilder.java | 81 + .../cloud/speech/v1/RecognitionConfig.java | 4838 +++++++++++++++ .../speech/v1/RecognitionConfigOrBuilder.java | 660 ++ .../cloud/speech/v1/RecognitionMetadata.java | 2343 ++++++++ .../v1/RecognitionMetadataOrBuilder.java | 170 + .../cloud/speech/v1/RecognizeRequest.java | 913 +++ .../speech/v1/RecognizeRequestOrBuilder.java | 66 + .../cloud/speech/v1/RecognizeResponse.java | 1135 ++++ .../speech/v1/RecognizeResponseOrBuilder.java | 85 + .../speech/v1/SpeakerDiarizationConfig.java | 782 +++ .../v1/SpeakerDiarizationConfigOrBuilder.java | 57 + .../cloud/speech/v1/SpeechAdaptation.java | 1671 ++++++ .../speech/v1/SpeechAdaptationOrBuilder.java | 163 + .../speech/v1/SpeechAdaptationProto.java | 285 + .../google/cloud/speech/v1/SpeechContext.java | 918 +++ .../speech/v1/SpeechContextOrBuilder.java | 107 + .../google/cloud/speech/v1/SpeechProto.java | 406 ++ .../v1/SpeechRecognitionAlternative.java | 1211 ++++ ...SpeechRecognitionAlternativeOrBuilder.java | 105 + .../speech/v1/SpeechRecognitionResult.java | 1457 +++++ .../v1/SpeechRecognitionResultOrBuilder.java | 134 + .../cloud/speech/v1/SpeechResourceProto.java | 121 + .../speech/v1/StreamingRecognitionConfig.java | 921 +++ .../StreamingRecognitionConfigOrBuilder.java | 79 + .../speech/v1/StreamingRecognitionResult.java | 1654 +++++ .../StreamingRecognitionResultOrBuilder.java | 162 + .../speech/v1/StreamingRecognizeRequest.java | 955 +++ .../StreamingRecognizeRequestOrBuilder.java | 77 + .../speech/v1/StreamingRecognizeResponse.java | 1771 ++++++ .../StreamingRecognizeResponseOrBuilder.java | 147 + .../speech/v1/TranscriptOutputConfig.java | 732 +++ .../v1/TranscriptOutputConfigOrBuilder.java | 46 + .../speech/v1/UpdateCustomClassRequest.java | 997 +++ .../v1/UpdateCustomClassRequestOrBuilder.java | 87 + .../speech/v1/UpdatePhraseSetRequest.java | 997 +++ .../v1/UpdatePhraseSetRequestOrBuilder.java | 87 + .../com/google/cloud/speech/v1/WordInfo.java | 1389 +++++ .../cloud/speech/v1/WordInfoOrBuilder.java | 143 + .../google/cloud/speech/v1/cloud_speech.proto | 899 +++ .../speech/v1/cloud_speech_adaptation.proto | 370 ++ .../google/cloud/speech/v1/resource.proto | 138 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 43 + .../create/SyncCreateSetEndpoint.java | 41 + .../AsyncCreateCustomClass.java | 52 + .../SyncCreateCustomClass.java | 48 + ...tomClassLocationnameCustomclassString.java | 44 + ...ateCustomClassStringCustomclassString.java | 44 + .../createphraseset/AsyncCreatePhraseSet.java | 51 + .../createphraseset/SyncCreatePhraseSet.java | 48 + ...ePhraseSetLocationnamePhrasesetString.java | 44 + ...cCreatePhraseSetStringPhrasesetString.java | 44 + .../AsyncDeleteCustomClass.java | 49 + .../SyncDeleteCustomClass.java | 46 + .../SyncDeleteCustomClassCustomclassname.java | 42 + .../SyncDeleteCustomClassString.java | 42 + .../deletephraseset/AsyncDeletePhraseSet.java | 49 + .../deletephraseset/SyncDeletePhraseSet.java | 46 + .../SyncDeletePhraseSetPhrasesetname.java | 42 + .../SyncDeletePhraseSetString.java | 42 + .../getcustomclass/AsyncGetCustomClass.java | 49 + .../getcustomclass/SyncGetCustomClass.java | 46 + .../SyncGetCustomClassCustomclassname.java | 42 + .../SyncGetCustomClassString.java | 42 + .../getphraseset/AsyncGetPhraseSet.java | 49 + .../getphraseset/SyncGetPhraseSet.java | 46 + .../SyncGetPhraseSetPhrasesetname.java | 42 + .../getphraseset/SyncGetPhraseSetString.java | 42 + .../AsyncListCustomClasses.java | 54 + .../AsyncListCustomClassesPaged.java | 62 + .../SyncListCustomClasses.java | 50 + .../SyncListCustomClassesLocationname.java | 44 + .../SyncListCustomClassesString.java | 44 + .../listphraseset/AsyncListPhraseSet.java | 54 + .../AsyncListPhraseSetPaged.java | 61 + .../listphraseset/SyncListPhraseSet.java | 50 + .../SyncListPhraseSetLocationname.java | 44 + .../SyncListPhraseSetString.java | 44 + .../AsyncUpdateCustomClass.java | 51 + .../SyncUpdateCustomClass.java | 47 + ...UpdateCustomClassCustomclassFieldmask.java | 43 + .../updatephraseset/AsyncUpdatePhraseSet.java | 50 + .../updatephraseset/SyncUpdatePhraseSet.java | 47 + ...SyncUpdatePhraseSetPhrasesetFieldmask.java | 43 + .../createphraseset/SyncCreatePhraseSet.java | 45 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 43 + .../create/SyncCreateSetEndpoint.java | 40 + .../AsyncLongRunningRecognize.java | 53 + .../AsyncLongRunningRecognizeLRO.java | 55 + .../SyncLongRunningRecognize.java | 50 + ...nizeRecognitionconfigRecognitionaudio.java | 45 + .../recognize/AsyncRecognize.java | 51 + .../speechclient/recognize/SyncRecognize.java | 48 + ...nizeRecognitionconfigRecognitionaudio.java | 44 + .../AsyncStreamingRecognize.java | 48 + .../recognize/SyncRecognize.java | 45 + .../createphraseset/SyncCreatePhraseSet.java | 45 + .../recognize/SyncRecognize.java | 45 + .../speech/v1p1beta1/AdaptationClient.java | 1676 ++++++ .../speech/v1p1beta1/AdaptationSettings.java | 306 + .../cloud/speech/v1p1beta1/SpeechClient.java | 484 ++ .../speech/v1p1beta1/SpeechSettings.java | 242 + .../speech/v1p1beta1/gapic_metadata.json | 66 + .../cloud/speech/v1p1beta1/package-info.java | 62 + .../speech/v1p1beta1/stub/AdaptationStub.java | 105 + .../stub/AdaptationStubSettings.java | 670 +++ .../stub/GrpcAdaptationCallableFactory.java | 115 + .../v1p1beta1/stub/GrpcAdaptationStub.java | 477 ++ .../stub/GrpcSpeechCallableFactory.java | 115 + .../speech/v1p1beta1/stub/GrpcSpeechStub.java | 229 + .../HttpJsonAdaptationCallableFactory.java | 105 + .../stub/HttpJsonAdaptationStub.java | 695 +++ .../stub/HttpJsonSpeechCallableFactory.java | 105 + .../v1p1beta1/stub/HttpJsonSpeechStub.java | 281 + .../speech/v1p1beta1/stub/SpeechStub.java | 75 + .../v1p1beta1/stub/SpeechStubSettings.java | 441 ++ .../AdaptationClientHttpJsonTest.java | 940 +++ .../v1p1beta1/AdaptationClientTest.java | 826 +++ .../speech/v1p1beta1/MockAdaptation.java | 59 + .../speech/v1p1beta1/MockAdaptationImpl.java | 272 + .../cloud/speech/v1p1beta1/MockSpeech.java | 59 + .../speech/v1p1beta1/MockSpeechImpl.java | 140 + .../v1p1beta1/SpeechClientHttpJsonTest.java | 186 + .../speech/v1p1beta1/SpeechClientTest.java | 234 + .../speech/v1p1beta1/AdaptationGrpc.java | 1085 ++++ .../cloud/speech/v1p1beta1/SpeechGrpc.java | 479 ++ .../v1p1beta1/CreateCustomClassRequest.java | 1060 ++++ .../CreateCustomClassRequestOrBuilder.java | 94 + .../v1p1beta1/CreatePhraseSetRequest.java | 1060 ++++ .../CreatePhraseSetRequestOrBuilder.java | 94 + .../cloud/speech/v1p1beta1/CustomClass.java | 1829 ++++++ .../speech/v1p1beta1/CustomClassName.java | 227 + .../v1p1beta1/CustomClassOrBuilder.java | 95 + .../v1p1beta1/DeleteCustomClassRequest.java | 637 ++ .../DeleteCustomClassRequestOrBuilder.java | 41 + .../v1p1beta1/DeletePhraseSetRequest.java | 602 ++ .../DeletePhraseSetRequestOrBuilder.java | 31 + .../v1p1beta1/GetCustomClassRequest.java | 602 ++ .../GetCustomClassRequestOrBuilder.java | 31 + .../speech/v1p1beta1/GetPhraseSetRequest.java | 637 ++ .../GetPhraseSetRequestOrBuilder.java | 41 + .../v1p1beta1/ListCustomClassesRequest.java | 916 +++ .../ListCustomClassesRequestOrBuilder.java | 80 + .../v1p1beta1/ListCustomClassesResponse.java | 1045 ++++ .../ListCustomClassesResponseOrBuilder.java | 75 + .../v1p1beta1/ListPhraseSetRequest.java | 916 +++ .../ListPhraseSetRequestOrBuilder.java | 80 + .../v1p1beta1/ListPhraseSetResponse.java | 1045 ++++ .../ListPhraseSetResponseOrBuilder.java | 75 + .../cloud/speech/v1p1beta1/LocationName.java | 192 + .../LongRunningRecognizeMetadata.java | 1398 +++++ ...LongRunningRecognizeMetadataOrBuilder.java | 123 + .../LongRunningRecognizeRequest.java | 1151 ++++ .../LongRunningRecognizeRequestOrBuilder.java | 93 + .../LongRunningRecognizeResponse.java | 1611 +++++ ...LongRunningRecognizeResponseOrBuilder.java | 139 + .../cloud/speech/v1p1beta1/PhraseSet.java | 1944 ++++++ .../cloud/speech/v1p1beta1/PhraseSetName.java | 223 + .../speech/v1p1beta1/PhraseSetOrBuilder.java | 91 + .../speech/v1p1beta1/RecognitionAudio.java | 906 +++ .../v1p1beta1/RecognitionAudioOrBuilder.java | 81 + .../speech/v1p1beta1/RecognitionConfig.java | 5330 +++++++++++++++++ .../v1p1beta1/RecognitionConfigOrBuilder.java | 725 +++ .../speech/v1p1beta1/RecognitionMetadata.java | 2436 ++++++++ .../RecognitionMetadataOrBuilder.java | 183 + .../speech/v1p1beta1/RecognizeRequest.java | 913 +++ .../v1p1beta1/RecognizeRequestOrBuilder.java | 66 + .../speech/v1p1beta1/RecognizeResponse.java | 1135 ++++ .../v1p1beta1/RecognizeResponseOrBuilder.java | 85 + .../v1p1beta1/SpeakerDiarizationConfig.java | 782 +++ .../SpeakerDiarizationConfigOrBuilder.java | 57 + .../speech/v1p1beta1/SpeechAdaptation.java | 1671 ++++++ .../v1p1beta1/SpeechAdaptationOrBuilder.java | 163 + .../v1p1beta1/SpeechAdaptationProto.java | 292 + .../cloud/speech/v1p1beta1/SpeechContext.java | 918 +++ .../v1p1beta1/SpeechContextOrBuilder.java | 107 + .../cloud/speech/v1p1beta1/SpeechProto.java | 420 ++ .../SpeechRecognitionAlternative.java | 1211 ++++ ...SpeechRecognitionAlternativeOrBuilder.java | 105 + .../v1p1beta1/SpeechRecognitionResult.java | 1457 +++++ .../SpeechRecognitionResultOrBuilder.java | 134 + .../speech/v1p1beta1/SpeechResourceProto.java | 148 + .../v1p1beta1/StreamingRecognitionConfig.java | 921 +++ .../StreamingRecognitionConfigOrBuilder.java | 79 + .../v1p1beta1/StreamingRecognitionResult.java | 1654 +++++ .../StreamingRecognitionResultOrBuilder.java | 162 + .../v1p1beta1/StreamingRecognizeRequest.java | 955 +++ .../StreamingRecognizeRequestOrBuilder.java | 77 + .../v1p1beta1/StreamingRecognizeResponse.java | 1771 ++++++ .../StreamingRecognizeResponseOrBuilder.java | 147 + .../v1p1beta1/TranscriptNormalization.java | 1838 ++++++ .../TranscriptNormalizationOrBuilder.java | 68 + .../v1p1beta1/TranscriptOutputConfig.java | 732 +++ .../TranscriptOutputConfigOrBuilder.java | 46 + .../v1p1beta1/UpdateCustomClassRequest.java | 997 +++ .../UpdateCustomClassRequestOrBuilder.java | 87 + .../v1p1beta1/UpdatePhraseSetRequest.java | 997 +++ .../UpdatePhraseSetRequestOrBuilder.java | 87 + .../cloud/speech/v1p1beta1/WordInfo.java | 1389 +++++ .../speech/v1p1beta1/WordInfoOrBuilder.java | 143 + .../cloud/speech/v1p1beta1/cloud_speech.proto | 929 +++ .../v1p1beta1/cloud_speech_adaptation.proto | 370 ++ .../cloud/speech/v1p1beta1/resource.proto | 162 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 43 + .../create/SyncCreateSetEndpoint.java | 41 + .../AsyncCreateCustomClass.java | 52 + .../SyncCreateCustomClass.java | 48 + ...tomClassLocationnameCustomclassString.java | 44 + ...ateCustomClassStringCustomclassString.java | 44 + .../createphraseset/AsyncCreatePhraseSet.java | 51 + .../createphraseset/SyncCreatePhraseSet.java | 48 + ...ePhraseSetLocationnamePhrasesetString.java | 44 + ...cCreatePhraseSetStringPhrasesetString.java | 44 + .../AsyncDeleteCustomClass.java | 49 + .../SyncDeleteCustomClass.java | 46 + .../SyncDeleteCustomClassCustomclassname.java | 42 + .../SyncDeleteCustomClassString.java | 42 + .../deletephraseset/AsyncDeletePhraseSet.java | 49 + .../deletephraseset/SyncDeletePhraseSet.java | 46 + .../SyncDeletePhraseSetPhrasesetname.java | 42 + .../SyncDeletePhraseSetString.java | 42 + .../getcustomclass/AsyncGetCustomClass.java | 49 + .../getcustomclass/SyncGetCustomClass.java | 46 + .../SyncGetCustomClassCustomclassname.java | 42 + .../SyncGetCustomClassString.java | 42 + .../getphraseset/AsyncGetPhraseSet.java | 49 + .../getphraseset/SyncGetPhraseSet.java | 46 + .../SyncGetPhraseSetPhrasesetname.java | 42 + .../getphraseset/SyncGetPhraseSetString.java | 42 + .../AsyncListCustomClasses.java | 54 + .../AsyncListCustomClassesPaged.java | 62 + .../SyncListCustomClasses.java | 50 + .../SyncListCustomClassesLocationname.java | 44 + .../SyncListCustomClassesString.java | 44 + .../listphraseset/AsyncListPhraseSet.java | 54 + .../AsyncListPhraseSetPaged.java | 61 + .../listphraseset/SyncListPhraseSet.java | 50 + .../SyncListPhraseSetLocationname.java | 44 + .../SyncListPhraseSetString.java | 44 + .../AsyncUpdateCustomClass.java | 51 + .../SyncUpdateCustomClass.java | 47 + ...UpdateCustomClassCustomclassFieldmask.java | 43 + .../updatephraseset/AsyncUpdatePhraseSet.java | 50 + .../updatephraseset/SyncUpdatePhraseSet.java | 47 + ...SyncUpdatePhraseSetPhrasesetFieldmask.java | 43 + .../createphraseset/SyncCreatePhraseSet.java | 45 + .../SyncCreateSetCredentialsProvider.java | 44 + .../SyncCreateSetCredentialsProvider1.java | 43 + .../create/SyncCreateSetEndpoint.java | 40 + .../AsyncLongRunningRecognize.java | 53 + .../AsyncLongRunningRecognizeLRO.java | 55 + .../SyncLongRunningRecognize.java | 50 + ...nizeRecognitionconfigRecognitionaudio.java | 45 + .../recognize/AsyncRecognize.java | 51 + .../speechclient/recognize/SyncRecognize.java | 48 + ...nizeRecognitionconfigRecognitionaudio.java | 44 + .../AsyncStreamingRecognize.java | 48 + .../recognize/SyncRecognize.java | 45 + .../createphraseset/SyncCreatePhraseSet.java | 45 + .../recognize/SyncRecognize.java | 45 + 324 files changed, 125951 insertions(+) create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationClient.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationSettings.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechClient.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechSettings.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/gapic_metadata.json create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStub.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStubSettings.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationCallableFactory.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationStub.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechCallableFactory.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationCallableFactory.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationStub.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechCallableFactory.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechStub.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientHttpJsonTest.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientTest.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptation.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptationImpl.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientHttpJsonTest.java create mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java create mode 100644 owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/AdaptationGrpc.java create mode 100644 owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClass.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassName.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponse.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponseOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponse.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponseOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LocationName.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadata.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadataOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetName.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudio.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudioOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadata.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadataOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptation.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationProto.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContext.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContextOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternative.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternativeOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResult.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResultOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechResourceProto.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfig.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfigOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResult.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResultOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponse.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfig.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfigOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequest.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech_adaptation.proto create mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/resource.proto create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetEndpoint.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/AsyncGetCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassString.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/AsyncGetPhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetString.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClasses.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetString.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetEndpoint.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/AsyncRecognize.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognize.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/streamingrecognize/AsyncStreamingRecognize.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechsettings/recognize/SyncRecognize.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/speechstubsettings/recognize/SyncRecognize.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationCallableFactory.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationStub.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechCallableFactory.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechStub.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStubSettings.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientHttpJsonTest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientHttpJsonTest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetName.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudio.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudioOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternative.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternativeOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResult.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResultOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResult.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResultOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalization.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalizationOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfig.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfigOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto create mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetEndpoint.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/AsyncGetCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassString.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/AsyncGetPhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetString.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClasses.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetString.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetEndpoint.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/AsyncRecognize.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognize.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/streamingrecognize/AsyncStreamingRecognize.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechsettings/recognize/SyncRecognize.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java create mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/speechstubsettings/recognize/SyncRecognize.java diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationClient.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationClient.java new file mode 100644 index 000000000000..575bff7c15ac --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationClient.java @@ -0,0 +1,1674 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1.stub.AdaptationStub; +import com.google.cloud.speech.v1.stub.AdaptationStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service that implements Google Cloud Speech Adaptation API. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+ *   String phraseSetId = "phraseSetId959902180";
+ *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the AdaptationClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of AdaptationSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AdaptationSettings adaptationSettings =
+ *     AdaptationSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AdaptationSettings adaptationSettings =
+ *     AdaptationSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AdaptationSettings adaptationSettings =
+ *     AdaptationSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             AdaptationSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class AdaptationClient implements BackgroundResource { + private final AdaptationSettings settings; + private final AdaptationStub stub; + + /** Constructs an instance of AdaptationClient with default settings. */ + public static final AdaptationClient create() throws IOException { + return create(AdaptationSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AdaptationClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final AdaptationClient create(AdaptationSettings settings) throws IOException { + return new AdaptationClient(settings); + } + + /** + * Constructs an instance of AdaptationClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(AdaptationSettings). + */ + public static final AdaptationClient create(AdaptationStub stub) { + return new AdaptationClient(stub); + } + + /** + * Constructs an instance of AdaptationClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected AdaptationClient(AdaptationSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AdaptationStubSettings) settings.getStubSettings()).createStub(); + } + + protected AdaptationClient(AdaptationStub stub) { + this.settings = null; + this.stub = stub; + } + + public final AdaptationSettings getSettings() { + return settings; + } + + public AdaptationStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. + * The items in the PhraseSet are favored by the recognition model when you send a call that + * includes the PhraseSet. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+   *   String phraseSetId = "phraseSetId959902180";
+   *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this phrase set will be created. Format: + *

`projects/{project}/locations/{location}/phraseSets` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @param phraseSet Required. The phrase set to create. + * @param phraseSetId Required. The ID to use for the phrase set, which will become the final + * component of the phrase set's resource name. + *

This value should restrict to letters, numbers, and hyphens, with the first character a + * letter, the last a letter or a number, and be 4-63 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet createPhraseSet( + LocationName parent, PhraseSet phraseSet, String phraseSetId) { + CreatePhraseSetRequest request = + CreatePhraseSetRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setPhraseSet(phraseSet) + .setPhraseSetId(phraseSetId) + .build(); + return createPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. + * The items in the PhraseSet are favored by the recognition model when you send a call that + * includes the PhraseSet. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+   *   String phraseSetId = "phraseSetId959902180";
+   *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this phrase set will be created. Format: + *

`projects/{project}/locations/{location}/phraseSets` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @param phraseSet Required. The phrase set to create. + * @param phraseSetId Required. The ID to use for the phrase set, which will become the final + * component of the phrase set's resource name. + *

This value should restrict to letters, numbers, and hyphens, with the first character a + * letter, the last a letter or a number, and be 4-63 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet createPhraseSet(String parent, PhraseSet phraseSet, String phraseSetId) { + CreatePhraseSetRequest request = + CreatePhraseSetRequest.newBuilder() + .setParent(parent) + .setPhraseSet(phraseSet) + .setPhraseSetId(phraseSetId) + .build(); + return createPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. + * The items in the PhraseSet are favored by the recognition model when you send a call that + * includes the PhraseSet. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CreatePhraseSetRequest request =
+   *       CreatePhraseSetRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPhraseSetId("phraseSetId959902180")
+   *           .setPhraseSet(PhraseSet.newBuilder().build())
+   *           .build();
+   *   PhraseSet response = adaptationClient.createPhraseSet(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet createPhraseSet(CreatePhraseSetRequest request) { + return createPhraseSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. + * The items in the PhraseSet are favored by the recognition model when you send a call that + * includes the PhraseSet. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CreatePhraseSetRequest request =
+   *       CreatePhraseSetRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPhraseSetId("phraseSetId959902180")
+   *           .setPhraseSet(PhraseSet.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = adaptationClient.createPhraseSetCallable().futureCall(request);
+   *   // Do something.
+   *   PhraseSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createPhraseSetCallable() { + return stub.createPhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
+   *   PhraseSet response = adaptationClient.getPhraseSet(name);
+   * }
+   * }
+ * + * @param name Required. The name of the phrase set to retrieve. Format: + *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet getPhraseSet(PhraseSetName name) { + GetPhraseSetRequest request = + GetPhraseSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
+   *   PhraseSet response = adaptationClient.getPhraseSet(name);
+   * }
+   * }
+ * + * @param name Required. The name of the phrase set to retrieve. Format: + *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet getPhraseSet(String name) { + GetPhraseSetRequest request = GetPhraseSetRequest.newBuilder().setName(name).build(); + return getPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   GetPhraseSetRequest request =
+   *       GetPhraseSetRequest.newBuilder()
+   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .build();
+   *   PhraseSet response = adaptationClient.getPhraseSet(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet getPhraseSet(GetPhraseSetRequest request) { + return getPhraseSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   GetPhraseSetRequest request =
+   *       GetPhraseSetRequest.newBuilder()
+   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .build();
+   *   ApiFuture future = adaptationClient.getPhraseSetCallable().futureCall(request);
+   *   // Do something.
+   *   PhraseSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getPhraseSetCallable() { + return stub.getPhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of phrase set. Format: + *

`projects/{project}/locations/{location}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPhraseSetPagedResponse listPhraseSet(LocationName parent) { + ListPhraseSetRequest request = + ListPhraseSetRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of phrase set. Format: + *

`projects/{project}/locations/{location}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPhraseSetPagedResponse listPhraseSet(String parent) { + ListPhraseSetRequest request = ListPhraseSetRequest.newBuilder().setParent(parent).build(); + return listPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListPhraseSetRequest request =
+   *       ListPhraseSetRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (PhraseSet element : adaptationClient.listPhraseSet(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPhraseSetPagedResponse listPhraseSet(ListPhraseSetRequest request) { + return listPhraseSetPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListPhraseSetRequest request =
+   *       ListPhraseSetRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       adaptationClient.listPhraseSetPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (PhraseSet element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listPhraseSetPagedCallable() { + return stub.listPhraseSetPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListPhraseSetRequest request =
+   *       ListPhraseSetRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListPhraseSetResponse response = adaptationClient.listPhraseSetCallable().call(request);
+   *     for (PhraseSet element : response.getPhraseSetsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listPhraseSetCallable() { + return stub.listPhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   PhraseSet response = adaptationClient.updatePhraseSet(phraseSet, updateMask);
+   * }
+   * }
+ * + * @param phraseSet Required. The phrase set to update. + *

The phrase set's `name` field is used to identify the set to be updated. Format: + *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @param updateMask The list of fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet updatePhraseSet(PhraseSet phraseSet, FieldMask updateMask) { + UpdatePhraseSetRequest request = + UpdatePhraseSetRequest.newBuilder() + .setPhraseSet(phraseSet) + .setUpdateMask(updateMask) + .build(); + return updatePhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   UpdatePhraseSetRequest request =
+   *       UpdatePhraseSetRequest.newBuilder()
+   *           .setPhraseSet(PhraseSet.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   PhraseSet response = adaptationClient.updatePhraseSet(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet updatePhraseSet(UpdatePhraseSetRequest request) { + return updatePhraseSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   UpdatePhraseSetRequest request =
+   *       UpdatePhraseSetRequest.newBuilder()
+   *           .setPhraseSet(PhraseSet.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = adaptationClient.updatePhraseSetCallable().futureCall(request);
+   *   // Do something.
+   *   PhraseSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updatePhraseSetCallable() { + return stub.updatePhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
+   *   adaptationClient.deletePhraseSet(name);
+   * }
+   * }
+ * + * @param name Required. The name of the phrase set to delete. Format: + *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePhraseSet(PhraseSetName name) { + DeletePhraseSetRequest request = + DeletePhraseSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deletePhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
+   *   adaptationClient.deletePhraseSet(name);
+   * }
+   * }
+ * + * @param name Required. The name of the phrase set to delete. Format: + *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePhraseSet(String name) { + DeletePhraseSetRequest request = DeletePhraseSetRequest.newBuilder().setName(name).build(); + deletePhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   DeletePhraseSetRequest request =
+   *       DeletePhraseSetRequest.newBuilder()
+   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .build();
+   *   adaptationClient.deletePhraseSet(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePhraseSet(DeletePhraseSetRequest request) { + deletePhraseSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   DeletePhraseSetRequest request =
+   *       DeletePhraseSetRequest.newBuilder()
+   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .build();
+   *   ApiFuture future = adaptationClient.deletePhraseSetCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deletePhraseSetCallable() { + return stub.deletePhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   CustomClass customClass = CustomClass.newBuilder().build();
+   *   String customClassId = "customClassId1871032322";
+   *   CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this custom class will be created. Format: + *

`projects/{project}/locations/{location}/customClasses` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @param customClass Required. The custom class to create. + * @param customClassId Required. The ID to use for the custom class, which will become the final + * component of the custom class' resource name. + *

This value should restrict to letters, numbers, and hyphens, with the first character a + * letter, the last a letter or a number, and be 4-63 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass createCustomClass( + LocationName parent, CustomClass customClass, String customClassId) { + CreateCustomClassRequest request = + CreateCustomClassRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setCustomClass(customClass) + .setCustomClassId(customClassId) + .build(); + return createCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   CustomClass customClass = CustomClass.newBuilder().build();
+   *   String customClassId = "customClassId1871032322";
+   *   CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this custom class will be created. Format: + *

`projects/{project}/locations/{location}/customClasses` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @param customClass Required. The custom class to create. + * @param customClassId Required. The ID to use for the custom class, which will become the final + * component of the custom class' resource name. + *

This value should restrict to letters, numbers, and hyphens, with the first character a + * letter, the last a letter or a number, and be 4-63 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass createCustomClass( + String parent, CustomClass customClass, String customClassId) { + CreateCustomClassRequest request = + CreateCustomClassRequest.newBuilder() + .setParent(parent) + .setCustomClass(customClass) + .setCustomClassId(customClassId) + .build(); + return createCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CreateCustomClassRequest request =
+   *       CreateCustomClassRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setCustomClassId("customClassId1871032322")
+   *           .setCustomClass(CustomClass.newBuilder().build())
+   *           .build();
+   *   CustomClass response = adaptationClient.createCustomClass(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass createCustomClass(CreateCustomClassRequest request) { + return createCustomClassCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CreateCustomClassRequest request =
+   *       CreateCustomClassRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setCustomClassId("customClassId1871032322")
+   *           .setCustomClass(CustomClass.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       adaptationClient.createCustomClassCallable().futureCall(request);
+   *   // Do something.
+   *   CustomClass response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createCustomClassCallable() { + return stub.createCustomClassCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
+   *   CustomClass response = adaptationClient.getCustomClass(name);
+   * }
+   * }
+ * + * @param name Required. The name of the custom class to retrieve. Format: + *

`projects/{project}/locations/{location}/customClasses/{custom_class}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass getCustomClass(CustomClassName name) { + GetCustomClassRequest request = + GetCustomClassRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
+   *   CustomClass response = adaptationClient.getCustomClass(name);
+   * }
+   * }
+ * + * @param name Required. The name of the custom class to retrieve. Format: + *

`projects/{project}/locations/{location}/customClasses/{custom_class}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass getCustomClass(String name) { + GetCustomClassRequest request = GetCustomClassRequest.newBuilder().setName(name).build(); + return getCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   GetCustomClassRequest request =
+   *       GetCustomClassRequest.newBuilder()
+   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .build();
+   *   CustomClass response = adaptationClient.getCustomClass(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass getCustomClass(GetCustomClassRequest request) { + return getCustomClassCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   GetCustomClassRequest request =
+   *       GetCustomClassRequest.newBuilder()
+   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .build();
+   *   ApiFuture future = adaptationClient.getCustomClassCallable().futureCall(request);
+   *   // Do something.
+   *   CustomClass response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCustomClassCallable() { + return stub.getCustomClassCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of custom classes. Format: + *

`projects/{project}/locations/{location}/customClasses` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomClassesPagedResponse listCustomClasses(LocationName parent) { + ListCustomClassesRequest request = + ListCustomClassesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listCustomClasses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of custom classes. Format: + *

`projects/{project}/locations/{location}/customClasses` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomClassesPagedResponse listCustomClasses(String parent) { + ListCustomClassesRequest request = + ListCustomClassesRequest.newBuilder().setParent(parent).build(); + return listCustomClasses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListCustomClassesRequest request =
+   *       ListCustomClassesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (CustomClass element : adaptationClient.listCustomClasses(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomClassesPagedResponse listCustomClasses(ListCustomClassesRequest request) { + return listCustomClassesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListCustomClassesRequest request =
+   *       ListCustomClassesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       adaptationClient.listCustomClassesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (CustomClass element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCustomClassesPagedCallable() { + return stub.listCustomClassesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListCustomClassesRequest request =
+   *       ListCustomClassesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListCustomClassesResponse response =
+   *         adaptationClient.listCustomClassesCallable().call(request);
+   *     for (CustomClass element : response.getCustomClassesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCustomClassesCallable() { + return stub.listCustomClassesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CustomClass customClass = CustomClass.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   CustomClass response = adaptationClient.updateCustomClass(customClass, updateMask);
+   * }
+   * }
+ * + * @param customClass Required. The custom class to update. + *

The custom class's `name` field is used to identify the custom class to be updated. + * Format: + *

`projects/{project}/locations/{location}/customClasses/{custom_class}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @param updateMask The list of fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass updateCustomClass(CustomClass customClass, FieldMask updateMask) { + UpdateCustomClassRequest request = + UpdateCustomClassRequest.newBuilder() + .setCustomClass(customClass) + .setUpdateMask(updateMask) + .build(); + return updateCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   UpdateCustomClassRequest request =
+   *       UpdateCustomClassRequest.newBuilder()
+   *           .setCustomClass(CustomClass.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   CustomClass response = adaptationClient.updateCustomClass(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass updateCustomClass(UpdateCustomClassRequest request) { + return updateCustomClassCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   UpdateCustomClassRequest request =
+   *       UpdateCustomClassRequest.newBuilder()
+   *           .setCustomClass(CustomClass.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       adaptationClient.updateCustomClassCallable().futureCall(request);
+   *   // Do something.
+   *   CustomClass response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCustomClassCallable() { + return stub.updateCustomClassCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
+   *   adaptationClient.deleteCustomClass(name);
+   * }
+   * }
+ * + * @param name Required. The name of the custom class to delete. Format: + *

`projects/{project}/locations/{location}/customClasses/{custom_class}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCustomClass(CustomClassName name) { + DeleteCustomClassRequest request = + DeleteCustomClassRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
+   *   adaptationClient.deleteCustomClass(name);
+   * }
+   * }
+ * + * @param name Required. The name of the custom class to delete. Format: + *

`projects/{project}/locations/{location}/customClasses/{custom_class}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCustomClass(String name) { + DeleteCustomClassRequest request = DeleteCustomClassRequest.newBuilder().setName(name).build(); + deleteCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   DeleteCustomClassRequest request =
+   *       DeleteCustomClassRequest.newBuilder()
+   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .build();
+   *   adaptationClient.deleteCustomClass(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCustomClass(DeleteCustomClassRequest request) { + deleteCustomClassCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   DeleteCustomClassRequest request =
+   *       DeleteCustomClassRequest.newBuilder()
+   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .build();
+   *   ApiFuture future = adaptationClient.deleteCustomClassCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCustomClassCallable() { + return stub.deleteCustomClassCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListPhraseSetPagedResponse + extends AbstractPagedListResponse< + ListPhraseSetRequest, + ListPhraseSetResponse, + PhraseSet, + ListPhraseSetPage, + ListPhraseSetFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListPhraseSetPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListPhraseSetPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListPhraseSetPagedResponse(ListPhraseSetPage page) { + super(page, ListPhraseSetFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListPhraseSetPage + extends AbstractPage< + ListPhraseSetRequest, ListPhraseSetResponse, PhraseSet, ListPhraseSetPage> { + + private ListPhraseSetPage( + PageContext context, + ListPhraseSetResponse response) { + super(context, response); + } + + private static ListPhraseSetPage createEmptyPage() { + return new ListPhraseSetPage(null, null); + } + + @Override + protected ListPhraseSetPage createPage( + PageContext context, + ListPhraseSetResponse response) { + return new ListPhraseSetPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListPhraseSetFixedSizeCollection + extends AbstractFixedSizeCollection< + ListPhraseSetRequest, + ListPhraseSetResponse, + PhraseSet, + ListPhraseSetPage, + ListPhraseSetFixedSizeCollection> { + + private ListPhraseSetFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListPhraseSetFixedSizeCollection createEmptyCollection() { + return new ListPhraseSetFixedSizeCollection(null, 0); + } + + @Override + protected ListPhraseSetFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListPhraseSetFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListCustomClassesPagedResponse + extends AbstractPagedListResponse< + ListCustomClassesRequest, + ListCustomClassesResponse, + CustomClass, + ListCustomClassesPage, + ListCustomClassesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCustomClassesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListCustomClassesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListCustomClassesPagedResponse(ListCustomClassesPage page) { + super(page, ListCustomClassesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCustomClassesPage + extends AbstractPage< + ListCustomClassesRequest, ListCustomClassesResponse, CustomClass, ListCustomClassesPage> { + + private ListCustomClassesPage( + PageContext context, + ListCustomClassesResponse response) { + super(context, response); + } + + private static ListCustomClassesPage createEmptyPage() { + return new ListCustomClassesPage(null, null); + } + + @Override + protected ListCustomClassesPage createPage( + PageContext context, + ListCustomClassesResponse response) { + return new ListCustomClassesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCustomClassesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCustomClassesRequest, + ListCustomClassesResponse, + CustomClass, + ListCustomClassesPage, + ListCustomClassesFixedSizeCollection> { + + private ListCustomClassesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCustomClassesFixedSizeCollection createEmptyCollection() { + return new ListCustomClassesFixedSizeCollection(null, 0); + } + + @Override + protected ListCustomClassesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCustomClassesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationSettings.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationSettings.java new file mode 100644 index 000000000000..8baee25d419e --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationSettings.java @@ -0,0 +1,305 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.speech.v1.stub.AdaptationStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AdaptationClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (speech.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createPhraseSet to 30 seconds: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AdaptationSettings.Builder adaptationSettingsBuilder = AdaptationSettings.newBuilder();
+ * adaptationSettingsBuilder
+ *     .createPhraseSetSettings()
+ *     .setRetrySettings(
+ *         adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AdaptationSettings adaptationSettings = adaptationSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AdaptationSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createPhraseSet. */ + public UnaryCallSettings createPhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).createPhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to getPhraseSet. */ + public UnaryCallSettings getPhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).getPhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to listPhraseSet. */ + public PagedCallSettings + listPhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).listPhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to updatePhraseSet. */ + public UnaryCallSettings updatePhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).updatePhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to deletePhraseSet. */ + public UnaryCallSettings deletePhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).deletePhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to createCustomClass. */ + public UnaryCallSettings createCustomClassSettings() { + return ((AdaptationStubSettings) getStubSettings()).createCustomClassSettings(); + } + + /** Returns the object with the settings used for calls to getCustomClass. */ + public UnaryCallSettings getCustomClassSettings() { + return ((AdaptationStubSettings) getStubSettings()).getCustomClassSettings(); + } + + /** Returns the object with the settings used for calls to listCustomClasses. */ + public PagedCallSettings< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings() { + return ((AdaptationStubSettings) getStubSettings()).listCustomClassesSettings(); + } + + /** Returns the object with the settings used for calls to updateCustomClass. */ + public UnaryCallSettings updateCustomClassSettings() { + return ((AdaptationStubSettings) getStubSettings()).updateCustomClassSettings(); + } + + /** Returns the object with the settings used for calls to deleteCustomClass. */ + public UnaryCallSettings deleteCustomClassSettings() { + return ((AdaptationStubSettings) getStubSettings()).deleteCustomClassSettings(); + } + + public static final AdaptationSettings create(AdaptationStubSettings stub) throws IOException { + return new AdaptationSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AdaptationStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AdaptationStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AdaptationStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AdaptationStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AdaptationStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return AdaptationStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AdaptationStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AdaptationStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AdaptationSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AdaptationSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AdaptationStubSettings.newBuilder(clientContext)); + } + + protected Builder(AdaptationSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AdaptationStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AdaptationStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(AdaptationStubSettings.newHttpJsonBuilder()); + } + + public AdaptationStubSettings.Builder getStubSettingsBuilder() { + return ((AdaptationStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createPhraseSet. */ + public UnaryCallSettings.Builder createPhraseSetSettings() { + return getStubSettingsBuilder().createPhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to getPhraseSet. */ + public UnaryCallSettings.Builder getPhraseSetSettings() { + return getStubSettingsBuilder().getPhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to listPhraseSet. */ + public PagedCallSettings.Builder< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + listPhraseSetSettings() { + return getStubSettingsBuilder().listPhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to updatePhraseSet. */ + public UnaryCallSettings.Builder updatePhraseSetSettings() { + return getStubSettingsBuilder().updatePhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to deletePhraseSet. */ + public UnaryCallSettings.Builder deletePhraseSetSettings() { + return getStubSettingsBuilder().deletePhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to createCustomClass. */ + public UnaryCallSettings.Builder + createCustomClassSettings() { + return getStubSettingsBuilder().createCustomClassSettings(); + } + + /** Returns the builder for the settings used for calls to getCustomClass. */ + public UnaryCallSettings.Builder getCustomClassSettings() { + return getStubSettingsBuilder().getCustomClassSettings(); + } + + /** Returns the builder for the settings used for calls to listCustomClasses. */ + public PagedCallSettings.Builder< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings() { + return getStubSettingsBuilder().listCustomClassesSettings(); + } + + /** Returns the builder for the settings used for calls to updateCustomClass. */ + public UnaryCallSettings.Builder + updateCustomClassSettings() { + return getStubSettingsBuilder().updateCustomClassSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCustomClass. */ + public UnaryCallSettings.Builder deleteCustomClassSettings() { + return getStubSettingsBuilder().deleteCustomClassSettings(); + } + + @Override + public AdaptationSettings build() throws IOException { + return new AdaptationSettings(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechClient.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechClient.java new file mode 100644 index 000000000000..e3b2dd0af331 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechClient.java @@ -0,0 +1,483 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1.stub.SpeechStub; +import com.google.cloud.speech.v1.stub.SpeechStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service that implements Google Cloud Speech API. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
+ *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
+ *   RecognizeResponse response = speechClient.recognize(config, audio);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the SpeechClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of SpeechSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SpeechSettings speechSettings =
+ *     SpeechSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SpeechClient speechClient = SpeechClient.create(speechSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SpeechClient speechClient = SpeechClient.create(speechSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SpeechSettings speechSettings =
+ *     SpeechSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             SpeechSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * SpeechClient speechClient = SpeechClient.create(speechSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class SpeechClient implements BackgroundResource { + private final SpeechSettings settings; + private final SpeechStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of SpeechClient with default settings. */ + public static final SpeechClient create() throws IOException { + return create(SpeechSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SpeechClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final SpeechClient create(SpeechSettings settings) throws IOException { + return new SpeechClient(settings); + } + + /** + * Constructs an instance of SpeechClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(SpeechSettings). + */ + public static final SpeechClient create(SpeechStub stub) { + return new SpeechClient(stub); + } + + /** + * Constructs an instance of SpeechClient, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected SpeechClient(SpeechSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SpeechStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected SpeechClient(SpeechStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final SpeechSettings getSettings() { + return settings; + } + + public SpeechStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs synchronous speech recognition: receive results after all audio has been sent and + * processed. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
+   *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
+   *   RecognizeResponse response = speechClient.recognize(config, audio);
+   * }
+   * }
+ * + * @param config Required. Provides information to the recognizer that specifies how to process + * the request. + * @param audio Required. The audio data to be recognized. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RecognizeResponse recognize(RecognitionConfig config, RecognitionAudio audio) { + RecognizeRequest request = + RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); + return recognize(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs synchronous speech recognition: receive results after all audio has been sent and + * processed. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   RecognizeRequest request =
+   *       RecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .build();
+   *   RecognizeResponse response = speechClient.recognize(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RecognizeResponse recognize(RecognizeRequest request) { + return recognizeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs synchronous speech recognition: receive results after all audio has been sent and + * processed. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   RecognizeRequest request =
+   *       RecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = speechClient.recognizeCallable().futureCall(request);
+   *   // Do something.
+   *   RecognizeResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable recognizeCallable() { + return stub.recognizeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. For more information on asynchronous speech + * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
+   *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
+   *   LongRunningRecognizeResponse response =
+   *       speechClient.longRunningRecognizeAsync(config, audio).get();
+   * }
+   * }
+ * + * @param config Required. Provides information to the recognizer that specifies how to process + * the request. + * @param audio Required. The audio data to be recognized. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio) { + LongRunningRecognizeRequest request = + LongRunningRecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); + return longRunningRecognizeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. For more information on asynchronous speech + * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   LongRunningRecognizeRequest request =
+   *       LongRunningRecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
+   *           .build();
+   *   LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + longRunningRecognizeAsync(LongRunningRecognizeRequest request) { + return longRunningRecognizeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. For more information on asynchronous speech + * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   LongRunningRecognizeRequest request =
+   *       LongRunningRecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       speechClient.longRunningRecognizeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   LongRunningRecognizeResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable() { + return stub.longRunningRecognizeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. For more information on asynchronous speech + * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   LongRunningRecognizeRequest request =
+   *       LongRunningRecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = speechClient.longRunningRecognizeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + longRunningRecognizeCallable() { + return stub.longRunningRecognizeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs bidirectional streaming speech recognition: receive results while sending audio. This + * method is only available via the gRPC API (not REST). + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   BidiStream bidiStream =
+   *       speechClient.streamingRecognizeCallable().call();
+   *   StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build();
+   *   bidiStream.send(request);
+   *   for (StreamingRecognizeResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final BidiStreamingCallable + streamingRecognizeCallable() { + return stub.streamingRecognizeCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechSettings.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechSettings.java new file mode 100644 index 000000000000..17ab1887dc20 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechSettings.java @@ -0,0 +1,241 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.speech.v1.stub.SpeechStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SpeechClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (speech.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of recognize to 30 seconds: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder();
+ * speechSettingsBuilder
+ *     .recognizeSettings()
+ *     .setRetrySettings(
+ *         speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SpeechSettings speechSettings = speechSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class SpeechSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to recognize. */ + public UnaryCallSettings recognizeSettings() { + return ((SpeechStubSettings) getStubSettings()).recognizeSettings(); + } + + /** Returns the object with the settings used for calls to longRunningRecognize. */ + public UnaryCallSettings longRunningRecognizeSettings() { + return ((SpeechStubSettings) getStubSettings()).longRunningRecognizeSettings(); + } + + /** Returns the object with the settings used for calls to longRunningRecognize. */ + public OperationCallSettings< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings() { + return ((SpeechStubSettings) getStubSettings()).longRunningRecognizeOperationSettings(); + } + + /** Returns the object with the settings used for calls to streamingRecognize. */ + public StreamingCallSettings + streamingRecognizeSettings() { + return ((SpeechStubSettings) getStubSettings()).streamingRecognizeSettings(); + } + + public static final SpeechSettings create(SpeechStubSettings stub) throws IOException { + return new SpeechSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SpeechStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SpeechStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SpeechStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SpeechStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SpeechStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SpeechStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SpeechStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SpeechStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SpeechSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SpeechSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SpeechStubSettings.newBuilder(clientContext)); + } + + protected Builder(SpeechSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SpeechStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SpeechStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(SpeechStubSettings.newHttpJsonBuilder()); + } + + public SpeechStubSettings.Builder getStubSettingsBuilder() { + return ((SpeechStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to recognize. */ + public UnaryCallSettings.Builder recognizeSettings() { + return getStubSettingsBuilder().recognizeSettings(); + } + + /** Returns the builder for the settings used for calls to longRunningRecognize. */ + public UnaryCallSettings.Builder + longRunningRecognizeSettings() { + return getStubSettingsBuilder().longRunningRecognizeSettings(); + } + + /** Returns the builder for the settings used for calls to longRunningRecognize. */ + public OperationCallSettings.Builder< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings() { + return getStubSettingsBuilder().longRunningRecognizeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to streamingRecognize. */ + public StreamingCallSettings.Builder + streamingRecognizeSettings() { + return getStubSettingsBuilder().streamingRecognizeSettings(); + } + + @Override + public SpeechSettings build() throws IOException { + return new SpeechSettings(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/gapic_metadata.json b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/gapic_metadata.json new file mode 100644 index 000000000000..3ae90ba027aa --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/gapic_metadata.json @@ -0,0 +1,66 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.speech.v1", + "libraryPackage": "com.google.cloud.speech.v1", + "services": { + "Speech": { + "clients": { + "grpc": { + "libraryClient": "SpeechClient", + "rpcs": { + "LongRunningRecognize": { + "methods": ["longRunningRecognizeAsync", "longRunningRecognizeAsync", "longRunningRecognizeOperationCallable", "longRunningRecognizeCallable"] + }, + "Recognize": { + "methods": ["recognize", "recognize", "recognizeCallable"] + }, + "StreamingRecognize": { + "methods": ["streamingRecognizeCallable"] + } + } + } + } + }, + "Adaptation": { + "clients": { + "grpc": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreateCustomClass": { + "methods": ["createCustomClass", "createCustomClass", "createCustomClass", "createCustomClassCallable"] + }, + "CreatePhraseSet": { + "methods": ["createPhraseSet", "createPhraseSet", "createPhraseSet", "createPhraseSetCallable"] + }, + "DeleteCustomClass": { + "methods": ["deleteCustomClass", "deleteCustomClass", "deleteCustomClass", "deleteCustomClassCallable"] + }, + "DeletePhraseSet": { + "methods": ["deletePhraseSet", "deletePhraseSet", "deletePhraseSet", "deletePhraseSetCallable"] + }, + "GetCustomClass": { + "methods": ["getCustomClass", "getCustomClass", "getCustomClass", "getCustomClassCallable"] + }, + "GetPhraseSet": { + "methods": ["getPhraseSet", "getPhraseSet", "getPhraseSet", "getPhraseSetCallable"] + }, + "ListCustomClasses": { + "methods": ["listCustomClasses", "listCustomClasses", "listCustomClasses", "listCustomClassesPagedCallable", "listCustomClassesCallable"] + }, + "ListPhraseSet": { + "methods": ["listPhraseSet", "listPhraseSet", "listPhraseSet", "listPhraseSetPagedCallable", "listPhraseSetCallable"] + }, + "UpdateCustomClass": { + "methods": ["updateCustomClass", "updateCustomClass", "updateCustomClassCallable"] + }, + "UpdatePhraseSet": { + "methods": ["updatePhraseSet", "updatePhraseSet", "updatePhraseSetCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java new file mode 100644 index 000000000000..65f64943f1e4 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java @@ -0,0 +1,64 @@ +/* + * 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 + * + * https://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. + */ + +/** + * A client to Cloud Speech-to-Text API + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= SpeechClient ======================= + * + *

Service Description: Service that implements Google Cloud Speech API. + * + *

Sample for SpeechClient: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
+ *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
+ *   RecognizeResponse response = speechClient.recognize(config, audio);
+ * }
+ * }
+ * + *

======================= AdaptationClient ======================= + * + *

Service Description: Service that implements Google Cloud Speech Adaptation API. + * + *

Sample for AdaptationClient: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+ *   String phraseSetId = "phraseSetId959902180";
+ *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.speech.v1; + +import javax.annotation.Generated; diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStub.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStub.java new file mode 100644 index 000000000000..d7f079fe4cb1 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStub.java @@ -0,0 +1,103 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub; + +import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1.CreateCustomClassRequest; +import com.google.cloud.speech.v1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.DeleteCustomClassRequest; +import com.google.cloud.speech.v1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1.GetCustomClassRequest; +import com.google.cloud.speech.v1.GetPhraseSetRequest; +import com.google.cloud.speech.v1.ListCustomClassesRequest; +import com.google.cloud.speech.v1.ListCustomClassesResponse; +import com.google.cloud.speech.v1.ListPhraseSetRequest; +import com.google.cloud.speech.v1.ListPhraseSetResponse; +import com.google.cloud.speech.v1.PhraseSet; +import com.google.cloud.speech.v1.UpdateCustomClassRequest; +import com.google.cloud.speech.v1.UpdatePhraseSetRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Adaptation service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class AdaptationStub implements BackgroundResource { + + public UnaryCallable createPhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: createPhraseSetCallable()"); + } + + public UnaryCallable getPhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: getPhraseSetCallable()"); + } + + public UnaryCallable + listPhraseSetPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listPhraseSetPagedCallable()"); + } + + public UnaryCallable listPhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: listPhraseSetCallable()"); + } + + public UnaryCallable updatePhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: updatePhraseSetCallable()"); + } + + public UnaryCallable deletePhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: deletePhraseSetCallable()"); + } + + public UnaryCallable createCustomClassCallable() { + throw new UnsupportedOperationException("Not implemented: createCustomClassCallable()"); + } + + public UnaryCallable getCustomClassCallable() { + throw new UnsupportedOperationException("Not implemented: getCustomClassCallable()"); + } + + public UnaryCallable + listCustomClassesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listCustomClassesPagedCallable()"); + } + + public UnaryCallable + listCustomClassesCallable() { + throw new UnsupportedOperationException("Not implemented: listCustomClassesCallable()"); + } + + public UnaryCallable updateCustomClassCallable() { + throw new UnsupportedOperationException("Not implemented: updateCustomClassCallable()"); + } + + public UnaryCallable deleteCustomClassCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCustomClassCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStubSettings.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStubSettings.java new file mode 100644 index 000000000000..876ab1e3a393 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStubSettings.java @@ -0,0 +1,669 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub; + +import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1.CreateCustomClassRequest; +import com.google.cloud.speech.v1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.DeleteCustomClassRequest; +import com.google.cloud.speech.v1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1.GetCustomClassRequest; +import com.google.cloud.speech.v1.GetPhraseSetRequest; +import com.google.cloud.speech.v1.ListCustomClassesRequest; +import com.google.cloud.speech.v1.ListCustomClassesResponse; +import com.google.cloud.speech.v1.ListPhraseSetRequest; +import com.google.cloud.speech.v1.ListPhraseSetResponse; +import com.google.cloud.speech.v1.PhraseSet; +import com.google.cloud.speech.v1.UpdateCustomClassRequest; +import com.google.cloud.speech.v1.UpdatePhraseSetRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AdaptationStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (speech.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createPhraseSet to 30 seconds: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AdaptationStubSettings.Builder adaptationSettingsBuilder = AdaptationStubSettings.newBuilder();
+ * adaptationSettingsBuilder
+ *     .createPhraseSetSettings()
+ *     .setRetrySettings(
+ *         adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AdaptationStubSettings adaptationSettings = adaptationSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class AdaptationStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createPhraseSetSettings; + private final UnaryCallSettings getPhraseSetSettings; + private final PagedCallSettings< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + listPhraseSetSettings; + private final UnaryCallSettings updatePhraseSetSettings; + private final UnaryCallSettings deletePhraseSetSettings; + private final UnaryCallSettings createCustomClassSettings; + private final UnaryCallSettings getCustomClassSettings; + private final PagedCallSettings< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings; + private final UnaryCallSettings updateCustomClassSettings; + private final UnaryCallSettings deleteCustomClassSettings; + + private static final PagedListDescriptor + LIST_PHRASE_SET_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListPhraseSetRequest injectToken(ListPhraseSetRequest payload, String token) { + return ListPhraseSetRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListPhraseSetRequest injectPageSize(ListPhraseSetRequest payload, int pageSize) { + return ListPhraseSetRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListPhraseSetRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListPhraseSetResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListPhraseSetResponse payload) { + return payload.getPhraseSetsList() == null + ? ImmutableList.of() + : payload.getPhraseSetsList(); + } + }; + + private static final PagedListDescriptor< + ListCustomClassesRequest, ListCustomClassesResponse, CustomClass> + LIST_CUSTOM_CLASSES_PAGE_STR_DESC = + new PagedListDescriptor< + ListCustomClassesRequest, ListCustomClassesResponse, CustomClass>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCustomClassesRequest injectToken( + ListCustomClassesRequest payload, String token) { + return ListCustomClassesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCustomClassesRequest injectPageSize( + ListCustomClassesRequest payload, int pageSize) { + return ListCustomClassesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListCustomClassesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCustomClassesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListCustomClassesResponse payload) { + return payload.getCustomClassesList() == null + ? ImmutableList.of() + : payload.getCustomClassesList(); + } + }; + + private static final PagedListResponseFactory< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + LIST_PHRASE_SET_PAGE_STR_FACT = + new PagedListResponseFactory< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListPhraseSetRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PHRASE_SET_PAGE_STR_DESC, request, context); + return ListPhraseSetPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + LIST_CUSTOM_CLASSES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCustomClassesRequest, + ListCustomClassesResponse, + ListCustomClassesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListCustomClassesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_CUSTOM_CLASSES_PAGE_STR_DESC, request, context); + return ListCustomClassesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createPhraseSet. */ + public UnaryCallSettings createPhraseSetSettings() { + return createPhraseSetSettings; + } + + /** Returns the object with the settings used for calls to getPhraseSet. */ + public UnaryCallSettings getPhraseSetSettings() { + return getPhraseSetSettings; + } + + /** Returns the object with the settings used for calls to listPhraseSet. */ + public PagedCallSettings + listPhraseSetSettings() { + return listPhraseSetSettings; + } + + /** Returns the object with the settings used for calls to updatePhraseSet. */ + public UnaryCallSettings updatePhraseSetSettings() { + return updatePhraseSetSettings; + } + + /** Returns the object with the settings used for calls to deletePhraseSet. */ + public UnaryCallSettings deletePhraseSetSettings() { + return deletePhraseSetSettings; + } + + /** Returns the object with the settings used for calls to createCustomClass. */ + public UnaryCallSettings createCustomClassSettings() { + return createCustomClassSettings; + } + + /** Returns the object with the settings used for calls to getCustomClass. */ + public UnaryCallSettings getCustomClassSettings() { + return getCustomClassSettings; + } + + /** Returns the object with the settings used for calls to listCustomClasses. */ + public PagedCallSettings< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings() { + return listCustomClassesSettings; + } + + /** Returns the object with the settings used for calls to updateCustomClass. */ + public UnaryCallSettings updateCustomClassSettings() { + return updateCustomClassSettings; + } + + /** Returns the object with the settings used for calls to deleteCustomClass. */ + public UnaryCallSettings deleteCustomClassSettings() { + return deleteCustomClassSettings; + } + + public AdaptationStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAdaptationStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAdaptationStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "speech.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "speech.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AdaptationStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AdaptationStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AdaptationStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AdaptationStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createPhraseSetSettings = settingsBuilder.createPhraseSetSettings().build(); + getPhraseSetSettings = settingsBuilder.getPhraseSetSettings().build(); + listPhraseSetSettings = settingsBuilder.listPhraseSetSettings().build(); + updatePhraseSetSettings = settingsBuilder.updatePhraseSetSettings().build(); + deletePhraseSetSettings = settingsBuilder.deletePhraseSetSettings().build(); + createCustomClassSettings = settingsBuilder.createCustomClassSettings().build(); + getCustomClassSettings = settingsBuilder.getCustomClassSettings().build(); + listCustomClassesSettings = settingsBuilder.listCustomClassesSettings().build(); + updateCustomClassSettings = settingsBuilder.updateCustomClassSettings().build(); + deleteCustomClassSettings = settingsBuilder.deleteCustomClassSettings().build(); + } + + /** Builder for AdaptationStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createPhraseSetSettings; + private final UnaryCallSettings.Builder getPhraseSetSettings; + private final PagedCallSettings.Builder< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + listPhraseSetSettings; + private final UnaryCallSettings.Builder + updatePhraseSetSettings; + private final UnaryCallSettings.Builder deletePhraseSetSettings; + private final UnaryCallSettings.Builder + createCustomClassSettings; + private final UnaryCallSettings.Builder + getCustomClassSettings; + private final PagedCallSettings.Builder< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings; + private final UnaryCallSettings.Builder + updateCustomClassSettings; + private final UnaryCallSettings.Builder + deleteCustomClassSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createPhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getPhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listPhraseSetSettings = PagedCallSettings.newBuilder(LIST_PHRASE_SET_PAGE_STR_FACT); + updatePhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deletePhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listCustomClassesSettings = PagedCallSettings.newBuilder(LIST_CUSTOM_CLASSES_PAGE_STR_FACT); + updateCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createPhraseSetSettings, + getPhraseSetSettings, + listPhraseSetSettings, + updatePhraseSetSettings, + deletePhraseSetSettings, + createCustomClassSettings, + getCustomClassSettings, + listCustomClassesSettings, + updateCustomClassSettings, + deleteCustomClassSettings); + initDefaults(this); + } + + protected Builder(AdaptationStubSettings settings) { + super(settings); + + createPhraseSetSettings = settings.createPhraseSetSettings.toBuilder(); + getPhraseSetSettings = settings.getPhraseSetSettings.toBuilder(); + listPhraseSetSettings = settings.listPhraseSetSettings.toBuilder(); + updatePhraseSetSettings = settings.updatePhraseSetSettings.toBuilder(); + deletePhraseSetSettings = settings.deletePhraseSetSettings.toBuilder(); + createCustomClassSettings = settings.createCustomClassSettings.toBuilder(); + getCustomClassSettings = settings.getCustomClassSettings.toBuilder(); + listCustomClassesSettings = settings.listCustomClassesSettings.toBuilder(); + updateCustomClassSettings = settings.updateCustomClassSettings.toBuilder(); + deleteCustomClassSettings = settings.deleteCustomClassSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createPhraseSetSettings, + getPhraseSetSettings, + listPhraseSetSettings, + updatePhraseSetSettings, + deletePhraseSetSettings, + createCustomClassSettings, + getCustomClassSettings, + listCustomClassesSettings, + updateCustomClassSettings, + deleteCustomClassSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createPhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getPhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listPhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updatePhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deletePhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createCustomClassSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getCustomClassSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listCustomClassesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateCustomClassSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteCustomClassSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createPhraseSet. */ + public UnaryCallSettings.Builder createPhraseSetSettings() { + return createPhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to getPhraseSet. */ + public UnaryCallSettings.Builder getPhraseSetSettings() { + return getPhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to listPhraseSet. */ + public PagedCallSettings.Builder< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + listPhraseSetSettings() { + return listPhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to updatePhraseSet. */ + public UnaryCallSettings.Builder updatePhraseSetSettings() { + return updatePhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to deletePhraseSet. */ + public UnaryCallSettings.Builder deletePhraseSetSettings() { + return deletePhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to createCustomClass. */ + public UnaryCallSettings.Builder + createCustomClassSettings() { + return createCustomClassSettings; + } + + /** Returns the builder for the settings used for calls to getCustomClass. */ + public UnaryCallSettings.Builder getCustomClassSettings() { + return getCustomClassSettings; + } + + /** Returns the builder for the settings used for calls to listCustomClasses. */ + public PagedCallSettings.Builder< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings() { + return listCustomClassesSettings; + } + + /** Returns the builder for the settings used for calls to updateCustomClass. */ + public UnaryCallSettings.Builder + updateCustomClassSettings() { + return updateCustomClassSettings; + } + + /** Returns the builder for the settings used for calls to deleteCustomClass. */ + public UnaryCallSettings.Builder deleteCustomClassSettings() { + return deleteCustomClassSettings; + } + + @Override + public AdaptationStubSettings build() throws IOException { + return new AdaptationStubSettings(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationCallableFactory.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationCallableFactory.java new file mode 100644 index 000000000000..63f06400b080 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Adaptation service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcAdaptationCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationStub.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationStub.java new file mode 100644 index 000000000000..45bd5bdce97f --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationStub.java @@ -0,0 +1,475 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub; + +import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1.CreateCustomClassRequest; +import com.google.cloud.speech.v1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.DeleteCustomClassRequest; +import com.google.cloud.speech.v1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1.GetCustomClassRequest; +import com.google.cloud.speech.v1.GetPhraseSetRequest; +import com.google.cloud.speech.v1.ListCustomClassesRequest; +import com.google.cloud.speech.v1.ListCustomClassesResponse; +import com.google.cloud.speech.v1.ListPhraseSetRequest; +import com.google.cloud.speech.v1.ListPhraseSetResponse; +import com.google.cloud.speech.v1.PhraseSet; +import com.google.cloud.speech.v1.UpdateCustomClassRequest; +import com.google.cloud.speech.v1.UpdatePhraseSetRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Adaptation service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcAdaptationStub extends AdaptationStub { + private static final MethodDescriptor + createPhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1.Adaptation/CreatePhraseSet") + .setRequestMarshaller( + ProtoUtils.marshaller(CreatePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getPhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1.Adaptation/GetPhraseSet") + .setRequestMarshaller(ProtoUtils.marshaller(GetPhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listPhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1.Adaptation/ListPhraseSet") + .setRequestMarshaller( + ProtoUtils.marshaller(ListPhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListPhraseSetResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updatePhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1.Adaptation/UpdatePhraseSet") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdatePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deletePhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1.Adaptation/DeletePhraseSet") + .setRequestMarshaller( + ProtoUtils.marshaller(DeletePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createCustomClassMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1.Adaptation/CreateCustomClass") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getCustomClassMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1.Adaptation/GetCustomClass") + .setRequestMarshaller( + ProtoUtils.marshaller(GetCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listCustomClassesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1.Adaptation/ListCustomClasses") + .setRequestMarshaller( + ProtoUtils.marshaller(ListCustomClassesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCustomClassesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateCustomClassMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1.Adaptation/UpdateCustomClass") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteCustomClassMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1.Adaptation/DeleteCustomClass") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final UnaryCallable createPhraseSetCallable; + private final UnaryCallable getPhraseSetCallable; + private final UnaryCallable listPhraseSetCallable; + private final UnaryCallable + listPhraseSetPagedCallable; + private final UnaryCallable updatePhraseSetCallable; + private final UnaryCallable deletePhraseSetCallable; + private final UnaryCallable createCustomClassCallable; + private final UnaryCallable getCustomClassCallable; + private final UnaryCallable + listCustomClassesCallable; + private final UnaryCallable + listCustomClassesPagedCallable; + private final UnaryCallable updateCustomClassCallable; + private final UnaryCallable deleteCustomClassCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAdaptationStub create(AdaptationStubSettings settings) + throws IOException { + return new GrpcAdaptationStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAdaptationStub create(ClientContext clientContext) throws IOException { + return new GrpcAdaptationStub(AdaptationStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAdaptationStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAdaptationStub( + AdaptationStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAdaptationStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcAdaptationStub(AdaptationStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAdaptationCallableFactory()); + } + + /** + * Constructs an instance of GrpcAdaptationStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcAdaptationStub( + AdaptationStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createPhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createPhraseSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getPhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPhraseSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listPhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listPhraseSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updatePhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updatePhraseSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("phrase_set.name", String.valueOf(request.getPhraseSet().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deletePhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deletePhraseSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createCustomClassTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createCustomClassMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getCustomClassTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getCustomClassMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listCustomClassesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listCustomClassesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateCustomClassTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateCustomClassMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "custom_class.name", String.valueOf(request.getCustomClass().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteCustomClassTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteCustomClassMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.createPhraseSetCallable = + callableFactory.createUnaryCallable( + createPhraseSetTransportSettings, settings.createPhraseSetSettings(), clientContext); + this.getPhraseSetCallable = + callableFactory.createUnaryCallable( + getPhraseSetTransportSettings, settings.getPhraseSetSettings(), clientContext); + this.listPhraseSetCallable = + callableFactory.createUnaryCallable( + listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); + this.listPhraseSetPagedCallable = + callableFactory.createPagedCallable( + listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); + this.updatePhraseSetCallable = + callableFactory.createUnaryCallable( + updatePhraseSetTransportSettings, settings.updatePhraseSetSettings(), clientContext); + this.deletePhraseSetCallable = + callableFactory.createUnaryCallable( + deletePhraseSetTransportSettings, settings.deletePhraseSetSettings(), clientContext); + this.createCustomClassCallable = + callableFactory.createUnaryCallable( + createCustomClassTransportSettings, + settings.createCustomClassSettings(), + clientContext); + this.getCustomClassCallable = + callableFactory.createUnaryCallable( + getCustomClassTransportSettings, settings.getCustomClassSettings(), clientContext); + this.listCustomClassesCallable = + callableFactory.createUnaryCallable( + listCustomClassesTransportSettings, + settings.listCustomClassesSettings(), + clientContext); + this.listCustomClassesPagedCallable = + callableFactory.createPagedCallable( + listCustomClassesTransportSettings, + settings.listCustomClassesSettings(), + clientContext); + this.updateCustomClassCallable = + callableFactory.createUnaryCallable( + updateCustomClassTransportSettings, + settings.updateCustomClassSettings(), + clientContext); + this.deleteCustomClassCallable = + callableFactory.createUnaryCallable( + deleteCustomClassTransportSettings, + settings.deleteCustomClassSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createPhraseSetCallable() { + return createPhraseSetCallable; + } + + @Override + public UnaryCallable getPhraseSetCallable() { + return getPhraseSetCallable; + } + + @Override + public UnaryCallable listPhraseSetCallable() { + return listPhraseSetCallable; + } + + @Override + public UnaryCallable + listPhraseSetPagedCallable() { + return listPhraseSetPagedCallable; + } + + @Override + public UnaryCallable updatePhraseSetCallable() { + return updatePhraseSetCallable; + } + + @Override + public UnaryCallable deletePhraseSetCallable() { + return deletePhraseSetCallable; + } + + @Override + public UnaryCallable createCustomClassCallable() { + return createCustomClassCallable; + } + + @Override + public UnaryCallable getCustomClassCallable() { + return getCustomClassCallable; + } + + @Override + public UnaryCallable + listCustomClassesCallable() { + return listCustomClassesCallable; + } + + @Override + public UnaryCallable + listCustomClassesPagedCallable() { + return listCustomClassesPagedCallable; + } + + @Override + public UnaryCallable updateCustomClassCallable() { + return updateCustomClassCallable; + } + + @Override + public UnaryCallable deleteCustomClassCallable() { + return deleteCustomClassCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechCallableFactory.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechCallableFactory.java new file mode 100644 index 000000000000..4909998632ca --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechCallableFactory.java @@ -0,0 +1,113 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub; + +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Speech service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcSpeechCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java new file mode 100644 index 000000000000..106484d9312c --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java @@ -0,0 +1,227 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1.RecognizeRequest; +import com.google.cloud.speech.v1.RecognizeResponse; +import com.google.cloud.speech.v1.StreamingRecognizeRequest; +import com.google.cloud.speech.v1.StreamingRecognizeResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Speech service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcSpeechStub extends SpeechStub { + private static final MethodDescriptor + recognizeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1.Speech/Recognize") + .setRequestMarshaller(ProtoUtils.marshaller(RecognizeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RecognizeResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + longRunningRecognizeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1.Speech/LongRunningRecognize") + .setRequestMarshaller( + ProtoUtils.marshaller(LongRunningRecognizeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + streamingRecognizeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.cloud.speech.v1.Speech/StreamingRecognize") + .setRequestMarshaller( + ProtoUtils.marshaller(StreamingRecognizeRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamingRecognizeResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable recognizeCallable; + private final UnaryCallable longRunningRecognizeCallable; + private final OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable; + private final BidiStreamingCallable + streamingRecognizeCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSpeechStub create(SpeechStubSettings settings) throws IOException { + return new GrpcSpeechStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSpeechStub create(ClientContext clientContext) throws IOException { + return new GrpcSpeechStub(SpeechStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSpeechStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSpeechStub( + SpeechStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSpeechCallableFactory()); + } + + /** + * Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcSpeechStub( + SpeechStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings recognizeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(recognizeMethodDescriptor) + .build(); + GrpcCallSettings longRunningRecognizeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(longRunningRecognizeMethodDescriptor) + .build(); + GrpcCallSettings + streamingRecognizeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamingRecognizeMethodDescriptor) + .build(); + + this.recognizeCallable = + callableFactory.createUnaryCallable( + recognizeTransportSettings, settings.recognizeSettings(), clientContext); + this.longRunningRecognizeCallable = + callableFactory.createUnaryCallable( + longRunningRecognizeTransportSettings, + settings.longRunningRecognizeSettings(), + clientContext); + this.longRunningRecognizeOperationCallable = + callableFactory.createOperationCallable( + longRunningRecognizeTransportSettings, + settings.longRunningRecognizeOperationSettings(), + clientContext, + operationsStub); + this.streamingRecognizeCallable = + callableFactory.createBidiStreamingCallable( + streamingRecognizeTransportSettings, + settings.streamingRecognizeSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable recognizeCallable() { + return recognizeCallable; + } + + @Override + public UnaryCallable longRunningRecognizeCallable() { + return longRunningRecognizeCallable; + } + + @Override + public OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable() { + return longRunningRecognizeOperationCallable; + } + + @Override + public BidiStreamingCallable + streamingRecognizeCallable() { + return streamingRecognizeCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationCallableFactory.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationCallableFactory.java new file mode 100644 index 000000000000..5d727420739d --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationCallableFactory.java @@ -0,0 +1,105 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Adaptation service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonAdaptationCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationStub.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationStub.java new file mode 100644 index 000000000000..acc891cc94de --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationStub.java @@ -0,0 +1,695 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub; + +import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1.CreateCustomClassRequest; +import com.google.cloud.speech.v1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.DeleteCustomClassRequest; +import com.google.cloud.speech.v1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1.GetCustomClassRequest; +import com.google.cloud.speech.v1.GetPhraseSetRequest; +import com.google.cloud.speech.v1.ListCustomClassesRequest; +import com.google.cloud.speech.v1.ListCustomClassesResponse; +import com.google.cloud.speech.v1.ListPhraseSetRequest; +import com.google.cloud.speech.v1.ListPhraseSetResponse; +import com.google.cloud.speech.v1.PhraseSet; +import com.google.cloud.speech.v1.UpdateCustomClassRequest; +import com.google.cloud.speech.v1.UpdatePhraseSetRequest; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Adaptation service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonAdaptationStub extends AdaptationStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createPhraseSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1.Adaptation/CreatePhraseSet") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/phraseSets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PhraseSet.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getPhraseSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1.Adaptation/GetPhraseSet") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/phraseSets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PhraseSet.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listPhraseSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1.Adaptation/ListPhraseSet") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/phraseSets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListPhraseSetResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updatePhraseSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1.Adaptation/UpdatePhraseSet") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{phraseSet.name=projects/*/locations/*/phraseSets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "phraseSet.name", request.getPhraseSet().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("phraseSet", request.getPhraseSet(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PhraseSet.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deletePhraseSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1.Adaptation/DeletePhraseSet") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/phraseSets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createCustomClassMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1.Adaptation/CreateCustomClass") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/customClasses", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(CustomClass.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getCustomClassMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1.Adaptation/GetCustomClass") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/customClasses/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(CustomClass.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listCustomClassesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1.Adaptation/ListCustomClasses") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/customClasses", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListCustomClassesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateCustomClassMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1.Adaptation/UpdateCustomClass") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{customClass.name=projects/*/locations/*/customClasses/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "customClass.name", request.getCustomClass().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("customClass", request.getCustomClass(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(CustomClass.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteCustomClassMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1.Adaptation/DeleteCustomClass") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/customClasses/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createPhraseSetCallable; + private final UnaryCallable getPhraseSetCallable; + private final UnaryCallable listPhraseSetCallable; + private final UnaryCallable + listPhraseSetPagedCallable; + private final UnaryCallable updatePhraseSetCallable; + private final UnaryCallable deletePhraseSetCallable; + private final UnaryCallable createCustomClassCallable; + private final UnaryCallable getCustomClassCallable; + private final UnaryCallable + listCustomClassesCallable; + private final UnaryCallable + listCustomClassesPagedCallable; + private final UnaryCallable updateCustomClassCallable; + private final UnaryCallable deleteCustomClassCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAdaptationStub create(AdaptationStubSettings settings) + throws IOException { + return new HttpJsonAdaptationStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAdaptationStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAdaptationStub( + AdaptationStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAdaptationStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAdaptationStub( + AdaptationStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAdaptationStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonAdaptationStub(AdaptationStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonAdaptationCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAdaptationStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonAdaptationStub( + AdaptationStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createPhraseSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createPhraseSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getPhraseSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPhraseSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listPhraseSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listPhraseSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updatePhraseSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updatePhraseSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deletePhraseSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deletePhraseSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createCustomClassTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createCustomClassMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getCustomClassTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getCustomClassMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listCustomClassesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listCustomClassesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateCustomClassTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateCustomClassMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteCustomClassTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteCustomClassMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createPhraseSetCallable = + callableFactory.createUnaryCallable( + createPhraseSetTransportSettings, settings.createPhraseSetSettings(), clientContext); + this.getPhraseSetCallable = + callableFactory.createUnaryCallable( + getPhraseSetTransportSettings, settings.getPhraseSetSettings(), clientContext); + this.listPhraseSetCallable = + callableFactory.createUnaryCallable( + listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); + this.listPhraseSetPagedCallable = + callableFactory.createPagedCallable( + listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); + this.updatePhraseSetCallable = + callableFactory.createUnaryCallable( + updatePhraseSetTransportSettings, settings.updatePhraseSetSettings(), clientContext); + this.deletePhraseSetCallable = + callableFactory.createUnaryCallable( + deletePhraseSetTransportSettings, settings.deletePhraseSetSettings(), clientContext); + this.createCustomClassCallable = + callableFactory.createUnaryCallable( + createCustomClassTransportSettings, + settings.createCustomClassSettings(), + clientContext); + this.getCustomClassCallable = + callableFactory.createUnaryCallable( + getCustomClassTransportSettings, settings.getCustomClassSettings(), clientContext); + this.listCustomClassesCallable = + callableFactory.createUnaryCallable( + listCustomClassesTransportSettings, + settings.listCustomClassesSettings(), + clientContext); + this.listCustomClassesPagedCallable = + callableFactory.createPagedCallable( + listCustomClassesTransportSettings, + settings.listCustomClassesSettings(), + clientContext); + this.updateCustomClassCallable = + callableFactory.createUnaryCallable( + updateCustomClassTransportSettings, + settings.updateCustomClassSettings(), + clientContext); + this.deleteCustomClassCallable = + callableFactory.createUnaryCallable( + deleteCustomClassTransportSettings, + settings.deleteCustomClassSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createPhraseSetMethodDescriptor); + methodDescriptors.add(getPhraseSetMethodDescriptor); + methodDescriptors.add(listPhraseSetMethodDescriptor); + methodDescriptors.add(updatePhraseSetMethodDescriptor); + methodDescriptors.add(deletePhraseSetMethodDescriptor); + methodDescriptors.add(createCustomClassMethodDescriptor); + methodDescriptors.add(getCustomClassMethodDescriptor); + methodDescriptors.add(listCustomClassesMethodDescriptor); + methodDescriptors.add(updateCustomClassMethodDescriptor); + methodDescriptors.add(deleteCustomClassMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createPhraseSetCallable() { + return createPhraseSetCallable; + } + + @Override + public UnaryCallable getPhraseSetCallable() { + return getPhraseSetCallable; + } + + @Override + public UnaryCallable listPhraseSetCallable() { + return listPhraseSetCallable; + } + + @Override + public UnaryCallable + listPhraseSetPagedCallable() { + return listPhraseSetPagedCallable; + } + + @Override + public UnaryCallable updatePhraseSetCallable() { + return updatePhraseSetCallable; + } + + @Override + public UnaryCallable deletePhraseSetCallable() { + return deletePhraseSetCallable; + } + + @Override + public UnaryCallable createCustomClassCallable() { + return createCustomClassCallable; + } + + @Override + public UnaryCallable getCustomClassCallable() { + return getCustomClassCallable; + } + + @Override + public UnaryCallable + listCustomClassesCallable() { + return listCustomClassesCallable; + } + + @Override + public UnaryCallable + listCustomClassesPagedCallable() { + return listCustomClassesPagedCallable; + } + + @Override + public UnaryCallable updateCustomClassCallable() { + return updateCustomClassCallable; + } + + @Override + public UnaryCallable deleteCustomClassCallable() { + return deleteCustomClassCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechCallableFactory.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechCallableFactory.java new file mode 100644 index 000000000000..04d590f69284 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechCallableFactory.java @@ -0,0 +1,105 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Speech service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonSpeechCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechStub.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechStub.java new file mode 100644 index 000000000000..447b8bdb8b5c --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechStub.java @@ -0,0 +1,281 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1.RecognizeRequest; +import com.google.cloud.speech.v1.RecognizeResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Speech service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonSpeechStub extends SpeechStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(LongRunningRecognizeResponse.getDescriptor()) + .add(LongRunningRecognizeMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + recognizeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1.Speech/Recognize") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/speech:recognize", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RecognizeResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + longRunningRecognizeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1.Speech/LongRunningRecognize") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/speech:longrunningrecognize", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (LongRunningRecognizeRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable recognizeCallable; + private final UnaryCallable longRunningRecognizeCallable; + private final OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSpeechStub create(SpeechStubSettings settings) throws IOException { + return new HttpJsonSpeechStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSpeechStub create(ClientContext clientContext) throws IOException { + return new HttpJsonSpeechStub(SpeechStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSpeechStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSpeechStub( + SpeechStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSpeechStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonSpeechCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSpeechStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonSpeechStub( + SpeechStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings recognizeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(recognizeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + longRunningRecognizeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(longRunningRecognizeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.recognizeCallable = + callableFactory.createUnaryCallable( + recognizeTransportSettings, settings.recognizeSettings(), clientContext); + this.longRunningRecognizeCallable = + callableFactory.createUnaryCallable( + longRunningRecognizeTransportSettings, + settings.longRunningRecognizeSettings(), + clientContext); + this.longRunningRecognizeOperationCallable = + callableFactory.createOperationCallable( + longRunningRecognizeTransportSettings, + settings.longRunningRecognizeOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(recognizeMethodDescriptor); + methodDescriptors.add(longRunningRecognizeMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable recognizeCallable() { + return recognizeCallable; + } + + @Override + public UnaryCallable longRunningRecognizeCallable() { + return longRunningRecognizeCallable; + } + + @Override + public OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable() { + return longRunningRecognizeOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java new file mode 100644 index 000000000000..5e70c9d9265d --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java @@ -0,0 +1,73 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1.RecognizeRequest; +import com.google.cloud.speech.v1.RecognizeResponse; +import com.google.cloud.speech.v1.StreamingRecognizeRequest; +import com.google.cloud.speech.v1.StreamingRecognizeResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Speech service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class SpeechStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable recognizeCallable() { + throw new UnsupportedOperationException("Not implemented: recognizeCallable()"); + } + + public OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: longRunningRecognizeOperationCallable()"); + } + + public UnaryCallable longRunningRecognizeCallable() { + throw new UnsupportedOperationException("Not implemented: longRunningRecognizeCallable()"); + } + + public BidiStreamingCallable + streamingRecognizeCallable() { + throw new UnsupportedOperationException("Not implemented: streamingRecognizeCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java new file mode 100644 index 000000000000..dff8b9126236 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java @@ -0,0 +1,440 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1.RecognizeRequest; +import com.google.cloud.speech.v1.RecognizeResponse; +import com.google.cloud.speech.v1.StreamingRecognizeRequest; +import com.google.cloud.speech.v1.StreamingRecognizeResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SpeechStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (speech.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of recognize to 30 seconds: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SpeechStubSettings.Builder speechSettingsBuilder = SpeechStubSettings.newBuilder();
+ * speechSettingsBuilder
+ *     .recognizeSettings()
+ *     .setRetrySettings(
+ *         speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SpeechStubSettings speechSettings = speechSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class SpeechStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings recognizeSettings; + private final UnaryCallSettings + longRunningRecognizeSettings; + private final OperationCallSettings< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings; + private final StreamingCallSettings + streamingRecognizeSettings; + + /** Returns the object with the settings used for calls to recognize. */ + public UnaryCallSettings recognizeSettings() { + return recognizeSettings; + } + + /** Returns the object with the settings used for calls to longRunningRecognize. */ + public UnaryCallSettings longRunningRecognizeSettings() { + return longRunningRecognizeSettings; + } + + /** Returns the object with the settings used for calls to longRunningRecognize. */ + public OperationCallSettings< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings() { + return longRunningRecognizeOperationSettings; + } + + /** Returns the object with the settings used for calls to streamingRecognize. */ + public StreamingCallSettings + streamingRecognizeSettings() { + return streamingRecognizeSettings; + } + + public SpeechStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSpeechStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSpeechStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "speech.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "speech.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SpeechStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SpeechStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SpeechStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + recognizeSettings = settingsBuilder.recognizeSettings().build(); + longRunningRecognizeSettings = settingsBuilder.longRunningRecognizeSettings().build(); + longRunningRecognizeOperationSettings = + settingsBuilder.longRunningRecognizeOperationSettings().build(); + streamingRecognizeSettings = settingsBuilder.streamingRecognizeSettings().build(); + } + + /** Builder for SpeechStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder recognizeSettings; + private final UnaryCallSettings.Builder + longRunningRecognizeSettings; + private final OperationCallSettings.Builder< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings; + private final StreamingCallSettings.Builder< + StreamingRecognizeRequest, StreamingRecognizeResponse> + streamingRecognizeSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000000L)) + .setTotalTimeout(Duration.ofMillis(5000000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000000L)) + .setTotalTimeout(Duration.ofMillis(5000000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + recognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + longRunningRecognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + longRunningRecognizeOperationSettings = OperationCallSettings.newBuilder(); + streamingRecognizeSettings = StreamingCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + recognizeSettings, longRunningRecognizeSettings); + initDefaults(this); + } + + protected Builder(SpeechStubSettings settings) { + super(settings); + + recognizeSettings = settings.recognizeSettings.toBuilder(); + longRunningRecognizeSettings = settings.longRunningRecognizeSettings.toBuilder(); + longRunningRecognizeOperationSettings = + settings.longRunningRecognizeOperationSettings.toBuilder(); + streamingRecognizeSettings = settings.streamingRecognizeSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + recognizeSettings, longRunningRecognizeSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .recognizeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .longRunningRecognizeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .longRunningRecognizeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + LongRunningRecognizeResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + LongRunningRecognizeMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to recognize. */ + public UnaryCallSettings.Builder recognizeSettings() { + return recognizeSettings; + } + + /** Returns the builder for the settings used for calls to longRunningRecognize. */ + public UnaryCallSettings.Builder + longRunningRecognizeSettings() { + return longRunningRecognizeSettings; + } + + /** Returns the builder for the settings used for calls to longRunningRecognize. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings() { + return longRunningRecognizeOperationSettings; + } + + /** Returns the builder for the settings used for calls to streamingRecognize. */ + public StreamingCallSettings.Builder + streamingRecognizeSettings() { + return streamingRecognizeSettings; + } + + @Override + public SpeechStubSettings build() throws IOException { + return new SpeechStubSettings(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientHttpJsonTest.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientHttpJsonTest.java new file mode 100644 index 000000000000..c69082500249 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientHttpJsonTest.java @@ -0,0 +1,940 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.speech.v1.stub.HttpJsonAdaptationStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AdaptationClientHttpJsonTest { + private static MockHttpService mockService; + private static AdaptationClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonAdaptationStub.getMethodDescriptors(), AdaptationSettings.getDefaultEndpoint()); + AdaptationSettings settings = + AdaptationSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + AdaptationSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AdaptationClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createPhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + + PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createPhraseSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPhraseSetTest2() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + + PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createPhraseSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockService.addResponse(expectedResponse); + + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + + PhraseSet actualResponse = client.getPhraseSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getPhraseSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + client.getPhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPhraseSetTest2() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; + + PhraseSet actualResponse = client.getPhraseSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getPhraseSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; + client.getPhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPhraseSetTest() throws Exception { + PhraseSet responsesElement = PhraseSet.newBuilder().build(); + ListPhraseSetResponse expectedResponse = + ListPhraseSetResponse.newBuilder() + .setNextPageToken("") + .addAllPhraseSets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listPhraseSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listPhraseSet(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPhraseSetTest2() throws Exception { + PhraseSet responsesElement = PhraseSet.newBuilder().build(); + ListPhraseSetResponse expectedResponse = + ListPhraseSetResponse.newBuilder() + .setNextPageToken("") + .addAllPhraseSets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listPhraseSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listPhraseSet(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updatePhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockService.addResponse(expectedResponse); + + PhraseSet phraseSet = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + PhraseSet actualResponse = client.updatePhraseSet(phraseSet, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updatePhraseSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PhraseSet phraseSet = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updatePhraseSet(phraseSet, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePhraseSetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + + client.deletePhraseSet(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deletePhraseSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + client.deletePhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePhraseSetTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; + + client.deletePhraseSet(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deletePhraseSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; + client.deletePhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + + CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createCustomClassExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + client.createCustomClass(parent, customClass, customClassId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createCustomClassTest2() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + + CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createCustomClassExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + client.createCustomClass(parent, customClass, customClassId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + + CustomClass actualResponse = client.getCustomClass(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getCustomClassExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + client.getCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomClassTest2() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; + + CustomClass actualResponse = client.getCustomClass(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getCustomClassExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; + client.getCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomClassesTest() throws Exception { + CustomClass responsesElement = CustomClass.newBuilder().build(); + ListCustomClassesResponse expectedResponse = + ListCustomClassesResponse.newBuilder() + .setNextPageToken("") + .addAllCustomClasses(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listCustomClassesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listCustomClasses(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomClassesTest2() throws Exception { + CustomClass responsesElement = CustomClass.newBuilder().build(); + ListCustomClassesResponse expectedResponse = + ListCustomClassesResponse.newBuilder() + .setNextPageToken("") + .addAllCustomClasses(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listCustomClassesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listCustomClasses(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + CustomClass customClass = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + CustomClass actualResponse = client.updateCustomClass(customClass, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateCustomClassExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomClass customClass = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateCustomClass(customClass, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCustomClassTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + + client.deleteCustomClass(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteCustomClassExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + client.deleteCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCustomClassTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; + + client.deleteCustomClass(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteCustomClassExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; + client.deleteCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientTest.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientTest.java new file mode 100644 index 000000000000..2a1c56b7740c --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientTest.java @@ -0,0 +1,826 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AdaptationClientTest { + private static MockAdaptation mockAdaptation; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AdaptationClient client; + + @BeforeClass + public static void startStaticServer() { + mockAdaptation = new MockAdaptation(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockAdaptation)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AdaptationSettings settings = + AdaptationSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AdaptationClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createPhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + + PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePhraseSetRequest actualRequest = ((CreatePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); + Assert.assertEquals(phraseSetId, actualRequest.getPhraseSetId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPhraseSetTest2() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String parent = "parent-995424086"; + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + + PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePhraseSetRequest actualRequest = ((CreatePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); + Assert.assertEquals(phraseSetId, actualRequest.getPhraseSetId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPhraseSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String parent = "parent-995424086"; + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + + PhraseSet actualResponse = client.getPhraseSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPhraseSetRequest actualRequest = ((GetPhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + client.getPhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPhraseSetTest2() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String name = "name3373707"; + + PhraseSet actualResponse = client.getPhraseSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPhraseSetRequest actualRequest = ((GetPhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPhraseSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String name = "name3373707"; + client.getPhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPhraseSetTest() throws Exception { + PhraseSet responsesElement = PhraseSet.newBuilder().build(); + ListPhraseSetResponse expectedResponse = + ListPhraseSetResponse.newBuilder() + .setNextPageToken("") + .addAllPhraseSets(Arrays.asList(responsesElement)) + .build(); + mockAdaptation.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPhraseSetRequest actualRequest = ((ListPhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listPhraseSet(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPhraseSetTest2() throws Exception { + PhraseSet responsesElement = PhraseSet.newBuilder().build(); + ListPhraseSetResponse expectedResponse = + ListPhraseSetResponse.newBuilder() + .setNextPageToken("") + .addAllPhraseSets(Arrays.asList(responsesElement)) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPhraseSetRequest actualRequest = ((ListPhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPhraseSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String parent = "parent-995424086"; + client.listPhraseSet(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updatePhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + PhraseSet actualResponse = client.updatePhraseSet(phraseSet, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdatePhraseSetRequest actualRequest = ((UpdatePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updatePhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updatePhraseSet(phraseSet, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePhraseSetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAdaptation.addResponse(expectedResponse); + + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + + client.deletePhraseSet(name); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePhraseSetRequest actualRequest = ((DeletePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + client.deletePhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePhraseSetTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAdaptation.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deletePhraseSet(name); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePhraseSetRequest actualRequest = ((DeletePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePhraseSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String name = "name3373707"; + client.deletePhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + + CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateCustomClassRequest actualRequest = ((CreateCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(customClass, actualRequest.getCustomClass()); + Assert.assertEquals(customClassId, actualRequest.getCustomClassId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createCustomClassExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + client.createCustomClass(parent, customClass, customClassId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createCustomClassTest2() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String parent = "parent-995424086"; + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + + CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateCustomClassRequest actualRequest = ((CreateCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(customClass, actualRequest.getCustomClass()); + Assert.assertEquals(customClassId, actualRequest.getCustomClassId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createCustomClassExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String parent = "parent-995424086"; + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + client.createCustomClass(parent, customClass, customClassId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + + CustomClass actualResponse = client.getCustomClass(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCustomClassRequest actualRequest = ((GetCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCustomClassExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + client.getCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomClassTest2() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String name = "name3373707"; + + CustomClass actualResponse = client.getCustomClass(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCustomClassRequest actualRequest = ((GetCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCustomClassExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String name = "name3373707"; + client.getCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomClassesTest() throws Exception { + CustomClass responsesElement = CustomClass.newBuilder().build(); + ListCustomClassesResponse expectedResponse = + ListCustomClassesResponse.newBuilder() + .setNextPageToken("") + .addAllCustomClasses(Arrays.asList(responsesElement)) + .build(); + mockAdaptation.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCustomClassesRequest actualRequest = ((ListCustomClassesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCustomClassesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listCustomClasses(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomClassesTest2() throws Exception { + CustomClass responsesElement = CustomClass.newBuilder().build(); + ListCustomClassesResponse expectedResponse = + ListCustomClassesResponse.newBuilder() + .setNextPageToken("") + .addAllCustomClasses(Arrays.asList(responsesElement)) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCustomClassesRequest actualRequest = ((ListCustomClassesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCustomClassesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String parent = "parent-995424086"; + client.listCustomClasses(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + CustomClass customClass = CustomClass.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + CustomClass actualResponse = client.updateCustomClass(customClass, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCustomClassRequest actualRequest = ((UpdateCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(customClass, actualRequest.getCustomClass()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateCustomClassExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + CustomClass customClass = CustomClass.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateCustomClass(customClass, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCustomClassTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAdaptation.addResponse(expectedResponse); + + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + + client.deleteCustomClass(name); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteCustomClassRequest actualRequest = ((DeleteCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteCustomClassExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + client.deleteCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCustomClassTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAdaptation.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteCustomClass(name); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteCustomClassRequest actualRequest = ((DeleteCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteCustomClassExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String name = "name3373707"; + client.deleteCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptation.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptation.java new file mode 100644 index 000000000000..3ae546d6d4af --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptation.java @@ -0,0 +1,59 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAdaptation implements MockGrpcService { + private final MockAdaptationImpl serviceImpl; + + public MockAdaptation() { + serviceImpl = new MockAdaptationImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptationImpl.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptationImpl.java new file mode 100644 index 000000000000..964710edc0bd --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptationImpl.java @@ -0,0 +1,272 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.speech.v1.AdaptationGrpc.AdaptationImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAdaptationImpl extends AdaptationImplBase { + private List requests; + private Queue responses; + + public MockAdaptationImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createPhraseSet( + CreatePhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PhraseSet) { + requests.add(request); + responseObserver.onNext(((PhraseSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreatePhraseSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PhraseSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getPhraseSet( + GetPhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PhraseSet) { + requests.add(request); + responseObserver.onNext(((PhraseSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetPhraseSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PhraseSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listPhraseSet( + ListPhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListPhraseSetResponse) { + requests.add(request); + responseObserver.onNext(((ListPhraseSetResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListPhraseSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListPhraseSetResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updatePhraseSet( + UpdatePhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PhraseSet) { + requests.add(request); + responseObserver.onNext(((PhraseSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdatePhraseSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PhraseSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deletePhraseSet( + DeletePhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeletePhraseSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createCustomClass( + CreateCustomClassRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CustomClass) { + requests.add(request); + responseObserver.onNext(((CustomClass) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateCustomClass, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CustomClass.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCustomClass( + GetCustomClassRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CustomClass) { + requests.add(request); + responseObserver.onNext(((CustomClass) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetCustomClass, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CustomClass.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listCustomClasses( + ListCustomClassesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListCustomClassesResponse) { + requests.add(request); + responseObserver.onNext(((ListCustomClassesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListCustomClasses, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListCustomClassesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCustomClass( + UpdateCustomClassRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CustomClass) { + requests.add(request); + responseObserver.onNext(((CustomClass) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateCustomClass, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CustomClass.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteCustomClass( + DeleteCustomClassRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteCustomClass, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java new file mode 100644 index 000000000000..19414820b8d3 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java @@ -0,0 +1,59 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSpeech implements MockGrpcService { + private final MockSpeechImpl serviceImpl; + + public MockSpeech() { + serviceImpl = new MockSpeechImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java new file mode 100644 index 000000000000..e53b4bdf237e --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java @@ -0,0 +1,140 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.speech.v1.SpeechGrpc.SpeechImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSpeechImpl extends SpeechImplBase { + private List requests; + private Queue responses; + + public MockSpeechImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void recognize( + RecognizeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RecognizeResponse) { + requests.add(request); + responseObserver.onNext(((RecognizeResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Recognize, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RecognizeResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void longRunningRecognize( + LongRunningRecognizeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method LongRunningRecognize, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver streamingRecognize( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(StreamingRecognizeRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof StreamingRecognizeResponse) { + responseObserver.onNext(((StreamingRecognizeResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StreamingRecognize, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamingRecognizeResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientHttpJsonTest.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientHttpJsonTest.java new file mode 100644 index 000000000000..f924cc6c4f59 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientHttpJsonTest.java @@ -0,0 +1,186 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.speech.v1.stub.HttpJsonSpeechStub; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Duration; +import com.google.rpc.Status; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SpeechClientHttpJsonTest { + private static MockHttpService mockService; + private static SpeechClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSpeechStub.getMethodDescriptors(), SpeechSettings.getDefaultEndpoint()); + SpeechSettings settings = + SpeechSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SpeechSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SpeechClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void recognizeTest() throws Exception { + RecognizeResponse expectedResponse = + RecognizeResponse.newBuilder() + .addAllResults(new ArrayList()) + .setTotalBilledTime(Duration.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + + RecognizeResponse actualResponse = client.recognize(config, audio); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void recognizeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + client.recognize(config, audio); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void longRunningRecognizeTest() throws Exception { + LongRunningRecognizeResponse expectedResponse = + LongRunningRecognizeResponse.newBuilder() + .addAllResults(new ArrayList()) + .setTotalBilledTime(Duration.newBuilder().build()) + .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) + .setOutputError(Status.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("longRunningRecognizeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + + LongRunningRecognizeResponse actualResponse = + client.longRunningRecognizeAsync(config, audio).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void longRunningRecognizeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + client.longRunningRecognizeAsync(config, audio).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void streamingRecognizeUnsupportedMethodTest() throws Exception { + // The streamingRecognize() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } +} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java new file mode 100644 index 000000000000..29ddc3801755 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java @@ -0,0 +1,234 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Duration; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SpeechClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockSpeech mockSpeech; + private LocalChannelProvider channelProvider; + private SpeechClient client; + + @BeforeClass + public static void startStaticServer() { + mockSpeech = new MockSpeech(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockSpeech)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SpeechSettings settings = + SpeechSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SpeechClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void recognizeTest() throws Exception { + RecognizeResponse expectedResponse = + RecognizeResponse.newBuilder() + .addAllResults(new ArrayList()) + .setTotalBilledTime(Duration.newBuilder().build()) + .build(); + mockSpeech.addResponse(expectedResponse); + + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + + RecognizeResponse actualResponse = client.recognize(config, audio); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSpeech.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RecognizeRequest actualRequest = ((RecognizeRequest) actualRequests.get(0)); + + Assert.assertEquals(config, actualRequest.getConfig()); + Assert.assertEquals(audio, actualRequest.getAudio()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void recognizeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSpeech.addException(exception); + + try { + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + client.recognize(config, audio); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void longRunningRecognizeTest() throws Exception { + LongRunningRecognizeResponse expectedResponse = + LongRunningRecognizeResponse.newBuilder() + .addAllResults(new ArrayList()) + .setTotalBilledTime(Duration.newBuilder().build()) + .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) + .setOutputError(Status.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("longRunningRecognizeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSpeech.addResponse(resultOperation); + + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + + LongRunningRecognizeResponse actualResponse = + client.longRunningRecognizeAsync(config, audio).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSpeech.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LongRunningRecognizeRequest actualRequest = + ((LongRunningRecognizeRequest) actualRequests.get(0)); + + Assert.assertEquals(config, actualRequest.getConfig()); + Assert.assertEquals(audio, actualRequest.getAudio()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void longRunningRecognizeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSpeech.addException(exception); + + try { + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + client.longRunningRecognizeAsync(config, audio).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void streamingRecognizeTest() throws Exception { + StreamingRecognizeResponse expectedResponse = + StreamingRecognizeResponse.newBuilder() + .setError(Status.newBuilder().build()) + .addAllResults(new ArrayList()) + .setTotalBilledTime(Duration.newBuilder().build()) + .build(); + mockSpeech.addResponse(expectedResponse); + StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamingRecognizeCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void streamingRecognizeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSpeech.addException(exception); + StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamingRecognizeCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/AdaptationGrpc.java b/owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/AdaptationGrpc.java new file mode 100644 index 000000000000..b536dba14db7 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/AdaptationGrpc.java @@ -0,0 +1,1085 @@ +package com.google.cloud.speech.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + *
+ * Service that implements Google Cloud Speech Adaptation API.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/speech/v1/cloud_speech_adaptation.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class AdaptationGrpc { + + private AdaptationGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.speech.v1.Adaptation"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getCreatePhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreatePhraseSet", + requestType = com.google.cloud.speech.v1.CreatePhraseSetRequest.class, + responseType = com.google.cloud.speech.v1.PhraseSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreatePhraseSetMethod() { + io.grpc.MethodDescriptor getCreatePhraseSetMethod; + if ((getCreatePhraseSetMethod = AdaptationGrpc.getCreatePhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getCreatePhraseSetMethod = AdaptationGrpc.getCreatePhraseSetMethod) == null) { + AdaptationGrpc.getCreatePhraseSetMethod = getCreatePhraseSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreatePhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.CreatePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.PhraseSet.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("CreatePhraseSet")) + .build(); + } + } + } + return getCreatePhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetPhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPhraseSet", + requestType = com.google.cloud.speech.v1.GetPhraseSetRequest.class, + responseType = com.google.cloud.speech.v1.PhraseSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetPhraseSetMethod() { + io.grpc.MethodDescriptor getGetPhraseSetMethod; + if ((getGetPhraseSetMethod = AdaptationGrpc.getGetPhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getGetPhraseSetMethod = AdaptationGrpc.getGetPhraseSetMethod) == null) { + AdaptationGrpc.getGetPhraseSetMethod = getGetPhraseSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.GetPhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.PhraseSet.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("GetPhraseSet")) + .build(); + } + } + } + return getGetPhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor getListPhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPhraseSet", + requestType = com.google.cloud.speech.v1.ListPhraseSetRequest.class, + responseType = com.google.cloud.speech.v1.ListPhraseSetResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListPhraseSetMethod() { + io.grpc.MethodDescriptor getListPhraseSetMethod; + if ((getListPhraseSetMethod = AdaptationGrpc.getListPhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getListPhraseSetMethod = AdaptationGrpc.getListPhraseSetMethod) == null) { + AdaptationGrpc.getListPhraseSetMethod = getListPhraseSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.ListPhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.ListPhraseSetResponse.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("ListPhraseSet")) + .build(); + } + } + } + return getListPhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor getUpdatePhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdatePhraseSet", + requestType = com.google.cloud.speech.v1.UpdatePhraseSetRequest.class, + responseType = com.google.cloud.speech.v1.PhraseSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getUpdatePhraseSetMethod() { + io.grpc.MethodDescriptor getUpdatePhraseSetMethod; + if ((getUpdatePhraseSetMethod = AdaptationGrpc.getUpdatePhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getUpdatePhraseSetMethod = AdaptationGrpc.getUpdatePhraseSetMethod) == null) { + AdaptationGrpc.getUpdatePhraseSetMethod = getUpdatePhraseSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdatePhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.UpdatePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.PhraseSet.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("UpdatePhraseSet")) + .build(); + } + } + } + return getUpdatePhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeletePhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePhraseSet", + requestType = com.google.cloud.speech.v1.DeletePhraseSetRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeletePhraseSetMethod() { + io.grpc.MethodDescriptor getDeletePhraseSetMethod; + if ((getDeletePhraseSetMethod = AdaptationGrpc.getDeletePhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getDeletePhraseSetMethod = AdaptationGrpc.getDeletePhraseSetMethod) == null) { + AdaptationGrpc.getDeletePhraseSetMethod = getDeletePhraseSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeletePhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.DeletePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("DeletePhraseSet")) + .build(); + } + } + } + return getDeletePhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor getCreateCustomClassMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateCustomClass", + requestType = com.google.cloud.speech.v1.CreateCustomClassRequest.class, + responseType = com.google.cloud.speech.v1.CustomClass.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateCustomClassMethod() { + io.grpc.MethodDescriptor getCreateCustomClassMethod; + if ((getCreateCustomClassMethod = AdaptationGrpc.getCreateCustomClassMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getCreateCustomClassMethod = AdaptationGrpc.getCreateCustomClassMethod) == null) { + AdaptationGrpc.getCreateCustomClassMethod = getCreateCustomClassMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCustomClass")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.CreateCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.CustomClass.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("CreateCustomClass")) + .build(); + } + } + } + return getCreateCustomClassMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetCustomClassMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCustomClass", + requestType = com.google.cloud.speech.v1.GetCustomClassRequest.class, + responseType = com.google.cloud.speech.v1.CustomClass.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetCustomClassMethod() { + io.grpc.MethodDescriptor getGetCustomClassMethod; + if ((getGetCustomClassMethod = AdaptationGrpc.getGetCustomClassMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getGetCustomClassMethod = AdaptationGrpc.getGetCustomClassMethod) == null) { + AdaptationGrpc.getGetCustomClassMethod = getGetCustomClassMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCustomClass")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.GetCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.CustomClass.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("GetCustomClass")) + .build(); + } + } + } + return getGetCustomClassMethod; + } + + private static volatile io.grpc.MethodDescriptor getListCustomClassesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListCustomClasses", + requestType = com.google.cloud.speech.v1.ListCustomClassesRequest.class, + responseType = com.google.cloud.speech.v1.ListCustomClassesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListCustomClassesMethod() { + io.grpc.MethodDescriptor getListCustomClassesMethod; + if ((getListCustomClassesMethod = AdaptationGrpc.getListCustomClassesMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getListCustomClassesMethod = AdaptationGrpc.getListCustomClassesMethod) == null) { + AdaptationGrpc.getListCustomClassesMethod = getListCustomClassesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCustomClasses")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.ListCustomClassesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.ListCustomClassesResponse.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("ListCustomClasses")) + .build(); + } + } + } + return getListCustomClassesMethod; + } + + private static volatile io.grpc.MethodDescriptor getUpdateCustomClassMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCustomClass", + requestType = com.google.cloud.speech.v1.UpdateCustomClassRequest.class, + responseType = com.google.cloud.speech.v1.CustomClass.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getUpdateCustomClassMethod() { + io.grpc.MethodDescriptor getUpdateCustomClassMethod; + if ((getUpdateCustomClassMethod = AdaptationGrpc.getUpdateCustomClassMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getUpdateCustomClassMethod = AdaptationGrpc.getUpdateCustomClassMethod) == null) { + AdaptationGrpc.getUpdateCustomClassMethod = getUpdateCustomClassMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCustomClass")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.UpdateCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.CustomClass.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("UpdateCustomClass")) + .build(); + } + } + } + return getUpdateCustomClassMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteCustomClassMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCustomClass", + requestType = com.google.cloud.speech.v1.DeleteCustomClassRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteCustomClassMethod() { + io.grpc.MethodDescriptor getDeleteCustomClassMethod; + if ((getDeleteCustomClassMethod = AdaptationGrpc.getDeleteCustomClassMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getDeleteCustomClassMethod = AdaptationGrpc.getDeleteCustomClassMethod) == null) { + AdaptationGrpc.getDeleteCustomClassMethod = getDeleteCustomClassMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCustomClass")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.DeleteCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("DeleteCustomClass")) + .build(); + } + } + } + return getDeleteCustomClassMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static AdaptationStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AdaptationStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationStub(channel, callOptions); + } + }; + return AdaptationStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AdaptationBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AdaptationBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationBlockingStub(channel, callOptions); + } + }; + return AdaptationBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static AdaptationFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AdaptationFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationFutureStub(channel, callOptions); + } + }; + return AdaptationFutureStub.newStub(factory, channel); + } + + /** + *
+   * Service that implements Google Cloud Speech Adaptation API.
+   * 
+ */ + public static abstract class AdaptationImplBase implements io.grpc.BindableService { + + /** + *
+     * Create a set of phrase hints. Each item in the set can be a single word or
+     * a multi-word phrase. The items in the PhraseSet are favored by the
+     * recognition model when you send a call that includes the PhraseSet.
+     * 
+ */ + public void createPhraseSet(com.google.cloud.speech.v1.CreatePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreatePhraseSetMethod(), responseObserver); + } + + /** + *
+     * Get a phrase set.
+     * 
+ */ + public void getPhraseSet(com.google.cloud.speech.v1.GetPhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPhraseSetMethod(), responseObserver); + } + + /** + *
+     * List phrase sets.
+     * 
+ */ + public void listPhraseSet(com.google.cloud.speech.v1.ListPhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListPhraseSetMethod(), responseObserver); + } + + /** + *
+     * Update a phrase set.
+     * 
+ */ + public void updatePhraseSet(com.google.cloud.speech.v1.UpdatePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdatePhraseSetMethod(), responseObserver); + } + + /** + *
+     * Delete a phrase set.
+     * 
+ */ + public void deletePhraseSet(com.google.cloud.speech.v1.DeletePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeletePhraseSetMethod(), responseObserver); + } + + /** + *
+     * Create a custom class.
+     * 
+ */ + public void createCustomClass(com.google.cloud.speech.v1.CreateCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateCustomClassMethod(), responseObserver); + } + + /** + *
+     * Get a custom class.
+     * 
+ */ + public void getCustomClass(com.google.cloud.speech.v1.GetCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetCustomClassMethod(), responseObserver); + } + + /** + *
+     * List custom classes.
+     * 
+ */ + public void listCustomClasses(com.google.cloud.speech.v1.ListCustomClassesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListCustomClassesMethod(), responseObserver); + } + + /** + *
+     * Update a custom class.
+     * 
+ */ + public void updateCustomClass(com.google.cloud.speech.v1.UpdateCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateCustomClassMethod(), responseObserver); + } + + /** + *
+     * Delete a custom class.
+     * 
+ */ + public void deleteCustomClass(com.google.cloud.speech.v1.DeleteCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteCustomClassMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreatePhraseSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1.CreatePhraseSetRequest, + com.google.cloud.speech.v1.PhraseSet>( + this, METHODID_CREATE_PHRASE_SET))) + .addMethod( + getGetPhraseSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1.GetPhraseSetRequest, + com.google.cloud.speech.v1.PhraseSet>( + this, METHODID_GET_PHRASE_SET))) + .addMethod( + getListPhraseSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1.ListPhraseSetRequest, + com.google.cloud.speech.v1.ListPhraseSetResponse>( + this, METHODID_LIST_PHRASE_SET))) + .addMethod( + getUpdatePhraseSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1.UpdatePhraseSetRequest, + com.google.cloud.speech.v1.PhraseSet>( + this, METHODID_UPDATE_PHRASE_SET))) + .addMethod( + getDeletePhraseSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1.DeletePhraseSetRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_PHRASE_SET))) + .addMethod( + getCreateCustomClassMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1.CreateCustomClassRequest, + com.google.cloud.speech.v1.CustomClass>( + this, METHODID_CREATE_CUSTOM_CLASS))) + .addMethod( + getGetCustomClassMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1.GetCustomClassRequest, + com.google.cloud.speech.v1.CustomClass>( + this, METHODID_GET_CUSTOM_CLASS))) + .addMethod( + getListCustomClassesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1.ListCustomClassesRequest, + com.google.cloud.speech.v1.ListCustomClassesResponse>( + this, METHODID_LIST_CUSTOM_CLASSES))) + .addMethod( + getUpdateCustomClassMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1.UpdateCustomClassRequest, + com.google.cloud.speech.v1.CustomClass>( + this, METHODID_UPDATE_CUSTOM_CLASS))) + .addMethod( + getDeleteCustomClassMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1.DeleteCustomClassRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_CUSTOM_CLASS))) + .build(); + } + } + + /** + *
+   * Service that implements Google Cloud Speech Adaptation API.
+   * 
+ */ + public static final class AdaptationStub extends io.grpc.stub.AbstractAsyncStub { + private AdaptationStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AdaptationStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationStub(channel, callOptions); + } + + /** + *
+     * Create a set of phrase hints. Each item in the set can be a single word or
+     * a multi-word phrase. The items in the PhraseSet are favored by the
+     * recognition model when you send a call that includes the PhraseSet.
+     * 
+ */ + public void createPhraseSet(com.google.cloud.speech.v1.CreatePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreatePhraseSetMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Get a phrase set.
+     * 
+ */ + public void getPhraseSet(com.google.cloud.speech.v1.GetPhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPhraseSetMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * List phrase sets.
+     * 
+ */ + public void listPhraseSet(com.google.cloud.speech.v1.ListPhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPhraseSetMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Update a phrase set.
+     * 
+ */ + public void updatePhraseSet(com.google.cloud.speech.v1.UpdatePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdatePhraseSetMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Delete a phrase set.
+     * 
+ */ + public void deletePhraseSet(com.google.cloud.speech.v1.DeletePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeletePhraseSetMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Create a custom class.
+     * 
+ */ + public void createCustomClass(com.google.cloud.speech.v1.CreateCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateCustomClassMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Get a custom class.
+     * 
+ */ + public void getCustomClass(com.google.cloud.speech.v1.GetCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetCustomClassMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * List custom classes.
+     * 
+ */ + public void listCustomClasses(com.google.cloud.speech.v1.ListCustomClassesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListCustomClassesMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Update a custom class.
+     * 
+ */ + public void updateCustomClass(com.google.cloud.speech.v1.UpdateCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateCustomClassMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Delete a custom class.
+     * 
+ */ + public void deleteCustomClass(com.google.cloud.speech.v1.DeleteCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteCustomClassMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * Service that implements Google Cloud Speech Adaptation API.
+   * 
+ */ + public static final class AdaptationBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private AdaptationBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AdaptationBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationBlockingStub(channel, callOptions); + } + + /** + *
+     * Create a set of phrase hints. Each item in the set can be a single word or
+     * a multi-word phrase. The items in the PhraseSet are favored by the
+     * recognition model when you send a call that includes the PhraseSet.
+     * 
+ */ + public com.google.cloud.speech.v1.PhraseSet createPhraseSet(com.google.cloud.speech.v1.CreatePhraseSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreatePhraseSetMethod(), getCallOptions(), request); + } + + /** + *
+     * Get a phrase set.
+     * 
+ */ + public com.google.cloud.speech.v1.PhraseSet getPhraseSet(com.google.cloud.speech.v1.GetPhraseSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPhraseSetMethod(), getCallOptions(), request); + } + + /** + *
+     * List phrase sets.
+     * 
+ */ + public com.google.cloud.speech.v1.ListPhraseSetResponse listPhraseSet(com.google.cloud.speech.v1.ListPhraseSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPhraseSetMethod(), getCallOptions(), request); + } + + /** + *
+     * Update a phrase set.
+     * 
+ */ + public com.google.cloud.speech.v1.PhraseSet updatePhraseSet(com.google.cloud.speech.v1.UpdatePhraseSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdatePhraseSetMethod(), getCallOptions(), request); + } + + /** + *
+     * Delete a phrase set.
+     * 
+ */ + public com.google.protobuf.Empty deletePhraseSet(com.google.cloud.speech.v1.DeletePhraseSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeletePhraseSetMethod(), getCallOptions(), request); + } + + /** + *
+     * Create a custom class.
+     * 
+ */ + public com.google.cloud.speech.v1.CustomClass createCustomClass(com.google.cloud.speech.v1.CreateCustomClassRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateCustomClassMethod(), getCallOptions(), request); + } + + /** + *
+     * Get a custom class.
+     * 
+ */ + public com.google.cloud.speech.v1.CustomClass getCustomClass(com.google.cloud.speech.v1.GetCustomClassRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetCustomClassMethod(), getCallOptions(), request); + } + + /** + *
+     * List custom classes.
+     * 
+ */ + public com.google.cloud.speech.v1.ListCustomClassesResponse listCustomClasses(com.google.cloud.speech.v1.ListCustomClassesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListCustomClassesMethod(), getCallOptions(), request); + } + + /** + *
+     * Update a custom class.
+     * 
+ */ + public com.google.cloud.speech.v1.CustomClass updateCustomClass(com.google.cloud.speech.v1.UpdateCustomClassRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateCustomClassMethod(), getCallOptions(), request); + } + + /** + *
+     * Delete a custom class.
+     * 
+ */ + public com.google.protobuf.Empty deleteCustomClass(com.google.cloud.speech.v1.DeleteCustomClassRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteCustomClassMethod(), getCallOptions(), request); + } + } + + /** + *
+   * Service that implements Google Cloud Speech Adaptation API.
+   * 
+ */ + public static final class AdaptationFutureStub extends io.grpc.stub.AbstractFutureStub { + private AdaptationFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AdaptationFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationFutureStub(channel, callOptions); + } + + /** + *
+     * Create a set of phrase hints. Each item in the set can be a single word or
+     * a multi-word phrase. The items in the PhraseSet are favored by the
+     * recognition model when you send a call that includes the PhraseSet.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createPhraseSet( + com.google.cloud.speech.v1.CreatePhraseSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreatePhraseSetMethod(), getCallOptions()), request); + } + + /** + *
+     * Get a phrase set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getPhraseSet( + com.google.cloud.speech.v1.GetPhraseSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPhraseSetMethod(), getCallOptions()), request); + } + + /** + *
+     * List phrase sets.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listPhraseSet( + com.google.cloud.speech.v1.ListPhraseSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPhraseSetMethod(), getCallOptions()), request); + } + + /** + *
+     * Update a phrase set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updatePhraseSet( + com.google.cloud.speech.v1.UpdatePhraseSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdatePhraseSetMethod(), getCallOptions()), request); + } + + /** + *
+     * Delete a phrase set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deletePhraseSet( + com.google.cloud.speech.v1.DeletePhraseSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeletePhraseSetMethod(), getCallOptions()), request); + } + + /** + *
+     * Create a custom class.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createCustomClass( + com.google.cloud.speech.v1.CreateCustomClassRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateCustomClassMethod(), getCallOptions()), request); + } + + /** + *
+     * Get a custom class.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getCustomClass( + com.google.cloud.speech.v1.GetCustomClassRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetCustomClassMethod(), getCallOptions()), request); + } + + /** + *
+     * List custom classes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listCustomClasses( + com.google.cloud.speech.v1.ListCustomClassesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListCustomClassesMethod(), getCallOptions()), request); + } + + /** + *
+     * Update a custom class.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateCustomClass( + com.google.cloud.speech.v1.UpdateCustomClassRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateCustomClassMethod(), getCallOptions()), request); + } + + /** + *
+     * Delete a custom class.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteCustomClass( + com.google.cloud.speech.v1.DeleteCustomClassRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteCustomClassMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_PHRASE_SET = 0; + private static final int METHODID_GET_PHRASE_SET = 1; + private static final int METHODID_LIST_PHRASE_SET = 2; + private static final int METHODID_UPDATE_PHRASE_SET = 3; + private static final int METHODID_DELETE_PHRASE_SET = 4; + private static final int METHODID_CREATE_CUSTOM_CLASS = 5; + private static final int METHODID_GET_CUSTOM_CLASS = 6; + private static final int METHODID_LIST_CUSTOM_CLASSES = 7; + private static final int METHODID_UPDATE_CUSTOM_CLASS = 8; + private static final int METHODID_DELETE_CUSTOM_CLASS = 9; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AdaptationImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AdaptationImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_PHRASE_SET: + serviceImpl.createPhraseSet((com.google.cloud.speech.v1.CreatePhraseSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_PHRASE_SET: + serviceImpl.getPhraseSet((com.google.cloud.speech.v1.GetPhraseSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_PHRASE_SET: + serviceImpl.listPhraseSet((com.google.cloud.speech.v1.ListPhraseSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_PHRASE_SET: + serviceImpl.updatePhraseSet((com.google.cloud.speech.v1.UpdatePhraseSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_PHRASE_SET: + serviceImpl.deletePhraseSet((com.google.cloud.speech.v1.DeletePhraseSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_CUSTOM_CLASS: + serviceImpl.createCustomClass((com.google.cloud.speech.v1.CreateCustomClassRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_CUSTOM_CLASS: + serviceImpl.getCustomClass((com.google.cloud.speech.v1.GetCustomClassRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_CUSTOM_CLASSES: + serviceImpl.listCustomClasses((com.google.cloud.speech.v1.ListCustomClassesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_CUSTOM_CLASS: + serviceImpl.updateCustomClass((com.google.cloud.speech.v1.UpdateCustomClassRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CUSTOM_CLASS: + serviceImpl.deleteCustomClass((com.google.cloud.speech.v1.DeleteCustomClassRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class AdaptationBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AdaptationBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Adaptation"); + } + } + + private static final class AdaptationFileDescriptorSupplier + extends AdaptationBaseDescriptorSupplier { + AdaptationFileDescriptorSupplier() {} + } + + private static final class AdaptationMethodDescriptorSupplier + extends AdaptationBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AdaptationMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (AdaptationGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AdaptationFileDescriptorSupplier()) + .addMethod(getCreatePhraseSetMethod()) + .addMethod(getGetPhraseSetMethod()) + .addMethod(getListPhraseSetMethod()) + .addMethod(getUpdatePhraseSetMethod()) + .addMethod(getDeletePhraseSetMethod()) + .addMethod(getCreateCustomClassMethod()) + .addMethod(getGetCustomClassMethod()) + .addMethod(getListCustomClassesMethod()) + .addMethod(getUpdateCustomClassMethod()) + .addMethod(getDeleteCustomClassMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java b/owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java new file mode 100644 index 000000000000..46b71822a661 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java @@ -0,0 +1,479 @@ +package com.google.cloud.speech.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + *
+ * Service that implements Google Cloud Speech API.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/speech/v1/cloud_speech.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class SpeechGrpc { + + private SpeechGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.speech.v1.Speech"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getRecognizeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Recognize", + requestType = com.google.cloud.speech.v1.RecognizeRequest.class, + responseType = com.google.cloud.speech.v1.RecognizeResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRecognizeMethod() { + io.grpc.MethodDescriptor getRecognizeMethod; + if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { + synchronized (SpeechGrpc.class) { + if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { + SpeechGrpc.getRecognizeMethod = getRecognizeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Recognize")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.RecognizeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.RecognizeResponse.getDefaultInstance())) + .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("Recognize")) + .build(); + } + } + } + return getRecognizeMethod; + } + + private static volatile io.grpc.MethodDescriptor getLongRunningRecognizeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "LongRunningRecognize", + requestType = com.google.cloud.speech.v1.LongRunningRecognizeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getLongRunningRecognizeMethod() { + io.grpc.MethodDescriptor getLongRunningRecognizeMethod; + if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { + synchronized (SpeechGrpc.class) { + if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { + SpeechGrpc.getLongRunningRecognizeMethod = getLongRunningRecognizeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "LongRunningRecognize")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.LongRunningRecognizeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("LongRunningRecognize")) + .build(); + } + } + } + return getLongRunningRecognizeMethod; + } + + private static volatile io.grpc.MethodDescriptor getStreamingRecognizeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamingRecognize", + requestType = com.google.cloud.speech.v1.StreamingRecognizeRequest.class, + responseType = com.google.cloud.speech.v1.StreamingRecognizeResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor getStreamingRecognizeMethod() { + io.grpc.MethodDescriptor getStreamingRecognizeMethod; + if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { + synchronized (SpeechGrpc.class) { + if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { + SpeechGrpc.getStreamingRecognizeMethod = getStreamingRecognizeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamingRecognize")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.StreamingRecognizeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1.StreamingRecognizeResponse.getDefaultInstance())) + .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("StreamingRecognize")) + .build(); + } + } + } + return getStreamingRecognizeMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static SpeechStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SpeechStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SpeechStub(channel, callOptions); + } + }; + return SpeechStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SpeechBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SpeechBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SpeechBlockingStub(channel, callOptions); + } + }; + return SpeechBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static SpeechFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SpeechFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SpeechFutureStub(channel, callOptions); + } + }; + return SpeechFutureStub.newStub(factory, channel); + } + + /** + *
+   * Service that implements Google Cloud Speech API.
+   * 
+ */ + public static abstract class SpeechImplBase implements io.grpc.BindableService { + + /** + *
+     * Performs synchronous speech recognition: receive results after all audio
+     * has been sent and processed.
+     * 
+ */ + public void recognize(com.google.cloud.speech.v1.RecognizeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRecognizeMethod(), responseObserver); + } + + /** + *
+     * Performs asynchronous speech recognition: receive results via the
+     * google.longrunning.Operations interface. Returns either an
+     * `Operation.error` or an `Operation.response` which contains
+     * a `LongRunningRecognizeResponse` message.
+     * For more information on asynchronous speech recognition, see the
+     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
+     * 
+ */ + public void longRunningRecognize(com.google.cloud.speech.v1.LongRunningRecognizeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getLongRunningRecognizeMethod(), responseObserver); + } + + /** + *
+     * Performs bidirectional streaming speech recognition: receive results while
+     * sending audio. This method is only available via the gRPC API (not REST).
+     * 
+ */ + public io.grpc.stub.StreamObserver streamingRecognize( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamingRecognizeMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getRecognizeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1.RecognizeRequest, + com.google.cloud.speech.v1.RecognizeResponse>( + this, METHODID_RECOGNIZE))) + .addMethod( + getLongRunningRecognizeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1.LongRunningRecognizeRequest, + com.google.longrunning.Operation>( + this, METHODID_LONG_RUNNING_RECOGNIZE))) + .addMethod( + getStreamingRecognizeMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.cloud.speech.v1.StreamingRecognizeRequest, + com.google.cloud.speech.v1.StreamingRecognizeResponse>( + this, METHODID_STREAMING_RECOGNIZE))) + .build(); + } + } + + /** + *
+   * Service that implements Google Cloud Speech API.
+   * 
+ */ + public static final class SpeechStub extends io.grpc.stub.AbstractAsyncStub { + private SpeechStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SpeechStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SpeechStub(channel, callOptions); + } + + /** + *
+     * Performs synchronous speech recognition: receive results after all audio
+     * has been sent and processed.
+     * 
+ */ + public void recognize(com.google.cloud.speech.v1.RecognizeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRecognizeMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Performs asynchronous speech recognition: receive results via the
+     * google.longrunning.Operations interface. Returns either an
+     * `Operation.error` or an `Operation.response` which contains
+     * a `LongRunningRecognizeResponse` message.
+     * For more information on asynchronous speech recognition, see the
+     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
+     * 
+ */ + public void longRunningRecognize(com.google.cloud.speech.v1.LongRunningRecognizeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Performs bidirectional streaming speech recognition: receive results while
+     * sending audio. This method is only available via the gRPC API (not REST).
+     * 
+ */ + public io.grpc.stub.StreamObserver streamingRecognize( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getStreamingRecognizeMethod(), getCallOptions()), responseObserver); + } + } + + /** + *
+   * Service that implements Google Cloud Speech API.
+   * 
+ */ + public static final class SpeechBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private SpeechBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SpeechBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SpeechBlockingStub(channel, callOptions); + } + + /** + *
+     * Performs synchronous speech recognition: receive results after all audio
+     * has been sent and processed.
+     * 
+ */ + public com.google.cloud.speech.v1.RecognizeResponse recognize(com.google.cloud.speech.v1.RecognizeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRecognizeMethod(), getCallOptions(), request); + } + + /** + *
+     * Performs asynchronous speech recognition: receive results via the
+     * google.longrunning.Operations interface. Returns either an
+     * `Operation.error` or an `Operation.response` which contains
+     * a `LongRunningRecognizeResponse` message.
+     * For more information on asynchronous speech recognition, see the
+     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
+     * 
+ */ + public com.google.longrunning.Operation longRunningRecognize(com.google.cloud.speech.v1.LongRunningRecognizeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getLongRunningRecognizeMethod(), getCallOptions(), request); + } + } + + /** + *
+   * Service that implements Google Cloud Speech API.
+   * 
+ */ + public static final class SpeechFutureStub extends io.grpc.stub.AbstractFutureStub { + private SpeechFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SpeechFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SpeechFutureStub(channel, callOptions); + } + + /** + *
+     * Performs synchronous speech recognition: receive results after all audio
+     * has been sent and processed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture recognize( + com.google.cloud.speech.v1.RecognizeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRecognizeMethod(), getCallOptions()), request); + } + + /** + *
+     * Performs asynchronous speech recognition: receive results via the
+     * google.longrunning.Operations interface. Returns either an
+     * `Operation.error` or an `Operation.response` which contains
+     * a `LongRunningRecognizeResponse` message.
+     * For more information on asynchronous speech recognition, see the
+     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture longRunningRecognize( + com.google.cloud.speech.v1.LongRunningRecognizeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_RECOGNIZE = 0; + private static final int METHODID_LONG_RUNNING_RECOGNIZE = 1; + private static final int METHODID_STREAMING_RECOGNIZE = 2; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final SpeechImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SpeechImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_RECOGNIZE: + serviceImpl.recognize((com.google.cloud.speech.v1.RecognizeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LONG_RUNNING_RECOGNIZE: + serviceImpl.longRunningRecognize((com.google.cloud.speech.v1.LongRunningRecognizeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_STREAMING_RECOGNIZE: + return (io.grpc.stub.StreamObserver) serviceImpl.streamingRecognize( + (io.grpc.stub.StreamObserver) responseObserver); + default: + throw new AssertionError(); + } + } + } + + private static abstract class SpeechBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SpeechBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Speech"); + } + } + + private static final class SpeechFileDescriptorSupplier + extends SpeechBaseDescriptorSupplier { + SpeechFileDescriptorSupplier() {} + } + + private static final class SpeechMethodDescriptorSupplier + extends SpeechBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SpeechMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SpeechGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SpeechFileDescriptorSupplier()) + .addMethod(getRecognizeMethod()) + .addMethod(getLongRunningRecognizeMethod()) + .addMethod(getStreamingRecognizeMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequest.java new file mode 100644 index 000000000000..9484bfd6c1f9 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequest.java @@ -0,0 +1,1060 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Message sent by the client for the `CreateCustomClass` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.CreateCustomClassRequest} + */ +public final class CreateCustomClassRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.CreateCustomClassRequest) + CreateCustomClassRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateCustomClassRequest.newBuilder() to construct. + private CreateCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateCustomClassRequest() { + parent_ = ""; + customClassId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CreateCustomClassRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateCustomClassRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + customClassId_ = s; + break; + } + case 26: { + com.google.cloud.speech.v1.CustomClass.Builder subBuilder = null; + if (customClass_ != null) { + subBuilder = customClass_.toBuilder(); + } + customClass_ = input.readMessage(com.google.cloud.speech.v1.CustomClass.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(customClass_); + customClass_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreateCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreateCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.CreateCustomClassRequest.class, com.google.cloud.speech.v1.CreateCustomClassRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent resource where this custom class will be created. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent resource where this custom class will be created. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_CLASS_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object customClassId_; + /** + *
+   * Required. The ID to use for the custom class, which will become the final
+   * component of the custom class' resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClassId. + */ + @java.lang.Override + public java.lang.String getCustomClassId() { + java.lang.Object ref = customClassId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customClassId_ = s; + return s; + } + } + /** + *
+   * Required. The ID to use for the custom class, which will become the final
+   * component of the custom class' resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for customClassId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCustomClassIdBytes() { + java.lang.Object ref = customClassId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + customClassId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_CLASS_FIELD_NUMBER = 3; + private com.google.cloud.speech.v1.CustomClass customClass_; + /** + *
+   * Required. The custom class to create.
+   * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the customClass field is set. + */ + @java.lang.Override + public boolean hasCustomClass() { + return customClass_ != null; + } + /** + *
+   * Required. The custom class to create.
+   * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClass. + */ + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass getCustomClass() { + return customClass_ == null ? com.google.cloud.speech.v1.CustomClass.getDefaultInstance() : customClass_; + } + /** + *
+   * Required. The custom class to create.
+   * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassOrBuilder() { + return getCustomClass(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, customClassId_); + } + if (customClass_ != null) { + output.writeMessage(3, getCustomClass()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, customClassId_); + } + if (customClass_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getCustomClass()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.CreateCustomClassRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.CreateCustomClassRequest other = (com.google.cloud.speech.v1.CreateCustomClassRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (!getCustomClassId() + .equals(other.getCustomClassId())) return false; + if (hasCustomClass() != other.hasCustomClass()) return false; + if (hasCustomClass()) { + if (!getCustomClass() + .equals(other.getCustomClass())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + CUSTOM_CLASS_ID_FIELD_NUMBER; + hash = (53 * hash) + getCustomClassId().hashCode(); + if (hasCustomClass()) { + hash = (37 * hash) + CUSTOM_CLASS_FIELD_NUMBER; + hash = (53 * hash) + getCustomClass().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.CreateCustomClassRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.CreateCustomClassRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.CreateCustomClassRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `CreateCustomClass` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.CreateCustomClassRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.CreateCustomClassRequest) + com.google.cloud.speech.v1.CreateCustomClassRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreateCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreateCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.CreateCustomClassRequest.class, com.google.cloud.speech.v1.CreateCustomClassRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.CreateCustomClassRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + customClassId_ = ""; + + if (customClassBuilder_ == null) { + customClass_ = null; + } else { + customClass_ = null; + customClassBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreateCustomClassRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.CreateCustomClassRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.CreateCustomClassRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.CreateCustomClassRequest build() { + com.google.cloud.speech.v1.CreateCustomClassRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.CreateCustomClassRequest buildPartial() { + com.google.cloud.speech.v1.CreateCustomClassRequest result = new com.google.cloud.speech.v1.CreateCustomClassRequest(this); + result.parent_ = parent_; + result.customClassId_ = customClassId_; + if (customClassBuilder_ == null) { + result.customClass_ = customClass_; + } else { + result.customClass_ = customClassBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.CreateCustomClassRequest) { + return mergeFrom((com.google.cloud.speech.v1.CreateCustomClassRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.CreateCustomClassRequest other) { + if (other == com.google.cloud.speech.v1.CreateCustomClassRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getCustomClassId().isEmpty()) { + customClassId_ = other.customClassId_; + onChanged(); + } + if (other.hasCustomClass()) { + mergeCustomClass(other.getCustomClass()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.CreateCustomClassRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.CreateCustomClassRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent resource where this custom class will be created. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent resource where this custom class will be created. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent resource where this custom class will be created. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource where this custom class will be created. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource where this custom class will be created. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object customClassId_ = ""; + /** + *
+     * Required. The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClassId. + */ + public java.lang.String getCustomClassId() { + java.lang.Object ref = customClassId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customClassId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for customClassId. + */ + public com.google.protobuf.ByteString + getCustomClassIdBytes() { + java.lang.Object ref = customClassId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + customClassId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param value The customClassId to set. + * @return This builder for chaining. + */ + public Builder setCustomClassId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + customClassId_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearCustomClassId() { + + customClassId_ = getDefaultInstance().getCustomClassId(); + onChanged(); + return this; + } + /** + *
+     * Required. The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for customClassId to set. + * @return This builder for chaining. + */ + public Builder setCustomClassIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + customClassId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.speech.v1.CustomClass customClass_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> customClassBuilder_; + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the customClass field is set. + */ + public boolean hasCustomClass() { + return customClassBuilder_ != null || customClass_ != null; + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClass. + */ + public com.google.cloud.speech.v1.CustomClass getCustomClass() { + if (customClassBuilder_ == null) { + return customClass_ == null ? com.google.cloud.speech.v1.CustomClass.getDefaultInstance() : customClass_; + } else { + return customClassBuilder_.getMessage(); + } + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setCustomClass(com.google.cloud.speech.v1.CustomClass value) { + if (customClassBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customClass_ = value; + onChanged(); + } else { + customClassBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setCustomClass( + com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { + if (customClassBuilder_ == null) { + customClass_ = builderForValue.build(); + onChanged(); + } else { + customClassBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeCustomClass(com.google.cloud.speech.v1.CustomClass value) { + if (customClassBuilder_ == null) { + if (customClass_ != null) { + customClass_ = + com.google.cloud.speech.v1.CustomClass.newBuilder(customClass_).mergeFrom(value).buildPartial(); + } else { + customClass_ = value; + } + onChanged(); + } else { + customClassBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearCustomClass() { + if (customClassBuilder_ == null) { + customClass_ = null; + onChanged(); + } else { + customClass_ = null; + customClassBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.CustomClass.Builder getCustomClassBuilder() { + + onChanged(); + return getCustomClassFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassOrBuilder() { + if (customClassBuilder_ != null) { + return customClassBuilder_.getMessageOrBuilder(); + } else { + return customClass_ == null ? + com.google.cloud.speech.v1.CustomClass.getDefaultInstance() : customClass_; + } + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> + getCustomClassFieldBuilder() { + if (customClassBuilder_ == null) { + customClassBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder>( + getCustomClass(), + getParentForChildren(), + isClean()); + customClass_ = null; + } + return customClassBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.CreateCustomClassRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.CreateCustomClassRequest) + private static final com.google.cloud.speech.v1.CreateCustomClassRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.CreateCustomClassRequest(); + } + + public static com.google.cloud.speech.v1.CreateCustomClassRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateCustomClassRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateCustomClassRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.CreateCustomClassRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequestOrBuilder.java new file mode 100644 index 000000000000..f9dbb4e979ea --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequestOrBuilder.java @@ -0,0 +1,94 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public interface CreateCustomClassRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.CreateCustomClassRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent resource where this custom class will be created. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent resource where this custom class will be created. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Required. The ID to use for the custom class, which will become the final
+   * component of the custom class' resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClassId. + */ + java.lang.String getCustomClassId(); + /** + *
+   * Required. The ID to use for the custom class, which will become the final
+   * component of the custom class' resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for customClassId. + */ + com.google.protobuf.ByteString + getCustomClassIdBytes(); + + /** + *
+   * Required. The custom class to create.
+   * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the customClass field is set. + */ + boolean hasCustomClass(); + /** + *
+   * Required. The custom class to create.
+   * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClass. + */ + com.google.cloud.speech.v1.CustomClass getCustomClass(); + /** + *
+   * Required. The custom class to create.
+   * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequest.java new file mode 100644 index 000000000000..04813cef2772 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequest.java @@ -0,0 +1,1060 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Message sent by the client for the `CreatePhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.CreatePhraseSetRequest} + */ +public final class CreatePhraseSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.CreatePhraseSetRequest) + CreatePhraseSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreatePhraseSetRequest.newBuilder() to construct. + private CreatePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreatePhraseSetRequest() { + parent_ = ""; + phraseSetId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CreatePhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreatePhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + phraseSetId_ = s; + break; + } + case 26: { + com.google.cloud.speech.v1.PhraseSet.Builder subBuilder = null; + if (phraseSet_ != null) { + subBuilder = phraseSet_.toBuilder(); + } + phraseSet_ = input.readMessage(com.google.cloud.speech.v1.PhraseSet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(phraseSet_); + phraseSet_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.CreatePhraseSetRequest.class, com.google.cloud.speech.v1.CreatePhraseSetRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent resource where this phrase set will be created. Format:
+   * `projects/{project}/locations/{location}/phraseSets`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent resource where this phrase set will be created. Format:
+   * `projects/{project}/locations/{location}/phraseSets`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PHRASE_SET_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object phraseSetId_; + /** + *
+   * Required. The ID to use for the phrase set, which will become the final
+   * component of the phrase set's resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSetId. + */ + @java.lang.Override + public java.lang.String getPhraseSetId() { + java.lang.Object ref = phraseSetId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + phraseSetId_ = s; + return s; + } + } + /** + *
+   * Required. The ID to use for the phrase set, which will become the final
+   * component of the phrase set's resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for phraseSetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPhraseSetIdBytes() { + java.lang.Object ref = phraseSetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + phraseSetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PHRASE_SET_FIELD_NUMBER = 3; + private com.google.cloud.speech.v1.PhraseSet phraseSet_; + /** + *
+   * Required. The phrase set to create.
+   * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the phraseSet field is set. + */ + @java.lang.Override + public boolean hasPhraseSet() { + return phraseSet_ != null; + } + /** + *
+   * Required. The phrase set to create.
+   * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSet. + */ + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet getPhraseSet() { + return phraseSet_ == null ? com.google.cloud.speech.v1.PhraseSet.getDefaultInstance() : phraseSet_; + } + /** + *
+   * Required. The phrase set to create.
+   * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetOrBuilder() { + return getPhraseSet(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(phraseSetId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, phraseSetId_); + } + if (phraseSet_ != null) { + output.writeMessage(3, getPhraseSet()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(phraseSetId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, phraseSetId_); + } + if (phraseSet_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getPhraseSet()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.CreatePhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.CreatePhraseSetRequest other = (com.google.cloud.speech.v1.CreatePhraseSetRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (!getPhraseSetId() + .equals(other.getPhraseSetId())) return false; + if (hasPhraseSet() != other.hasPhraseSet()) return false; + if (hasPhraseSet()) { + if (!getPhraseSet() + .equals(other.getPhraseSet())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PHRASE_SET_ID_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSetId().hashCode(); + if (hasPhraseSet()) { + hash = (37 * hash) + PHRASE_SET_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSet().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.CreatePhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `CreatePhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.CreatePhraseSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.CreatePhraseSetRequest) + com.google.cloud.speech.v1.CreatePhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.CreatePhraseSetRequest.class, com.google.cloud.speech.v1.CreatePhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.CreatePhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + phraseSetId_ = ""; + + if (phraseSetBuilder_ == null) { + phraseSet_ = null; + } else { + phraseSet_ = null; + phraseSetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.CreatePhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.CreatePhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.CreatePhraseSetRequest build() { + com.google.cloud.speech.v1.CreatePhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.CreatePhraseSetRequest buildPartial() { + com.google.cloud.speech.v1.CreatePhraseSetRequest result = new com.google.cloud.speech.v1.CreatePhraseSetRequest(this); + result.parent_ = parent_; + result.phraseSetId_ = phraseSetId_; + if (phraseSetBuilder_ == null) { + result.phraseSet_ = phraseSet_; + } else { + result.phraseSet_ = phraseSetBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.CreatePhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1.CreatePhraseSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.CreatePhraseSetRequest other) { + if (other == com.google.cloud.speech.v1.CreatePhraseSetRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPhraseSetId().isEmpty()) { + phraseSetId_ = other.phraseSetId_; + onChanged(); + } + if (other.hasPhraseSet()) { + mergePhraseSet(other.getPhraseSet()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.CreatePhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.CreatePhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent resource where this phrase set will be created. Format:
+     * `projects/{project}/locations/{location}/phraseSets`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent resource where this phrase set will be created. Format:
+     * `projects/{project}/locations/{location}/phraseSets`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent resource where this phrase set will be created. Format:
+     * `projects/{project}/locations/{location}/phraseSets`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource where this phrase set will be created. Format:
+     * `projects/{project}/locations/{location}/phraseSets`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource where this phrase set will be created. Format:
+     * `projects/{project}/locations/{location}/phraseSets`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object phraseSetId_ = ""; + /** + *
+     * Required. The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSetId. + */ + public java.lang.String getPhraseSetId() { + java.lang.Object ref = phraseSetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + phraseSetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for phraseSetId. + */ + public com.google.protobuf.ByteString + getPhraseSetIdBytes() { + java.lang.Object ref = phraseSetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + phraseSetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param value The phraseSetId to set. + * @return This builder for chaining. + */ + public Builder setPhraseSetId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + phraseSetId_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearPhraseSetId() { + + phraseSetId_ = getDefaultInstance().getPhraseSetId(); + onChanged(); + return this; + } + /** + *
+     * Required. The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for phraseSetId to set. + * @return This builder for chaining. + */ + public Builder setPhraseSetIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + phraseSetId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.speech.v1.PhraseSet phraseSet_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> phraseSetBuilder_; + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the phraseSet field is set. + */ + public boolean hasPhraseSet() { + return phraseSetBuilder_ != null || phraseSet_ != null; + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSet. + */ + public com.google.cloud.speech.v1.PhraseSet getPhraseSet() { + if (phraseSetBuilder_ == null) { + return phraseSet_ == null ? com.google.cloud.speech.v1.PhraseSet.getDefaultInstance() : phraseSet_; + } else { + return phraseSetBuilder_.getMessage(); + } + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPhraseSet(com.google.cloud.speech.v1.PhraseSet value) { + if (phraseSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + phraseSet_ = value; + onChanged(); + } else { + phraseSetBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPhraseSet( + com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { + if (phraseSetBuilder_ == null) { + phraseSet_ = builderForValue.build(); + onChanged(); + } else { + phraseSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergePhraseSet(com.google.cloud.speech.v1.PhraseSet value) { + if (phraseSetBuilder_ == null) { + if (phraseSet_ != null) { + phraseSet_ = + com.google.cloud.speech.v1.PhraseSet.newBuilder(phraseSet_).mergeFrom(value).buildPartial(); + } else { + phraseSet_ = value; + } + onChanged(); + } else { + phraseSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearPhraseSet() { + if (phraseSetBuilder_ == null) { + phraseSet_ = null; + onChanged(); + } else { + phraseSet_ = null; + phraseSetBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.PhraseSet.Builder getPhraseSetBuilder() { + + onChanged(); + return getPhraseSetFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetOrBuilder() { + if (phraseSetBuilder_ != null) { + return phraseSetBuilder_.getMessageOrBuilder(); + } else { + return phraseSet_ == null ? + com.google.cloud.speech.v1.PhraseSet.getDefaultInstance() : phraseSet_; + } + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> + getPhraseSetFieldBuilder() { + if (phraseSetBuilder_ == null) { + phraseSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder>( + getPhraseSet(), + getParentForChildren(), + isClean()); + phraseSet_ = null; + } + return phraseSetBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.CreatePhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.CreatePhraseSetRequest) + private static final com.google.cloud.speech.v1.CreatePhraseSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.CreatePhraseSetRequest(); + } + + public static com.google.cloud.speech.v1.CreatePhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatePhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreatePhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.CreatePhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequestOrBuilder.java new file mode 100644 index 000000000000..913da08c2410 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequestOrBuilder.java @@ -0,0 +1,94 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public interface CreatePhraseSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.CreatePhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent resource where this phrase set will be created. Format:
+   * `projects/{project}/locations/{location}/phraseSets`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent resource where this phrase set will be created. Format:
+   * `projects/{project}/locations/{location}/phraseSets`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Required. The ID to use for the phrase set, which will become the final
+   * component of the phrase set's resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSetId. + */ + java.lang.String getPhraseSetId(); + /** + *
+   * Required. The ID to use for the phrase set, which will become the final
+   * component of the phrase set's resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for phraseSetId. + */ + com.google.protobuf.ByteString + getPhraseSetIdBytes(); + + /** + *
+   * Required. The phrase set to create.
+   * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the phraseSet field is set. + */ + boolean hasPhraseSet(); + /** + *
+   * Required. The phrase set to create.
+   * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSet. + */ + com.google.cloud.speech.v1.PhraseSet getPhraseSet(); + /** + *
+   * Required. The phrase set to create.
+   * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClass.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClass.java new file mode 100644 index 000000000000..bcbf30da2ab2 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClass.java @@ -0,0 +1,1829 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/resource.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * A set of words or phrases that represents a common concept likely to appear
+ * in your audio, for example a list of passenger ship names. CustomClass items
+ * can be substituted into placeholders that you set in PhraseSet phrases.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.CustomClass} + */ +public final class CustomClass extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.CustomClass) + CustomClassOrBuilder { +private static final long serialVersionUID = 0L; + // Use CustomClass.newBuilder() to construct. + private CustomClass(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CustomClass() { + name_ = ""; + customClassId_ = ""; + items_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CustomClass(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CustomClass( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + customClassId_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + items_.add( + input.readMessage(com.google.cloud.speech.v1.CustomClass.ClassItem.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.CustomClass.class, com.google.cloud.speech.v1.CustomClass.Builder.class); + } + + public interface ClassItemOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.CustomClass.ClassItem) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The class item's value.
+     * 
+ * + * string value = 1; + * @return The value. + */ + java.lang.String getValue(); + /** + *
+     * The class item's value.
+     * 
+ * + * string value = 1; + * @return The bytes for value. + */ + com.google.protobuf.ByteString + getValueBytes(); + } + /** + *
+   * An item of the class.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.CustomClass.ClassItem} + */ + public static final class ClassItem extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.CustomClass.ClassItem) + ClassItemOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClassItem.newBuilder() to construct. + private ClassItem(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ClassItem() { + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ClassItem(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ClassItem( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_ClassItem_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_ClassItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.CustomClass.ClassItem.class, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private volatile java.lang.Object value_; + /** + *
+     * The class item's value.
+     * 
+ * + * string value = 1; + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + *
+     * The class item's value.
+     * 
+ * + * string value = 1; + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.CustomClass.ClassItem)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.CustomClass.ClassItem other = (com.google.cloud.speech.v1.CustomClass.ClassItem) obj; + + if (!getValue() + .equals(other.getValue())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.CustomClass.ClassItem parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.CustomClass.ClassItem parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.CustomClass.ClassItem prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * An item of the class.
+     * 
+ * + * Protobuf type {@code google.cloud.speech.v1.CustomClass.ClassItem} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.CustomClass.ClassItem) + com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_ClassItem_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_ClassItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.CustomClass.ClassItem.class, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.CustomClass.ClassItem.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + value_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_ClassItem_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass.ClassItem getDefaultInstanceForType() { + return com.google.cloud.speech.v1.CustomClass.ClassItem.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass.ClassItem build() { + com.google.cloud.speech.v1.CustomClass.ClassItem result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass.ClassItem buildPartial() { + com.google.cloud.speech.v1.CustomClass.ClassItem result = new com.google.cloud.speech.v1.CustomClass.ClassItem(this); + result.value_ = value_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.CustomClass.ClassItem) { + return mergeFrom((com.google.cloud.speech.v1.CustomClass.ClassItem)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.CustomClass.ClassItem other) { + if (other == com.google.cloud.speech.v1.CustomClass.ClassItem.getDefaultInstance()) return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.CustomClass.ClassItem parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.CustomClass.ClassItem) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object value_ = ""; + /** + *
+       * The class item's value.
+       * 
+ * + * string value = 1; + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The class item's value.
+       * 
+ * + * string value = 1; + * @return The bytes for value. + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The class item's value.
+       * 
+ * + * string value = 1; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + *
+       * The class item's value.
+       * 
+ * + * string value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + *
+       * The class item's value.
+       * 
+ * + * string value = 1; + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.CustomClass.ClassItem) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.CustomClass.ClassItem) + private static final com.google.cloud.speech.v1.CustomClass.ClassItem DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.CustomClass.ClassItem(); + } + + public static com.google.cloud.speech.v1.CustomClass.ClassItem getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClassItem parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClassItem(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass.ClassItem getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the custom class.
+   * 
+ * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The resource name of the custom class.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_CLASS_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object customClassId_; + /** + *
+   * If this custom class is a resource, the custom_class_id is the resource id
+   * of the CustomClass. Case sensitive.
+   * 
+ * + * string custom_class_id = 2; + * @return The customClassId. + */ + @java.lang.Override + public java.lang.String getCustomClassId() { + java.lang.Object ref = customClassId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customClassId_ = s; + return s; + } + } + /** + *
+   * If this custom class is a resource, the custom_class_id is the resource id
+   * of the CustomClass. Case sensitive.
+   * 
+ * + * string custom_class_id = 2; + * @return The bytes for customClassId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCustomClassIdBytes() { + java.lang.Object ref = customClassId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + customClassId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 3; + private java.util.List items_; + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass.ClassItem getItems(int index) { + return items_.get(index); + } + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( + int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, customClassId_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(3, items_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, customClassId_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, items_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.CustomClass)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.CustomClass other = (com.google.cloud.speech.v1.CustomClass) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getCustomClassId() + .equals(other.getCustomClassId())) return false; + if (!getItemsList() + .equals(other.getItemsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + CUSTOM_CLASS_ID_FIELD_NUMBER; + hash = (53 * hash) + getCustomClassId().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.CustomClass parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.CustomClass parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.CustomClass parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.CustomClass parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.CustomClass parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.CustomClass parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.CustomClass parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.CustomClass parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.CustomClass parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.CustomClass parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.CustomClass parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.CustomClass parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.CustomClass prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A set of words or phrases that represents a common concept likely to appear
+   * in your audio, for example a list of passenger ship names. CustomClass items
+   * can be substituted into placeholders that you set in PhraseSet phrases.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.CustomClass} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.CustomClass) + com.google.cloud.speech.v1.CustomClassOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.CustomClass.class, com.google.cloud.speech.v1.CustomClass.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.CustomClass.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getItemsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + customClassId_ = ""; + + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + itemsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass getDefaultInstanceForType() { + return com.google.cloud.speech.v1.CustomClass.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass build() { + com.google.cloud.speech.v1.CustomClass result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass buildPartial() { + com.google.cloud.speech.v1.CustomClass result = new com.google.cloud.speech.v1.CustomClass(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.customClassId_ = customClassId_; + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.CustomClass) { + return mergeFrom((com.google.cloud.speech.v1.CustomClass)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.CustomClass other) { + if (other == com.google.cloud.speech.v1.CustomClass.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getCustomClassId().isEmpty()) { + customClassId_ = other.customClassId_; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + itemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getItemsFieldBuilder() : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.CustomClass parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.CustomClass) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the custom class.
+     * 
+ * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name of the custom class.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name of the custom class.
+     * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name of the custom class.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the custom class.
+     * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object customClassId_ = ""; + /** + *
+     * If this custom class is a resource, the custom_class_id is the resource id
+     * of the CustomClass. Case sensitive.
+     * 
+ * + * string custom_class_id = 2; + * @return The customClassId. + */ + public java.lang.String getCustomClassId() { + java.lang.Object ref = customClassId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customClassId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * If this custom class is a resource, the custom_class_id is the resource id
+     * of the CustomClass. Case sensitive.
+     * 
+ * + * string custom_class_id = 2; + * @return The bytes for customClassId. + */ + public com.google.protobuf.ByteString + getCustomClassIdBytes() { + java.lang.Object ref = customClassId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + customClassId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * If this custom class is a resource, the custom_class_id is the resource id
+     * of the CustomClass. Case sensitive.
+     * 
+ * + * string custom_class_id = 2; + * @param value The customClassId to set. + * @return This builder for chaining. + */ + public Builder setCustomClassId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + customClassId_ = value; + onChanged(); + return this; + } + /** + *
+     * If this custom class is a resource, the custom_class_id is the resource id
+     * of the CustomClass. Case sensitive.
+     * 
+ * + * string custom_class_id = 2; + * @return This builder for chaining. + */ + public Builder clearCustomClassId() { + + customClassId_ = getDefaultInstance().getCustomClassId(); + onChanged(); + return this; + } + /** + *
+     * If this custom class is a resource, the custom_class_id is the resource id
+     * of the CustomClass. Case sensitive.
+     * 
+ * + * string custom_class_id = 2; + * @param value The bytes for customClassId to set. + * @return This builder for chaining. + */ + public Builder setCustomClassIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + customClassId_ = value; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass.ClassItem, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder, com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder> itemsBuilder_; + + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public com.google.cloud.speech.v1.CustomClass.ClassItem getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public Builder setItems( + int index, com.google.cloud.speech.v1.CustomClass.ClassItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public Builder setItems( + int index, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public Builder addItems(com.google.cloud.speech.v1.CustomClass.ClassItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public Builder addItems( + int index, com.google.cloud.speech.v1.CustomClass.ClassItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public Builder addItems( + com.google.cloud.speech.v1.CustomClass.ClassItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public Builder addItems( + int index, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public com.google.cloud.speech.v1.CustomClass.ClassItem.Builder getItemsBuilder( + int index) { + return getItemsFieldBuilder().getBuilder(index); + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( + int index) { + if (itemsBuilder_ == null) { + return items_.get(index); } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public com.google.cloud.speech.v1.CustomClass.ClassItem.Builder addItemsBuilder() { + return getItemsFieldBuilder().addBuilder( + com.google.cloud.speech.v1.CustomClass.ClassItem.getDefaultInstance()); + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public com.google.cloud.speech.v1.CustomClass.ClassItem.Builder addItemsBuilder( + int index) { + return getItemsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.CustomClass.ClassItem.getDefaultInstance()); + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + public java.util.List + getItemsBuilderList() { + return getItemsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass.ClassItem, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder, com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass.ClassItem, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder, com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder>( + items_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + items_ = null; + } + return itemsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.CustomClass) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.CustomClass) + private static final com.google.cloud.speech.v1.CustomClass DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.CustomClass(); + } + + public static com.google.cloud.speech.v1.CustomClass getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomClass parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CustomClass(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassName.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassName.java new file mode 100644 index 000000000000..96235bc68334 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassName.java @@ -0,0 +1,227 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class CustomClassName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CUSTOM_CLASS = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/customClasses/{custom_class}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String customClass; + + @Deprecated + protected CustomClassName() { + project = null; + location = null; + customClass = null; + } + + private CustomClassName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + customClass = Preconditions.checkNotNull(builder.getCustomClass()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCustomClass() { + return customClass; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CustomClassName of(String project, String location, String customClass) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCustomClass(customClass) + .build(); + } + + public static String format(String project, String location, String customClass) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCustomClass(customClass) + .build() + .toString(); + } + + public static CustomClassName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CUSTOM_CLASS.validatedMatch( + formattedString, "CustomClassName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("custom_class")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (CustomClassName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CUSTOM_CLASS.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customClass != null) { + fieldMapBuilder.put("custom_class", customClass); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CUSTOM_CLASS.instantiate( + "project", project, "location", location, "custom_class", customClass); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CustomClassName that = ((CustomClassName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customClass, that.customClass); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customClass); + return h; + } + + /** Builder for projects/{project}/locations/{location}/customClasses/{custom_class}. */ + public static class Builder { + private String project; + private String location; + private String customClass; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCustomClass() { + return customClass; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomClass(String customClass) { + this.customClass = customClass; + return this; + } + + private Builder(CustomClassName customClassName) { + this.project = customClassName.project; + this.location = customClassName.location; + this.customClass = customClassName.customClass; + } + + public CustomClassName build() { + return new CustomClassName(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassOrBuilder.java new file mode 100644 index 000000000000..d22bd6cc0b5e --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassOrBuilder.java @@ -0,0 +1,95 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/resource.proto + +package com.google.cloud.speech.v1; + +public interface CustomClassOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.CustomClass) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the custom class.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the custom class.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * If this custom class is a resource, the custom_class_id is the resource id
+   * of the CustomClass. Case sensitive.
+   * 
+ * + * string custom_class_id = 2; + * @return The customClassId. + */ + java.lang.String getCustomClassId(); + /** + *
+   * If this custom class is a resource, the custom_class_id is the resource id
+   * of the CustomClass. Case sensitive.
+   * 
+ * + * string custom_class_id = 2; + * @return The bytes for customClassId. + */ + com.google.protobuf.ByteString + getCustomClassIdBytes(); + + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + java.util.List + getItemsList(); + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + com.google.cloud.speech.v1.CustomClass.ClassItem getItems(int index); + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + int getItemsCount(); + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + java.util.List + getItemsOrBuilderList(); + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; + */ + com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( + int index); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequest.java new file mode 100644 index 000000000000..f07ccb28d69e --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequest.java @@ -0,0 +1,637 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Message sent by the client for the `DeleteCustomClass` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.DeleteCustomClassRequest} + */ +public final class DeleteCustomClassRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.DeleteCustomClassRequest) + DeleteCustomClassRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteCustomClassRequest.newBuilder() to construct. + private DeleteCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteCustomClassRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeleteCustomClassRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteCustomClassRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.DeleteCustomClassRequest.class, com.google.cloud.speech.v1.DeleteCustomClassRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The name of the custom class to delete. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The name of the custom class to delete. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.DeleteCustomClassRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.DeleteCustomClassRequest other = (com.google.cloud.speech.v1.DeleteCustomClassRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.DeleteCustomClassRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `DeleteCustomClass` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.DeleteCustomClassRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.DeleteCustomClassRequest) + com.google.cloud.speech.v1.DeleteCustomClassRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.DeleteCustomClassRequest.class, com.google.cloud.speech.v1.DeleteCustomClassRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.DeleteCustomClassRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.DeleteCustomClassRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.DeleteCustomClassRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.DeleteCustomClassRequest build() { + com.google.cloud.speech.v1.DeleteCustomClassRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.DeleteCustomClassRequest buildPartial() { + com.google.cloud.speech.v1.DeleteCustomClassRequest result = new com.google.cloud.speech.v1.DeleteCustomClassRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.DeleteCustomClassRequest) { + return mergeFrom((com.google.cloud.speech.v1.DeleteCustomClassRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.DeleteCustomClassRequest other) { + if (other == com.google.cloud.speech.v1.DeleteCustomClassRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.DeleteCustomClassRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.DeleteCustomClassRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The name of the custom class to delete. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The name of the custom class to delete. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The name of the custom class to delete. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The name of the custom class to delete. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The name of the custom class to delete. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.DeleteCustomClassRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.DeleteCustomClassRequest) + private static final com.google.cloud.speech.v1.DeleteCustomClassRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.DeleteCustomClassRequest(); + } + + public static com.google.cloud.speech.v1.DeleteCustomClassRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteCustomClassRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteCustomClassRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.DeleteCustomClassRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequestOrBuilder.java new file mode 100644 index 000000000000..a534c8411380 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequestOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public interface DeleteCustomClassRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.DeleteCustomClassRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The name of the custom class to delete. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Required. The name of the custom class to delete. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequest.java new file mode 100644 index 000000000000..c16d6b374bff --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequest.java @@ -0,0 +1,602 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Message sent by the client for the `DeletePhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.DeletePhraseSetRequest} + */ +public final class DeletePhraseSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.DeletePhraseSetRequest) + DeletePhraseSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeletePhraseSetRequest.newBuilder() to construct. + private DeletePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeletePhraseSetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeletePhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeletePhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.DeletePhraseSetRequest.class, com.google.cloud.speech.v1.DeletePhraseSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The name of the phrase set to delete. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The name of the phrase set to delete. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.DeletePhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.DeletePhraseSetRequest other = (com.google.cloud.speech.v1.DeletePhraseSetRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.DeletePhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `DeletePhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.DeletePhraseSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.DeletePhraseSetRequest) + com.google.cloud.speech.v1.DeletePhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.DeletePhraseSetRequest.class, com.google.cloud.speech.v1.DeletePhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.DeletePhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.DeletePhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.DeletePhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.DeletePhraseSetRequest build() { + com.google.cloud.speech.v1.DeletePhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.DeletePhraseSetRequest buildPartial() { + com.google.cloud.speech.v1.DeletePhraseSetRequest result = new com.google.cloud.speech.v1.DeletePhraseSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.DeletePhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1.DeletePhraseSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.DeletePhraseSetRequest other) { + if (other == com.google.cloud.speech.v1.DeletePhraseSetRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.DeletePhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.DeletePhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The name of the phrase set to delete. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The name of the phrase set to delete. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The name of the phrase set to delete. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The name of the phrase set to delete. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The name of the phrase set to delete. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.DeletePhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.DeletePhraseSetRequest) + private static final com.google.cloud.speech.v1.DeletePhraseSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.DeletePhraseSetRequest(); + } + + public static com.google.cloud.speech.v1.DeletePhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeletePhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.DeletePhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequestOrBuilder.java new file mode 100644 index 000000000000..6e63a397ad6a --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public interface DeletePhraseSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.DeletePhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The name of the phrase set to delete. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Required. The name of the phrase set to delete. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequest.java new file mode 100644 index 000000000000..d9a29a78b802 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequest.java @@ -0,0 +1,602 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Message sent by the client for the `GetCustomClass` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.GetCustomClassRequest} + */ +public final class GetCustomClassRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.GetCustomClassRequest) + GetCustomClassRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetCustomClassRequest.newBuilder() to construct. + private GetCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetCustomClassRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetCustomClassRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetCustomClassRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.GetCustomClassRequest.class, com.google.cloud.speech.v1.GetCustomClassRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The name of the custom class to retrieve. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The name of the custom class to retrieve. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.GetCustomClassRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.GetCustomClassRequest other = (com.google.cloud.speech.v1.GetCustomClassRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.GetCustomClassRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.GetCustomClassRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.GetCustomClassRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `GetCustomClass` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.GetCustomClassRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.GetCustomClassRequest) + com.google.cloud.speech.v1.GetCustomClassRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.GetCustomClassRequest.class, com.google.cloud.speech.v1.GetCustomClassRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.GetCustomClassRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetCustomClassRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.GetCustomClassRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.GetCustomClassRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.GetCustomClassRequest build() { + com.google.cloud.speech.v1.GetCustomClassRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.GetCustomClassRequest buildPartial() { + com.google.cloud.speech.v1.GetCustomClassRequest result = new com.google.cloud.speech.v1.GetCustomClassRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.GetCustomClassRequest) { + return mergeFrom((com.google.cloud.speech.v1.GetCustomClassRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.GetCustomClassRequest other) { + if (other == com.google.cloud.speech.v1.GetCustomClassRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.GetCustomClassRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.GetCustomClassRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The name of the custom class to retrieve. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The name of the custom class to retrieve. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The name of the custom class to retrieve. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The name of the custom class to retrieve. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The name of the custom class to retrieve. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.GetCustomClassRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.GetCustomClassRequest) + private static final com.google.cloud.speech.v1.GetCustomClassRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.GetCustomClassRequest(); + } + + public static com.google.cloud.speech.v1.GetCustomClassRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCustomClassRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetCustomClassRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.GetCustomClassRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequestOrBuilder.java new file mode 100644 index 000000000000..61476aadbf58 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public interface GetCustomClassRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.GetCustomClassRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The name of the custom class to retrieve. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Required. The name of the custom class to retrieve. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequest.java new file mode 100644 index 000000000000..b38cf58c73f6 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequest.java @@ -0,0 +1,637 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Message sent by the client for the `GetPhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.GetPhraseSetRequest} + */ +public final class GetPhraseSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.GetPhraseSetRequest) + GetPhraseSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetPhraseSetRequest.newBuilder() to construct. + private GetPhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetPhraseSetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetPhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetPhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetPhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetPhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.GetPhraseSetRequest.class, com.google.cloud.speech.v1.GetPhraseSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The name of the phrase set to retrieve. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The name of the phrase set to retrieve. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.GetPhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.GetPhraseSetRequest other = (com.google.cloud.speech.v1.GetPhraseSetRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.GetPhraseSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.GetPhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.GetPhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `GetPhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.GetPhraseSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.GetPhraseSetRequest) + com.google.cloud.speech.v1.GetPhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetPhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetPhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.GetPhraseSetRequest.class, com.google.cloud.speech.v1.GetPhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.GetPhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetPhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.GetPhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.GetPhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.GetPhraseSetRequest build() { + com.google.cloud.speech.v1.GetPhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.GetPhraseSetRequest buildPartial() { + com.google.cloud.speech.v1.GetPhraseSetRequest result = new com.google.cloud.speech.v1.GetPhraseSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.GetPhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1.GetPhraseSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.GetPhraseSetRequest other) { + if (other == com.google.cloud.speech.v1.GetPhraseSetRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.GetPhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.GetPhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The name of the phrase set to retrieve. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The name of the phrase set to retrieve. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The name of the phrase set to retrieve. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The name of the phrase set to retrieve. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The name of the phrase set to retrieve. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.GetPhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.GetPhraseSetRequest) + private static final com.google.cloud.speech.v1.GetPhraseSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.GetPhraseSetRequest(); + } + + public static com.google.cloud.speech.v1.GetPhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetPhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.GetPhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequestOrBuilder.java new file mode 100644 index 000000000000..a7aa5beacb2e --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequestOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public interface GetPhraseSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.GetPhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The name of the phrase set to retrieve. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Required. The name of the phrase set to retrieve. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequest.java new file mode 100644 index 000000000000..0ec369dc1d97 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequest.java @@ -0,0 +1,916 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Message sent by the client for the `ListCustomClasses` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.ListCustomClassesRequest} + */ +public final class ListCustomClassesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.ListCustomClassesRequest) + ListCustomClassesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListCustomClassesRequest.newBuilder() to construct. + private ListCustomClassesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListCustomClassesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListCustomClassesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListCustomClassesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.ListCustomClassesRequest.class, com.google.cloud.speech.v1.ListCustomClassesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent, which owns this collection of custom classes. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent, which owns this collection of custom classes. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of custom classes to return. The service may return
+   * fewer than this value. If unspecified, at most 50 custom classes will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * A page token, received from a previous `ListCustomClass` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListCustomClass` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * A page token, received from a previous `ListCustomClass` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListCustomClass` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.ListCustomClassesRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.ListCustomClassesRequest other = (com.google.cloud.speech.v1.ListCustomClassesRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListCustomClassesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.ListCustomClassesRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.ListCustomClassesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `ListCustomClasses` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.ListCustomClassesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.ListCustomClassesRequest) + com.google.cloud.speech.v1.ListCustomClassesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.ListCustomClassesRequest.class, com.google.cloud.speech.v1.ListCustomClassesRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.ListCustomClassesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListCustomClassesRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.ListCustomClassesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListCustomClassesRequest build() { + com.google.cloud.speech.v1.ListCustomClassesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListCustomClassesRequest buildPartial() { + com.google.cloud.speech.v1.ListCustomClassesRequest result = new com.google.cloud.speech.v1.ListCustomClassesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.ListCustomClassesRequest) { + return mergeFrom((com.google.cloud.speech.v1.ListCustomClassesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.ListCustomClassesRequest other) { + if (other == com.google.cloud.speech.v1.ListCustomClassesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.ListCustomClassesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.ListCustomClassesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent, which owns this collection of custom classes. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent, which owns this collection of custom classes. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent, which owns this collection of custom classes. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent, which owns this collection of custom classes. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent, which owns this collection of custom classes. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * The maximum number of custom classes to return. The service may return
+     * fewer than this value. If unspecified, at most 50 custom classes will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of custom classes to return. The service may return
+     * fewer than this value. If unspecified, at most 50 custom classes will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of custom classes to return. The service may return
+     * fewer than this value. If unspecified, at most 50 custom classes will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.ListCustomClassesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.ListCustomClassesRequest) + private static final com.google.cloud.speech.v1.ListCustomClassesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.ListCustomClassesRequest(); + } + + public static com.google.cloud.speech.v1.ListCustomClassesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCustomClassesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCustomClassesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListCustomClassesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequestOrBuilder.java new file mode 100644 index 000000000000..5e2d443bfaad --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequestOrBuilder.java @@ -0,0 +1,80 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public interface ListCustomClassesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.ListCustomClassesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent, which owns this collection of custom classes. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent, which owns this collection of custom classes. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of custom classes to return. The service may return
+   * fewer than this value. If unspecified, at most 50 custom classes will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * A page token, received from a previous `ListCustomClass` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListCustomClass` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * A page token, received from a previous `ListCustomClass` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListCustomClass` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponse.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponse.java new file mode 100644 index 000000000000..702ef6bb24ab --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponse.java @@ -0,0 +1,1045 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Message returned to the client by the `ListCustomClasses` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.ListCustomClassesResponse} + */ +public final class ListCustomClassesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.ListCustomClassesResponse) + ListCustomClassesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListCustomClassesResponse.newBuilder() to construct. + private ListCustomClassesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListCustomClassesResponse() { + customClasses_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListCustomClassesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListCustomClassesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + customClasses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + customClasses_.add( + input.readMessage(com.google.cloud.speech.v1.CustomClass.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + customClasses_ = java.util.Collections.unmodifiableList(customClasses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.ListCustomClassesResponse.class, com.google.cloud.speech.v1.ListCustomClassesResponse.Builder.class); + } + + public static final int CUSTOM_CLASSES_FIELD_NUMBER = 1; + private java.util.List customClasses_; + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public java.util.List getCustomClassesList() { + return customClasses_; + } + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public java.util.List + getCustomClassesOrBuilderList() { + return customClasses_; + } + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public int getCustomClassesCount() { + return customClasses_.size(); + } + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass getCustomClasses(int index) { + return customClasses_.get(index); + } + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index) { + return customClasses_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < customClasses_.size(); i++) { + output.writeMessage(1, customClasses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < customClasses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, customClasses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.ListCustomClassesResponse)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.ListCustomClassesResponse other = (com.google.cloud.speech.v1.ListCustomClassesResponse) obj; + + if (!getCustomClassesList() + .equals(other.getCustomClassesList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCustomClassesCount() > 0) { + hash = (37 * hash) + CUSTOM_CLASSES_FIELD_NUMBER; + hash = (53 * hash) + getCustomClassesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListCustomClassesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.ListCustomClassesResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.ListCustomClassesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message returned to the client by the `ListCustomClasses` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.ListCustomClassesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.ListCustomClassesResponse) + com.google.cloud.speech.v1.ListCustomClassesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.ListCustomClassesResponse.class, com.google.cloud.speech.v1.ListCustomClassesResponse.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.ListCustomClassesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getCustomClassesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (customClassesBuilder_ == null) { + customClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + customClassesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListCustomClassesResponse getDefaultInstanceForType() { + return com.google.cloud.speech.v1.ListCustomClassesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListCustomClassesResponse build() { + com.google.cloud.speech.v1.ListCustomClassesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListCustomClassesResponse buildPartial() { + com.google.cloud.speech.v1.ListCustomClassesResponse result = new com.google.cloud.speech.v1.ListCustomClassesResponse(this); + int from_bitField0_ = bitField0_; + if (customClassesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + customClasses_ = java.util.Collections.unmodifiableList(customClasses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.customClasses_ = customClasses_; + } else { + result.customClasses_ = customClassesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.ListCustomClassesResponse) { + return mergeFrom((com.google.cloud.speech.v1.ListCustomClassesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.ListCustomClassesResponse other) { + if (other == com.google.cloud.speech.v1.ListCustomClassesResponse.getDefaultInstance()) return this; + if (customClassesBuilder_ == null) { + if (!other.customClasses_.isEmpty()) { + if (customClasses_.isEmpty()) { + customClasses_ = other.customClasses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCustomClassesIsMutable(); + customClasses_.addAll(other.customClasses_); + } + onChanged(); + } + } else { + if (!other.customClasses_.isEmpty()) { + if (customClassesBuilder_.isEmpty()) { + customClassesBuilder_.dispose(); + customClassesBuilder_ = null; + customClasses_ = other.customClasses_; + bitField0_ = (bitField0_ & ~0x00000001); + customClassesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getCustomClassesFieldBuilder() : null; + } else { + customClassesBuilder_.addAllMessages(other.customClasses_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.ListCustomClassesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.ListCustomClassesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List customClasses_ = + java.util.Collections.emptyList(); + private void ensureCustomClassesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + customClasses_ = new java.util.ArrayList(customClasses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> customClassesBuilder_; + + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public java.util.List getCustomClassesList() { + if (customClassesBuilder_ == null) { + return java.util.Collections.unmodifiableList(customClasses_); + } else { + return customClassesBuilder_.getMessageList(); + } + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public int getCustomClassesCount() { + if (customClassesBuilder_ == null) { + return customClasses_.size(); + } else { + return customClassesBuilder_.getCount(); + } + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1.CustomClass getCustomClasses(int index) { + if (customClassesBuilder_ == null) { + return customClasses_.get(index); + } else { + return customClassesBuilder_.getMessage(index); + } + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public Builder setCustomClasses( + int index, com.google.cloud.speech.v1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.set(index, value); + onChanged(); + } else { + customClassesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public Builder setCustomClasses( + int index, com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.set(index, builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public Builder addCustomClasses(com.google.cloud.speech.v1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.add(value); + onChanged(); + } else { + customClassesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public Builder addCustomClasses( + int index, com.google.cloud.speech.v1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.add(index, value); + onChanged(); + } else { + customClassesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public Builder addCustomClasses( + com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.add(builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public Builder addCustomClasses( + int index, com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.add(index, builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public Builder addAllCustomClasses( + java.lang.Iterable values) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, customClasses_); + onChanged(); + } else { + customClassesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public Builder clearCustomClasses() { + if (customClassesBuilder_ == null) { + customClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + customClassesBuilder_.clear(); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public Builder removeCustomClasses(int index) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.remove(index); + onChanged(); + } else { + customClassesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1.CustomClass.Builder getCustomClassesBuilder( + int index) { + return getCustomClassesFieldBuilder().getBuilder(index); + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index) { + if (customClassesBuilder_ == null) { + return customClasses_.get(index); } else { + return customClassesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public java.util.List + getCustomClassesOrBuilderList() { + if (customClassesBuilder_ != null) { + return customClassesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(customClasses_); + } + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1.CustomClass.Builder addCustomClassesBuilder() { + return getCustomClassesFieldBuilder().addBuilder( + com.google.cloud.speech.v1.CustomClass.getDefaultInstance()); + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1.CustomClass.Builder addCustomClassesBuilder( + int index) { + return getCustomClassesFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.CustomClass.getDefaultInstance()); + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + public java.util.List + getCustomClassesBuilderList() { + return getCustomClassesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> + getCustomClassesFieldBuilder() { + if (customClassesBuilder_ == null) { + customClassesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder>( + customClasses_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + customClasses_ = null; + } + return customClassesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.ListCustomClassesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.ListCustomClassesResponse) + private static final com.google.cloud.speech.v1.ListCustomClassesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.ListCustomClassesResponse(); + } + + public static com.google.cloud.speech.v1.ListCustomClassesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCustomClassesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCustomClassesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListCustomClassesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponseOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponseOrBuilder.java new file mode 100644 index 000000000000..59b5c44f8cf4 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public interface ListCustomClassesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.ListCustomClassesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + java.util.List + getCustomClassesList(); + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + com.google.cloud.speech.v1.CustomClass getCustomClasses(int index); + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + int getCustomClassesCount(); + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + java.util.List + getCustomClassesOrBuilderList(); + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; + */ + com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index); + + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequest.java new file mode 100644 index 000000000000..e574eaab8aa9 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequest.java @@ -0,0 +1,916 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Message sent by the client for the `ListPhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.ListPhraseSetRequest} + */ +public final class ListPhraseSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.ListPhraseSetRequest) + ListPhraseSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListPhraseSetRequest.newBuilder() to construct. + private ListPhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListPhraseSetRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListPhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListPhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.ListPhraseSetRequest.class, com.google.cloud.speech.v1.ListPhraseSetRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent, which owns this collection of phrase set. Format:
+   * `projects/{project}/locations/{location}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent, which owns this collection of phrase set. Format:
+   * `projects/{project}/locations/{location}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of phrase sets to return. The service may return
+   * fewer than this value. If unspecified, at most 50 phrase sets will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * A page token, received from a previous `ListPhraseSet` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListPhraseSet` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * A page token, received from a previous `ListPhraseSet` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListPhraseSet` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.ListPhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.ListPhraseSetRequest other = (com.google.cloud.speech.v1.ListPhraseSetRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListPhraseSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.ListPhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.ListPhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `ListPhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.ListPhraseSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.ListPhraseSetRequest) + com.google.cloud.speech.v1.ListPhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.ListPhraseSetRequest.class, com.google.cloud.speech.v1.ListPhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.ListPhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListPhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.ListPhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListPhraseSetRequest build() { + com.google.cloud.speech.v1.ListPhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListPhraseSetRequest buildPartial() { + com.google.cloud.speech.v1.ListPhraseSetRequest result = new com.google.cloud.speech.v1.ListPhraseSetRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.ListPhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1.ListPhraseSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.ListPhraseSetRequest other) { + if (other == com.google.cloud.speech.v1.ListPhraseSetRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.ListPhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.ListPhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent, which owns this collection of phrase set. Format:
+     * `projects/{project}/locations/{location}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent, which owns this collection of phrase set. Format:
+     * `projects/{project}/locations/{location}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent, which owns this collection of phrase set. Format:
+     * `projects/{project}/locations/{location}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent, which owns this collection of phrase set. Format:
+     * `projects/{project}/locations/{location}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent, which owns this collection of phrase set. Format:
+     * `projects/{project}/locations/{location}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * The maximum number of phrase sets to return. The service may return
+     * fewer than this value. If unspecified, at most 50 phrase sets will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of phrase sets to return. The service may return
+     * fewer than this value. If unspecified, at most 50 phrase sets will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of phrase sets to return. The service may return
+     * fewer than this value. If unspecified, at most 50 phrase sets will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.ListPhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.ListPhraseSetRequest) + private static final com.google.cloud.speech.v1.ListPhraseSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.ListPhraseSetRequest(); + } + + public static com.google.cloud.speech.v1.ListPhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListPhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequestOrBuilder.java new file mode 100644 index 000000000000..0077943458ba --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequestOrBuilder.java @@ -0,0 +1,80 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public interface ListPhraseSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.ListPhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent, which owns this collection of phrase set. Format:
+   * `projects/{project}/locations/{location}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent, which owns this collection of phrase set. Format:
+   * `projects/{project}/locations/{location}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of phrase sets to return. The service may return
+   * fewer than this value. If unspecified, at most 50 phrase sets will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * A page token, received from a previous `ListPhraseSet` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListPhraseSet` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * A page token, received from a previous `ListPhraseSet` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListPhraseSet` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponse.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponse.java new file mode 100644 index 000000000000..e03484719a02 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponse.java @@ -0,0 +1,1045 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Message returned to the client by the `ListPhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.ListPhraseSetResponse} + */ +public final class ListPhraseSetResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.ListPhraseSetResponse) + ListPhraseSetResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListPhraseSetResponse.newBuilder() to construct. + private ListPhraseSetResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListPhraseSetResponse() { + phraseSets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListPhraseSetResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListPhraseSetResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + phraseSets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + phraseSets_.add( + input.readMessage(com.google.cloud.speech.v1.PhraseSet.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.ListPhraseSetResponse.class, com.google.cloud.speech.v1.ListPhraseSetResponse.Builder.class); + } + + public static final int PHRASE_SETS_FIELD_NUMBER = 1; + private java.util.List phraseSets_; + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public java.util.List getPhraseSetsList() { + return phraseSets_; + } + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public java.util.List + getPhraseSetsOrBuilderList() { + return phraseSets_; + } + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public int getPhraseSetsCount() { + return phraseSets_.size(); + } + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet getPhraseSets(int index) { + return phraseSets_.get(index); + } + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetsOrBuilder( + int index) { + return phraseSets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < phraseSets_.size(); i++) { + output.writeMessage(1, phraseSets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < phraseSets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, phraseSets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.ListPhraseSetResponse)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.ListPhraseSetResponse other = (com.google.cloud.speech.v1.ListPhraseSetResponse) obj; + + if (!getPhraseSetsList() + .equals(other.getPhraseSetsList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPhraseSetsCount() > 0) { + hash = (37 * hash) + PHRASE_SETS_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSetsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListPhraseSetResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.ListPhraseSetResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.ListPhraseSetResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message returned to the client by the `ListPhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.ListPhraseSetResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.ListPhraseSetResponse) + com.google.cloud.speech.v1.ListPhraseSetResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.ListPhraseSetResponse.class, com.google.cloud.speech.v1.ListPhraseSetResponse.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.ListPhraseSetResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPhraseSetsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (phraseSetsBuilder_ == null) { + phraseSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + phraseSetsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListPhraseSetResponse getDefaultInstanceForType() { + return com.google.cloud.speech.v1.ListPhraseSetResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListPhraseSetResponse build() { + com.google.cloud.speech.v1.ListPhraseSetResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListPhraseSetResponse buildPartial() { + com.google.cloud.speech.v1.ListPhraseSetResponse result = new com.google.cloud.speech.v1.ListPhraseSetResponse(this); + int from_bitField0_ = bitField0_; + if (phraseSetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.phraseSets_ = phraseSets_; + } else { + result.phraseSets_ = phraseSetsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.ListPhraseSetResponse) { + return mergeFrom((com.google.cloud.speech.v1.ListPhraseSetResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.ListPhraseSetResponse other) { + if (other == com.google.cloud.speech.v1.ListPhraseSetResponse.getDefaultInstance()) return this; + if (phraseSetsBuilder_ == null) { + if (!other.phraseSets_.isEmpty()) { + if (phraseSets_.isEmpty()) { + phraseSets_ = other.phraseSets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePhraseSetsIsMutable(); + phraseSets_.addAll(other.phraseSets_); + } + onChanged(); + } + } else { + if (!other.phraseSets_.isEmpty()) { + if (phraseSetsBuilder_.isEmpty()) { + phraseSetsBuilder_.dispose(); + phraseSetsBuilder_ = null; + phraseSets_ = other.phraseSets_; + bitField0_ = (bitField0_ & ~0x00000001); + phraseSetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPhraseSetsFieldBuilder() : null; + } else { + phraseSetsBuilder_.addAllMessages(other.phraseSets_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.ListPhraseSetResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.ListPhraseSetResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List phraseSets_ = + java.util.Collections.emptyList(); + private void ensurePhraseSetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + phraseSets_ = new java.util.ArrayList(phraseSets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> phraseSetsBuilder_; + + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public java.util.List getPhraseSetsList() { + if (phraseSetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(phraseSets_); + } else { + return phraseSetsBuilder_.getMessageList(); + } + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public int getPhraseSetsCount() { + if (phraseSetsBuilder_ == null) { + return phraseSets_.size(); + } else { + return phraseSetsBuilder_.getCount(); + } + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1.PhraseSet getPhraseSets(int index) { + if (phraseSetsBuilder_ == null) { + return phraseSets_.get(index); + } else { + return phraseSetsBuilder_.getMessage(index); + } + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder setPhraseSets( + int index, com.google.cloud.speech.v1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.set(index, value); + onChanged(); + } else { + phraseSetsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder setPhraseSets( + int index, com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.set(index, builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets(com.google.cloud.speech.v1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.add(value); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + int index, com.google.cloud.speech.v1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.add(index, value); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.add(builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + int index, com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.add(index, builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder addAllPhraseSets( + java.lang.Iterable values) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, phraseSets_); + onChanged(); + } else { + phraseSetsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder clearPhraseSets() { + if (phraseSetsBuilder_ == null) { + phraseSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + phraseSetsBuilder_.clear(); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder removePhraseSets(int index) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.remove(index); + onChanged(); + } else { + phraseSetsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1.PhraseSet.Builder getPhraseSetsBuilder( + int index) { + return getPhraseSetsFieldBuilder().getBuilder(index); + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetsOrBuilder( + int index) { + if (phraseSetsBuilder_ == null) { + return phraseSets_.get(index); } else { + return phraseSetsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public java.util.List + getPhraseSetsOrBuilderList() { + if (phraseSetsBuilder_ != null) { + return phraseSetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(phraseSets_); + } + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1.PhraseSet.Builder addPhraseSetsBuilder() { + return getPhraseSetsFieldBuilder().addBuilder( + com.google.cloud.speech.v1.PhraseSet.getDefaultInstance()); + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1.PhraseSet.Builder addPhraseSetsBuilder( + int index) { + return getPhraseSetsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.PhraseSet.getDefaultInstance()); + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public java.util.List + getPhraseSetsBuilderList() { + return getPhraseSetsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> + getPhraseSetsFieldBuilder() { + if (phraseSetsBuilder_ == null) { + phraseSetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder>( + phraseSets_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + phraseSets_ = null; + } + return phraseSetsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.ListPhraseSetResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.ListPhraseSetResponse) + private static final com.google.cloud.speech.v1.ListPhraseSetResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.ListPhraseSetResponse(); + } + + public static com.google.cloud.speech.v1.ListPhraseSetResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPhraseSetResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPhraseSetResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.ListPhraseSetResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponseOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponseOrBuilder.java new file mode 100644 index 000000000000..8f78e4160d41 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public interface ListPhraseSetResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.ListPhraseSetResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + java.util.List + getPhraseSetsList(); + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + com.google.cloud.speech.v1.PhraseSet getPhraseSets(int index); + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + int getPhraseSetsCount(); + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + java.util.List + getPhraseSetsOrBuilderList(); + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetsOrBuilder( + int index); + + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LocationName.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LocationName.java new file mode 100644 index 000000000000..3c3cf94f255a --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadata.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadata.java new file mode 100644 index 000000000000..6dec13323dd3 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadata.java @@ -0,0 +1,1162 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Describes the progress of a long-running `LongRunningRecognize` call. It is
+ * included in the `metadata` field of the `Operation` returned by the
+ * `GetOperation` call of the `google::longrunning::Operations` service.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeMetadata} + */ +public final class LongRunningRecognizeMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.LongRunningRecognizeMetadata) + LongRunningRecognizeMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use LongRunningRecognizeMetadata.newBuilder() to construct. + private LongRunningRecognizeMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LongRunningRecognizeMetadata() { + uri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LongRunningRecognizeMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LongRunningRecognizeMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + progressPercent_ = input.readInt32(); + break; + } + case 18: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (lastUpdateTime_ != null) { + subBuilder = lastUpdateTime_.toBuilder(); + } + lastUpdateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(lastUpdateTime_); + lastUpdateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.LongRunningRecognizeMetadata.class, com.google.cloud.speech.v1.LongRunningRecognizeMetadata.Builder.class); + } + + public static final int PROGRESS_PERCENT_FIELD_NUMBER = 1; + private int progressPercent_; + /** + *
+   * Approximate percentage of audio processed thus far. Guaranteed to be 100
+   * when the audio is fully processed and the results are available.
+   * 
+ * + * int32 progress_percent = 1; + * @return The progressPercent. + */ + @java.lang.Override + public int getProgressPercent() { + return progressPercent_; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int LAST_UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp lastUpdateTime_; + /** + *
+   * Time of the most recent processing update.
+   * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + * @return Whether the lastUpdateTime field is set. + */ + @java.lang.Override + public boolean hasLastUpdateTime() { + return lastUpdateTime_ != null; + } + /** + *
+   * Time of the most recent processing update.
+   * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + * @return The lastUpdateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getLastUpdateTime() { + return lastUpdateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lastUpdateTime_; + } + /** + *
+   * Time of the most recent processing update.
+   * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { + return getLastUpdateTime(); + } + + public static final int URI_FIELD_NUMBER = 4; + private volatile java.lang.Object uri_; + /** + *
+   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+   * as byte content.
+   * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + *
+   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+   * as byte content.
+   * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (progressPercent_ != 0) { + output.writeInt32(1, progressPercent_); + } + if (startTime_ != null) { + output.writeMessage(2, getStartTime()); + } + if (lastUpdateTime_ != null) { + output.writeMessage(3, getLastUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, uri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (progressPercent_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, progressPercent_); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getStartTime()); + } + if (lastUpdateTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getLastUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, uri_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.LongRunningRecognizeMetadata)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.LongRunningRecognizeMetadata other = (com.google.cloud.speech.v1.LongRunningRecognizeMetadata) obj; + + if (getProgressPercent() + != other.getProgressPercent()) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime() + .equals(other.getStartTime())) return false; + } + if (hasLastUpdateTime() != other.hasLastUpdateTime()) return false; + if (hasLastUpdateTime()) { + if (!getLastUpdateTime() + .equals(other.getLastUpdateTime())) return false; + } + if (!getUri() + .equals(other.getUri())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PROGRESS_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getProgressPercent(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasLastUpdateTime()) { + hash = (37 * hash) + LAST_UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getLastUpdateTime().hashCode(); + } + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.LongRunningRecognizeMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Describes the progress of a long-running `LongRunningRecognize` call. It is
+   * included in the `metadata` field of the `Operation` returned by the
+   * `GetOperation` call of the `google::longrunning::Operations` service.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.LongRunningRecognizeMetadata) + com.google.cloud.speech.v1.LongRunningRecognizeMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.LongRunningRecognizeMetadata.class, com.google.cloud.speech.v1.LongRunningRecognizeMetadata.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.LongRunningRecognizeMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + progressPercent_ = 0; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (lastUpdateTimeBuilder_ == null) { + lastUpdateTime_ = null; + } else { + lastUpdateTime_ = null; + lastUpdateTimeBuilder_ = null; + } + uri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.LongRunningRecognizeMetadata getDefaultInstanceForType() { + return com.google.cloud.speech.v1.LongRunningRecognizeMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.LongRunningRecognizeMetadata build() { + com.google.cloud.speech.v1.LongRunningRecognizeMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.LongRunningRecognizeMetadata buildPartial() { + com.google.cloud.speech.v1.LongRunningRecognizeMetadata result = new com.google.cloud.speech.v1.LongRunningRecognizeMetadata(this); + result.progressPercent_ = progressPercent_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (lastUpdateTimeBuilder_ == null) { + result.lastUpdateTime_ = lastUpdateTime_; + } else { + result.lastUpdateTime_ = lastUpdateTimeBuilder_.build(); + } + result.uri_ = uri_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.LongRunningRecognizeMetadata) { + return mergeFrom((com.google.cloud.speech.v1.LongRunningRecognizeMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.LongRunningRecognizeMetadata other) { + if (other == com.google.cloud.speech.v1.LongRunningRecognizeMetadata.getDefaultInstance()) return this; + if (other.getProgressPercent() != 0) { + setProgressPercent(other.getProgressPercent()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasLastUpdateTime()) { + mergeLastUpdateTime(other.getLastUpdateTime()); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.LongRunningRecognizeMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.LongRunningRecognizeMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int progressPercent_ ; + /** + *
+     * Approximate percentage of audio processed thus far. Guaranteed to be 100
+     * when the audio is fully processed and the results are available.
+     * 
+ * + * int32 progress_percent = 1; + * @return The progressPercent. + */ + @java.lang.Override + public int getProgressPercent() { + return progressPercent_; + } + /** + *
+     * Approximate percentage of audio processed thus far. Guaranteed to be 100
+     * when the audio is fully processed and the results are available.
+     * 
+ * + * int32 progress_percent = 1; + * @param value The progressPercent to set. + * @return This builder for chaining. + */ + public Builder setProgressPercent(int value) { + + progressPercent_ = value; + onChanged(); + return this; + } + /** + *
+     * Approximate percentage of audio processed thus far. Guaranteed to be 100
+     * when the audio is fully processed and the results are available.
+     * 
+ * + * int32 progress_percent = 1; + * @return This builder for chaining. + */ + public Builder clearProgressPercent() { + + progressPercent_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getStartTime(), + getParentForChildren(), + isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp lastUpdateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> lastUpdateTimeBuilder_; + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + * @return Whether the lastUpdateTime field is set. + */ + public boolean hasLastUpdateTime() { + return lastUpdateTimeBuilder_ != null || lastUpdateTime_ != null; + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + * @return The lastUpdateTime. + */ + public com.google.protobuf.Timestamp getLastUpdateTime() { + if (lastUpdateTimeBuilder_ == null) { + return lastUpdateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lastUpdateTime_; + } else { + return lastUpdateTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + public Builder setLastUpdateTime(com.google.protobuf.Timestamp value) { + if (lastUpdateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lastUpdateTime_ = value; + onChanged(); + } else { + lastUpdateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + public Builder setLastUpdateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (lastUpdateTimeBuilder_ == null) { + lastUpdateTime_ = builderForValue.build(); + onChanged(); + } else { + lastUpdateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + public Builder mergeLastUpdateTime(com.google.protobuf.Timestamp value) { + if (lastUpdateTimeBuilder_ == null) { + if (lastUpdateTime_ != null) { + lastUpdateTime_ = + com.google.protobuf.Timestamp.newBuilder(lastUpdateTime_).mergeFrom(value).buildPartial(); + } else { + lastUpdateTime_ = value; + } + onChanged(); + } else { + lastUpdateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + public Builder clearLastUpdateTime() { + if (lastUpdateTimeBuilder_ == null) { + lastUpdateTime_ = null; + onChanged(); + } else { + lastUpdateTime_ = null; + lastUpdateTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getLastUpdateTimeBuilder() { + + onChanged(); + return getLastUpdateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { + if (lastUpdateTimeBuilder_ != null) { + return lastUpdateTimeBuilder_.getMessageOrBuilder(); + } else { + return lastUpdateTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : lastUpdateTime_; + } + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getLastUpdateTimeFieldBuilder() { + if (lastUpdateTimeBuilder_ == null) { + lastUpdateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getLastUpdateTime(), + getParentForChildren(), + isClean()); + lastUpdateTime_ = null; + } + return lastUpdateTimeBuilder_; + } + + private java.lang.Object uri_ = ""; + /** + *
+     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+     * as byte content.
+     * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+     * as byte content.
+     * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+     * as byte content.
+     * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+     * as byte content.
+     * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + *
+     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+     * as byte content.
+     * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.LongRunningRecognizeMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.LongRunningRecognizeMetadata) + private static final com.google.cloud.speech.v1.LongRunningRecognizeMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.LongRunningRecognizeMetadata(); + } + + public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LongRunningRecognizeMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LongRunningRecognizeMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.LongRunningRecognizeMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadataOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadataOrBuilder.java new file mode 100644 index 000000000000..ccedbf890615 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadataOrBuilder.java @@ -0,0 +1,96 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface LongRunningRecognizeMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.LongRunningRecognizeMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Approximate percentage of audio processed thus far. Guaranteed to be 100
+   * when the audio is fully processed and the results are available.
+   * 
+ * + * int32 progress_percent = 1; + * @return The progressPercent. + */ + int getProgressPercent(); + + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + *
+   * Time of the most recent processing update.
+   * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + * @return Whether the lastUpdateTime field is set. + */ + boolean hasLastUpdateTime(); + /** + *
+   * Time of the most recent processing update.
+   * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + * @return The lastUpdateTime. + */ + com.google.protobuf.Timestamp getLastUpdateTime(); + /** + *
+   * Time of the most recent processing update.
+   * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder(); + + /** + *
+   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+   * as byte content.
+   * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The uri. + */ + java.lang.String getUri(); + /** + *
+   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+   * as byte content.
+   * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for uri. + */ + com.google.protobuf.ByteString + getUriBytes(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequest.java new file mode 100644 index 000000000000..76f44fd6ea4d --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequest.java @@ -0,0 +1,1151 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * The top-level message sent by the client for the `LongRunningRecognize`
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeRequest} + */ +public final class LongRunningRecognizeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.LongRunningRecognizeRequest) + LongRunningRecognizeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use LongRunningRecognizeRequest.newBuilder() to construct. + private LongRunningRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LongRunningRecognizeRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LongRunningRecognizeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LongRunningRecognizeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.cloud.speech.v1.RecognitionConfig.Builder subBuilder = null; + if (config_ != null) { + subBuilder = config_.toBuilder(); + } + config_ = input.readMessage(com.google.cloud.speech.v1.RecognitionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(config_); + config_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.cloud.speech.v1.RecognitionAudio.Builder subBuilder = null; + if (audio_ != null) { + subBuilder = audio_.toBuilder(); + } + audio_ = input.readMessage(com.google.cloud.speech.v1.RecognitionAudio.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(audio_); + audio_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + com.google.cloud.speech.v1.TranscriptOutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = input.readMessage(com.google.cloud.speech.v1.TranscriptOutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.LongRunningRecognizeRequest.class, com.google.cloud.speech.v1.LongRunningRecognizeRequest.Builder.class); + } + + public static final int CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.speech.v1.RecognitionConfig config_; + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return config_ != null; + } + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionConfig getConfig() { + return config_ == null ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; + } + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { + return getConfig(); + } + + public static final int AUDIO_FIELD_NUMBER = 2; + private com.google.cloud.speech.v1.RecognitionAudio audio_; + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the audio field is set. + */ + @java.lang.Override + public boolean hasAudio() { + return audio_ != null; + } + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The audio. + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionAudio getAudio() { + return audio_ == null ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() : audio_; + } + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder() { + return getAudio(); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.speech.v1.TranscriptOutputConfig outputConfig_; + /** + *
+   * Optional. Specifies an optional destination for the recognition results.
+   * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + *
+   * Optional. Specifies an optional destination for the recognition results.
+   * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig() { + return outputConfig_ == null ? com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } + /** + *
+   * Optional. Specifies an optional destination for the recognition results.
+   * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (config_ != null) { + output.writeMessage(1, getConfig()); + } + if (audio_ != null) { + output.writeMessage(2, getAudio()); + } + if (outputConfig_ != null) { + output.writeMessage(4, getOutputConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (config_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getConfig()); + } + if (audio_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getAudio()); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getOutputConfig()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.LongRunningRecognizeRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.LongRunningRecognizeRequest other = (com.google.cloud.speech.v1.LongRunningRecognizeRequest) obj; + + if (hasConfig() != other.hasConfig()) return false; + if (hasConfig()) { + if (!getConfig() + .equals(other.getConfig())) return false; + } + if (hasAudio() != other.hasAudio()) return false; + if (hasAudio()) { + if (!getAudio() + .equals(other.getAudio())) return false; + } + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig() + .equals(other.getOutputConfig())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + if (hasAudio()) { + hash = (37 * hash) + AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getAudio().hashCode(); + } + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.LongRunningRecognizeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The top-level message sent by the client for the `LongRunningRecognize`
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.LongRunningRecognizeRequest) + com.google.cloud.speech.v1.LongRunningRecognizeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.LongRunningRecognizeRequest.class, com.google.cloud.speech.v1.LongRunningRecognizeRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.LongRunningRecognizeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (configBuilder_ == null) { + config_ = null; + } else { + config_ = null; + configBuilder_ = null; + } + if (audioBuilder_ == null) { + audio_ = null; + } else { + audio_ = null; + audioBuilder_ = null; + } + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.LongRunningRecognizeRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.LongRunningRecognizeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.LongRunningRecognizeRequest build() { + com.google.cloud.speech.v1.LongRunningRecognizeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.LongRunningRecognizeRequest buildPartial() { + com.google.cloud.speech.v1.LongRunningRecognizeRequest result = new com.google.cloud.speech.v1.LongRunningRecognizeRequest(this); + if (configBuilder_ == null) { + result.config_ = config_; + } else { + result.config_ = configBuilder_.build(); + } + if (audioBuilder_ == null) { + result.audio_ = audio_; + } else { + result.audio_ = audioBuilder_.build(); + } + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.LongRunningRecognizeRequest) { + return mergeFrom((com.google.cloud.speech.v1.LongRunningRecognizeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.LongRunningRecognizeRequest other) { + if (other == com.google.cloud.speech.v1.LongRunningRecognizeRequest.getDefaultInstance()) return this; + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + if (other.hasAudio()) { + mergeAudio(other.getAudio()); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.LongRunningRecognizeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.LongRunningRecognizeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.speech.v1.RecognitionConfig config_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder> configBuilder_; + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + public boolean hasConfig() { + return configBuilder_ != null || config_ != null; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + public com.google.cloud.speech.v1.RecognitionConfig getConfig() { + if (configBuilder_ == null) { + return config_ == null ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig(com.google.cloud.speech.v1.RecognitionConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig( + com.google.cloud.speech.v1.RecognitionConfig.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeConfig(com.google.cloud.speech.v1.RecognitionConfig value) { + if (configBuilder_ == null) { + if (config_ != null) { + config_ = + com.google.cloud.speech.v1.RecognitionConfig.newBuilder(config_).mergeFrom(value).buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + configBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + config_ = null; + onChanged(); + } else { + config_ = null; + configBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.RecognitionConfig.Builder getConfigBuilder() { + + onChanged(); + return getConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null ? + com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; + } + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder>( + getConfig(), + getParentForChildren(), + isClean()); + config_ = null; + } + return configBuilder_; + } + + private com.google.cloud.speech.v1.RecognitionAudio audio_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionAudio, com.google.cloud.speech.v1.RecognitionAudio.Builder, com.google.cloud.speech.v1.RecognitionAudioOrBuilder> audioBuilder_; + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the audio field is set. + */ + public boolean hasAudio() { + return audioBuilder_ != null || audio_ != null; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The audio. + */ + public com.google.cloud.speech.v1.RecognitionAudio getAudio() { + if (audioBuilder_ == null) { + return audio_ == null ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() : audio_; + } else { + return audioBuilder_.getMessage(); + } + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setAudio(com.google.cloud.speech.v1.RecognitionAudio value) { + if (audioBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + audio_ = value; + onChanged(); + } else { + audioBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setAudio( + com.google.cloud.speech.v1.RecognitionAudio.Builder builderForValue) { + if (audioBuilder_ == null) { + audio_ = builderForValue.build(); + onChanged(); + } else { + audioBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeAudio(com.google.cloud.speech.v1.RecognitionAudio value) { + if (audioBuilder_ == null) { + if (audio_ != null) { + audio_ = + com.google.cloud.speech.v1.RecognitionAudio.newBuilder(audio_).mergeFrom(value).buildPartial(); + } else { + audio_ = value; + } + onChanged(); + } else { + audioBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearAudio() { + if (audioBuilder_ == null) { + audio_ = null; + onChanged(); + } else { + audio_ = null; + audioBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.RecognitionAudio.Builder getAudioBuilder() { + + onChanged(); + return getAudioFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder() { + if (audioBuilder_ != null) { + return audioBuilder_.getMessageOrBuilder(); + } else { + return audio_ == null ? + com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() : audio_; + } + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionAudio, com.google.cloud.speech.v1.RecognitionAudio.Builder, com.google.cloud.speech.v1.RecognitionAudioOrBuilder> + getAudioFieldBuilder() { + if (audioBuilder_ == null) { + audioBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionAudio, com.google.cloud.speech.v1.RecognitionAudio.Builder, com.google.cloud.speech.v1.RecognitionAudioOrBuilder>( + getAudio(), + getParentForChildren(), + isClean()); + audio_ = null; + } + return audioBuilder_; + } + + private com.google.cloud.speech.v1.TranscriptOutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.TranscriptOutputConfig, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder> outputConfigBuilder_; + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return The outputConfig. + */ + public com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null ? com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setOutputConfig(com.google.cloud.speech.v1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setOutputConfig( + com.google.cloud.speech.v1.TranscriptOutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder mergeOutputConfig(com.google.cloud.speech.v1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.speech.v1.TranscriptOutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.cloud.speech.v1.TranscriptOutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null ? + com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.TranscriptOutputConfig, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.TranscriptOutputConfig, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder>( + getOutputConfig(), + getParentForChildren(), + isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.LongRunningRecognizeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.LongRunningRecognizeRequest) + private static final com.google.cloud.speech.v1.LongRunningRecognizeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.LongRunningRecognizeRequest(); + } + + public static com.google.cloud.speech.v1.LongRunningRecognizeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LongRunningRecognizeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LongRunningRecognizeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.LongRunningRecognizeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequestOrBuilder.java new file mode 100644 index 000000000000..fe890f69a390 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequestOrBuilder.java @@ -0,0 +1,93 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface LongRunningRecognizeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.LongRunningRecognizeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + boolean hasConfig(); + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + com.google.cloud.speech.v1.RecognitionConfig getConfig(); + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder(); + + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the audio field is set. + */ + boolean hasAudio(); + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The audio. + */ + com.google.cloud.speech.v1.RecognitionAudio getAudio(); + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder(); + + /** + *
+   * Optional. Specifies an optional destination for the recognition results.
+   * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + *
+   * Optional. Specifies an optional destination for the recognition results.
+   * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return The outputConfig. + */ + com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig(); + /** + *
+   * Optional. Specifies an optional destination for the recognition results.
+   * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java new file mode 100644 index 000000000000..4a952b510c81 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java @@ -0,0 +1,1611 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * The only message returned to the client by the `LongRunningRecognize` method.
+ * It contains the result as zero or more sequential `SpeechRecognitionResult`
+ * messages. It is included in the `result.response` field of the `Operation`
+ * returned by the `GetOperation` call of the `google::longrunning::Operations`
+ * service.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeResponse} + */ +public final class LongRunningRecognizeResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.LongRunningRecognizeResponse) + LongRunningRecognizeResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use LongRunningRecognizeResponse.newBuilder() to construct. + private LongRunningRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LongRunningRecognizeResponse() { + results_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LongRunningRecognizeResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LongRunningRecognizeResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + results_.add( + input.readMessage(com.google.cloud.speech.v1.SpeechRecognitionResult.parser(), extensionRegistry)); + break; + } + case 26: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (totalBilledTime_ != null) { + subBuilder = totalBilledTime_.toBuilder(); + } + totalBilledTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(totalBilledTime_); + totalBilledTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + com.google.cloud.speech.v1.TranscriptOutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = input.readMessage(com.google.cloud.speech.v1.TranscriptOutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + com.google.rpc.Status.Builder subBuilder = null; + if (outputError_ != null) { + subBuilder = outputError_.toBuilder(); + } + outputError_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputError_); + outputError_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.LongRunningRecognizeResponse.class, com.google.cloud.speech.v1.LongRunningRecognizeResponse.Builder.class); + } + + public static final int RESULTS_FIELD_NUMBER = 2; + private java.util.List results_; + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public java.util.List getResultsList() { + return results_; + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public java.util.List + getResultsOrBuilderList() { + return results_; + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index) { + return results_.get(index); + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( + int index) { + return results_.get(index); + } + + public static final int TOTAL_BILLED_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Duration totalBilledTime_; + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return Whether the totalBilledTime field is set. + */ + @java.lang.Override + public boolean hasTotalBilledTime() { + return totalBilledTime_ != null; + } + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return The totalBilledTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getTotalBilledTime() { + return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { + return getTotalBilledTime(); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 6; + private com.google.cloud.speech.v1.TranscriptOutputConfig outputConfig_; + /** + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig() { + return outputConfig_ == null ? com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } + /** + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + */ + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + public static final int OUTPUT_ERROR_FIELD_NUMBER = 7; + private com.google.rpc.Status outputError_; + /** + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + * @return Whether the outputError field is set. + */ + @java.lang.Override + public boolean hasOutputError() { + return outputError_ != null; + } + /** + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + * @return The outputError. + */ + @java.lang.Override + public com.google.rpc.Status getOutputError() { + return outputError_ == null ? com.google.rpc.Status.getDefaultInstance() : outputError_; + } + /** + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { + return getOutputError(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(2, results_.get(i)); + } + if (totalBilledTime_ != null) { + output.writeMessage(3, getTotalBilledTime()); + } + if (outputConfig_ != null) { + output.writeMessage(6, getOutputConfig()); + } + if (outputError_ != null) { + output.writeMessage(7, getOutputError()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, results_.get(i)); + } + if (totalBilledTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getTotalBilledTime()); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getOutputConfig()); + } + if (outputError_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getOutputError()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.LongRunningRecognizeResponse)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.LongRunningRecognizeResponse other = (com.google.cloud.speech.v1.LongRunningRecognizeResponse) obj; + + if (!getResultsList() + .equals(other.getResultsList())) return false; + if (hasTotalBilledTime() != other.hasTotalBilledTime()) return false; + if (hasTotalBilledTime()) { + if (!getTotalBilledTime() + .equals(other.getTotalBilledTime())) return false; + } + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig() + .equals(other.getOutputConfig())) return false; + } + if (hasOutputError() != other.hasOutputError()) return false; + if (hasOutputError()) { + if (!getOutputError() + .equals(other.getOutputError())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + if (hasTotalBilledTime()) { + hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; + hash = (53 * hash) + getTotalBilledTime().hashCode(); + } + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + if (hasOutputError()) { + hash = (37 * hash) + OUTPUT_ERROR_FIELD_NUMBER; + hash = (53 * hash) + getOutputError().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.LongRunningRecognizeResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The only message returned to the client by the `LongRunningRecognize` method.
+   * It contains the result as zero or more sequential `SpeechRecognitionResult`
+   * messages. It is included in the `result.response` field of the `Operation`
+   * returned by the `GetOperation` call of the `google::longrunning::Operations`
+   * service.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.LongRunningRecognizeResponse) + com.google.cloud.speech.v1.LongRunningRecognizeResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.LongRunningRecognizeResponse.class, com.google.cloud.speech.v1.LongRunningRecognizeResponse.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.LongRunningRecognizeResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resultsBuilder_.clear(); + } + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = null; + } else { + totalBilledTime_ = null; + totalBilledTimeBuilder_ = null; + } + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + if (outputErrorBuilder_ == null) { + outputError_ = null; + } else { + outputError_ = null; + outputErrorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.LongRunningRecognizeResponse getDefaultInstanceForType() { + return com.google.cloud.speech.v1.LongRunningRecognizeResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.LongRunningRecognizeResponse build() { + com.google.cloud.speech.v1.LongRunningRecognizeResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.LongRunningRecognizeResponse buildPartial() { + com.google.cloud.speech.v1.LongRunningRecognizeResponse result = new com.google.cloud.speech.v1.LongRunningRecognizeResponse(this); + int from_bitField0_ = bitField0_; + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + if (totalBilledTimeBuilder_ == null) { + result.totalBilledTime_ = totalBilledTime_; + } else { + result.totalBilledTime_ = totalBilledTimeBuilder_.build(); + } + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + if (outputErrorBuilder_ == null) { + result.outputError_ = outputError_; + } else { + result.outputError_ = outputErrorBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.LongRunningRecognizeResponse) { + return mergeFrom((com.google.cloud.speech.v1.LongRunningRecognizeResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.LongRunningRecognizeResponse other) { + if (other == com.google.cloud.speech.v1.LongRunningRecognizeResponse.getDefaultInstance()) return this; + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResultsFieldBuilder() : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (other.hasTotalBilledTime()) { + mergeTotalBilledTime(other.getTotalBilledTime()); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + if (other.hasOutputError()) { + mergeOutputError(other.getOutputError()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.LongRunningRecognizeResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.LongRunningRecognizeResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List results_ = + java.util.Collections.emptyList(); + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechRecognitionResult, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder> resultsBuilder_; + + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public java.util.List getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder setResults( + int index, com.google.cloud.speech.v1.SpeechRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder setResults( + int index, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder addResults(com.google.cloud.speech.v1.SpeechRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder addResults( + int index, com.google.cloud.speech.v1.SpeechRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder addResults( + com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder addResults( + int index, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder addAllResults( + java.lang.Iterable values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( + int index) { + if (resultsBuilder_ == null) { + return results_.get(index); } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public java.util.List + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder addResultsBuilder() { + return getResultsFieldBuilder().addBuilder( + com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()); + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()); + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechRecognitionResult, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechRecognitionResult, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder>( + results_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private com.google.protobuf.Duration totalBilledTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalBilledTimeBuilder_; + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return Whether the totalBilledTime field is set. + */ + public boolean hasTotalBilledTime() { + return totalBilledTimeBuilder_ != null || totalBilledTime_ != null; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return The totalBilledTime. + */ + public com.google.protobuf.Duration getTotalBilledTime() { + if (totalBilledTimeBuilder_ == null) { + return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } else { + return totalBilledTimeBuilder_.getMessage(); + } + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder setTotalBilledTime(com.google.protobuf.Duration value) { + if (totalBilledTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + totalBilledTime_ = value; + onChanged(); + } else { + totalBilledTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder setTotalBilledTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = builderForValue.build(); + onChanged(); + } else { + totalBilledTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder mergeTotalBilledTime(com.google.protobuf.Duration value) { + if (totalBilledTimeBuilder_ == null) { + if (totalBilledTime_ != null) { + totalBilledTime_ = + com.google.protobuf.Duration.newBuilder(totalBilledTime_).mergeFrom(value).buildPartial(); + } else { + totalBilledTime_ = value; + } + onChanged(); + } else { + totalBilledTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder clearTotalBilledTime() { + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = null; + onChanged(); + } else { + totalBilledTime_ = null; + totalBilledTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public com.google.protobuf.Duration.Builder getTotalBilledTimeBuilder() { + + onChanged(); + return getTotalBilledTimeFieldBuilder().getBuilder(); + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { + if (totalBilledTimeBuilder_ != null) { + return totalBilledTimeBuilder_.getMessageOrBuilder(); + } else { + return totalBilledTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getTotalBilledTimeFieldBuilder() { + if (totalBilledTimeBuilder_ == null) { + totalBilledTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getTotalBilledTime(), + getParentForChildren(), + isClean()); + totalBilledTime_ = null; + } + return totalBilledTimeBuilder_; + } + + private com.google.cloud.speech.v1.TranscriptOutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.TranscriptOutputConfig, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder> outputConfigBuilder_; + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + * @return The outputConfig. + */ + public com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null ? com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + */ + public Builder setOutputConfig(com.google.cloud.speech.v1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + */ + public Builder setOutputConfig( + com.google.cloud.speech.v1.TranscriptOutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + */ + public Builder mergeOutputConfig(com.google.cloud.speech.v1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.speech.v1.TranscriptOutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + */ + public com.google.cloud.speech.v1.TranscriptOutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + */ + public com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null ? + com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.TranscriptOutputConfig, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.TranscriptOutputConfig, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder>( + getOutputConfig(), + getParentForChildren(), + isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + private com.google.rpc.Status outputError_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> outputErrorBuilder_; + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + * @return Whether the outputError field is set. + */ + public boolean hasOutputError() { + return outputErrorBuilder_ != null || outputError_ != null; + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + * @return The outputError. + */ + public com.google.rpc.Status getOutputError() { + if (outputErrorBuilder_ == null) { + return outputError_ == null ? com.google.rpc.Status.getDefaultInstance() : outputError_; + } else { + return outputErrorBuilder_.getMessage(); + } + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public Builder setOutputError(com.google.rpc.Status value) { + if (outputErrorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputError_ = value; + onChanged(); + } else { + outputErrorBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public Builder setOutputError( + com.google.rpc.Status.Builder builderForValue) { + if (outputErrorBuilder_ == null) { + outputError_ = builderForValue.build(); + onChanged(); + } else { + outputErrorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public Builder mergeOutputError(com.google.rpc.Status value) { + if (outputErrorBuilder_ == null) { + if (outputError_ != null) { + outputError_ = + com.google.rpc.Status.newBuilder(outputError_).mergeFrom(value).buildPartial(); + } else { + outputError_ = value; + } + onChanged(); + } else { + outputErrorBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public Builder clearOutputError() { + if (outputErrorBuilder_ == null) { + outputError_ = null; + onChanged(); + } else { + outputError_ = null; + outputErrorBuilder_ = null; + } + + return this; + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public com.google.rpc.Status.Builder getOutputErrorBuilder() { + + onChanged(); + return getOutputErrorFieldBuilder().getBuilder(); + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { + if (outputErrorBuilder_ != null) { + return outputErrorBuilder_.getMessageOrBuilder(); + } else { + return outputError_ == null ? + com.google.rpc.Status.getDefaultInstance() : outputError_; + } + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getOutputErrorFieldBuilder() { + if (outputErrorBuilder_ == null) { + outputErrorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getOutputError(), + getParentForChildren(), + isClean()); + outputError_ = null; + } + return outputErrorBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.LongRunningRecognizeResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.LongRunningRecognizeResponse) + private static final com.google.cloud.speech.v1.LongRunningRecognizeResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.LongRunningRecognizeResponse(); + } + + public static com.google.cloud.speech.v1.LongRunningRecognizeResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LongRunningRecognizeResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LongRunningRecognizeResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.LongRunningRecognizeResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java new file mode 100644 index 000000000000..231d7ae91417 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java @@ -0,0 +1,139 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface LongRunningRecognizeResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.LongRunningRecognizeResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + java.util.List + getResultsList(); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + int getResultsCount(); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + java.util.List + getResultsOrBuilderList(); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( + int index); + + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return Whether the totalBilledTime field is set. + */ + boolean hasTotalBilledTime(); + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return The totalBilledTime. + */ + com.google.protobuf.Duration getTotalBilledTime(); + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); + + /** + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + * @return The outputConfig. + */ + com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig(); + /** + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; + */ + com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder(); + + /** + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + * @return Whether the outputError field is set. + */ + boolean hasOutputError(); + /** + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + * @return The outputError. + */ + com.google.rpc.Status getOutputError(); + /** + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + */ + com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSet.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSet.java new file mode 100644 index 000000000000..0ec604f92928 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSet.java @@ -0,0 +1,1944 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/resource.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Provides "hints" to the speech recognizer to favor specific words and phrases
+ * in the results.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.PhraseSet} + */ +public final class PhraseSet extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.PhraseSet) + PhraseSetOrBuilder { +private static final long serialVersionUID = 0L; + // Use PhraseSet.newBuilder() to construct. + private PhraseSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PhraseSet() { + name_ = ""; + phrases_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PhraseSet(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PhraseSet( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + phrases_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + phrases_.add( + input.readMessage(com.google.cloud.speech.v1.PhraseSet.Phrase.parser(), extensionRegistry)); + break; + } + case 37: { + + boost_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + phrases_ = java.util.Collections.unmodifiableList(phrases_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.PhraseSet.class, com.google.cloud.speech.v1.PhraseSet.Builder.class); + } + + public interface PhraseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.PhraseSet.Phrase) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The phrase itself.
+     * 
+ * + * string value = 1; + * @return The value. + */ + java.lang.String getValue(); + /** + *
+     * The phrase itself.
+     * 
+ * + * string value = 1; + * @return The bytes for value. + */ + com.google.protobuf.ByteString + getValueBytes(); + + /** + *
+     * Hint Boost. Overrides the boost set at the phrase set level.
+     * Positive value will increase the probability that a specific phrase will
+     * be recognized over other similar sounding phrases. The higher the boost,
+     * the higher the chance of false positive recognition as well. Negative
+     * boost will simply be ignored. Though `boost` can accept a wide range of
+     * positive values, most use cases are best served
+     * with values between 0 and 20. We recommend using a binary search approach
+     * to finding the optimal value for your use case. Speech recognition
+     * will skip PhraseSets with a boost value of 0.
+     * 
+ * + * float boost = 2; + * @return The boost. + */ + float getBoost(); + } + /** + *
+   * A phrases containing words and phrase "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also include pre-built or custom classes containing groups
+   * of words that represent common concepts that occur in natural language. For
+   * example, rather than providing a phrase hint for every month of the
+   * year (e.g. "i was born in january", "i was born in febuary", ...), use the
+   * pre-built `$MONTH` class improves the likelihood of correctly transcribing
+   * audio that includes months (e.g. "i was born in $month").
+   * To refer to pre-built classes, use the class' symbol prepended with `$`
+   * e.g. `$MONTH`. To refer to custom classes that were defined inline in the
+   * request, set the class's `custom_class_id` to a string unique to all class
+   * resources and inline classes. Then use the class' id wrapped in $`{...}`
+   * e.g. "${my-months}". To refer to custom classes resources, use the class'
+   * id wrapped in `${}` (e.g. `${my-months}`).
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
+   * `eu` location value.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.PhraseSet.Phrase} + */ + public static final class Phrase extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.PhraseSet.Phrase) + PhraseOrBuilder { + private static final long serialVersionUID = 0L; + // Use Phrase.newBuilder() to construct. + private Phrase(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Phrase() { + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Phrase(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Phrase( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + case 21: { + + boost_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_Phrase_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_Phrase_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.PhraseSet.Phrase.class, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private volatile java.lang.Object value_; + /** + *
+     * The phrase itself.
+     * 
+ * + * string value = 1; + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + *
+     * The phrase itself.
+     * 
+ * + * string value = 1; + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOOST_FIELD_NUMBER = 2; + private float boost_; + /** + *
+     * Hint Boost. Overrides the boost set at the phrase set level.
+     * Positive value will increase the probability that a specific phrase will
+     * be recognized over other similar sounding phrases. The higher the boost,
+     * the higher the chance of false positive recognition as well. Negative
+     * boost will simply be ignored. Though `boost` can accept a wide range of
+     * positive values, most use cases are best served
+     * with values between 0 and 20. We recommend using a binary search approach
+     * to finding the optimal value for your use case. Speech recognition
+     * will skip PhraseSets with a boost value of 0.
+     * 
+ * + * float boost = 2; + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + output.writeFloat(2, boost_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, boost_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.PhraseSet.Phrase)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.PhraseSet.Phrase other = (com.google.cloud.speech.v1.PhraseSet.Phrase) obj; + + if (!getValue() + .equals(other.getValue())) return false; + if (java.lang.Float.floatToIntBits(getBoost()) + != java.lang.Float.floatToIntBits( + other.getBoost())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (37 * hash) + BOOST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getBoost()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.PhraseSet.Phrase parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.PhraseSet.Phrase parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.PhraseSet.Phrase prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * A phrases containing words and phrase "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also include pre-built or custom classes containing groups
+     * of words that represent common concepts that occur in natural language. For
+     * example, rather than providing a phrase hint for every month of the
+     * year (e.g. "i was born in january", "i was born in febuary", ...), use the
+     * pre-built `$MONTH` class improves the likelihood of correctly transcribing
+     * audio that includes months (e.g. "i was born in $month").
+     * To refer to pre-built classes, use the class' symbol prepended with `$`
+     * e.g. `$MONTH`. To refer to custom classes that were defined inline in the
+     * request, set the class's `custom_class_id` to a string unique to all class
+     * resources and inline classes. Then use the class' id wrapped in $`{...}`
+     * e.g. "${my-months}". To refer to custom classes resources, use the class'
+     * id wrapped in `${}` (e.g. `${my-months}`).
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
+     * `eu` location value.
+     * 
+ * + * Protobuf type {@code google.cloud.speech.v1.PhraseSet.Phrase} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.PhraseSet.Phrase) + com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_Phrase_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_Phrase_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.PhraseSet.Phrase.class, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.PhraseSet.Phrase.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + value_ = ""; + + boost_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_Phrase_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet.Phrase getDefaultInstanceForType() { + return com.google.cloud.speech.v1.PhraseSet.Phrase.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet.Phrase build() { + com.google.cloud.speech.v1.PhraseSet.Phrase result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet.Phrase buildPartial() { + com.google.cloud.speech.v1.PhraseSet.Phrase result = new com.google.cloud.speech.v1.PhraseSet.Phrase(this); + result.value_ = value_; + result.boost_ = boost_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.PhraseSet.Phrase) { + return mergeFrom((com.google.cloud.speech.v1.PhraseSet.Phrase)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.PhraseSet.Phrase other) { + if (other == com.google.cloud.speech.v1.PhraseSet.Phrase.getDefaultInstance()) return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.PhraseSet.Phrase parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.PhraseSet.Phrase) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object value_ = ""; + /** + *
+       * The phrase itself.
+       * 
+ * + * string value = 1; + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The phrase itself.
+       * 
+ * + * string value = 1; + * @return The bytes for value. + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The phrase itself.
+       * 
+ * + * string value = 1; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + *
+       * The phrase itself.
+       * 
+ * + * string value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + *
+       * The phrase itself.
+       * 
+ * + * string value = 1; + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + + private float boost_ ; + /** + *
+       * Hint Boost. Overrides the boost set at the phrase set level.
+       * Positive value will increase the probability that a specific phrase will
+       * be recognized over other similar sounding phrases. The higher the boost,
+       * the higher the chance of false positive recognition as well. Negative
+       * boost will simply be ignored. Though `boost` can accept a wide range of
+       * positive values, most use cases are best served
+       * with values between 0 and 20. We recommend using a binary search approach
+       * to finding the optimal value for your use case. Speech recognition
+       * will skip PhraseSets with a boost value of 0.
+       * 
+ * + * float boost = 2; + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + /** + *
+       * Hint Boost. Overrides the boost set at the phrase set level.
+       * Positive value will increase the probability that a specific phrase will
+       * be recognized over other similar sounding phrases. The higher the boost,
+       * the higher the chance of false positive recognition as well. Negative
+       * boost will simply be ignored. Though `boost` can accept a wide range of
+       * positive values, most use cases are best served
+       * with values between 0 and 20. We recommend using a binary search approach
+       * to finding the optimal value for your use case. Speech recognition
+       * will skip PhraseSets with a boost value of 0.
+       * 
+ * + * float boost = 2; + * @param value The boost to set. + * @return This builder for chaining. + */ + public Builder setBoost(float value) { + + boost_ = value; + onChanged(); + return this; + } + /** + *
+       * Hint Boost. Overrides the boost set at the phrase set level.
+       * Positive value will increase the probability that a specific phrase will
+       * be recognized over other similar sounding phrases. The higher the boost,
+       * the higher the chance of false positive recognition as well. Negative
+       * boost will simply be ignored. Though `boost` can accept a wide range of
+       * positive values, most use cases are best served
+       * with values between 0 and 20. We recommend using a binary search approach
+       * to finding the optimal value for your use case. Speech recognition
+       * will skip PhraseSets with a boost value of 0.
+       * 
+ * + * float boost = 2; + * @return This builder for chaining. + */ + public Builder clearBoost() { + + boost_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.PhraseSet.Phrase) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.PhraseSet.Phrase) + private static final com.google.cloud.speech.v1.PhraseSet.Phrase DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.PhraseSet.Phrase(); + } + + public static com.google.cloud.speech.v1.PhraseSet.Phrase getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Phrase parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Phrase(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet.Phrase getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the phrase set.
+   * 
+ * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The resource name of the phrase set.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PHRASES_FIELD_NUMBER = 2; + private java.util.List phrases_; + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + @java.lang.Override + public java.util.List getPhrasesList() { + return phrases_; + } + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + @java.lang.Override + public java.util.List + getPhrasesOrBuilderList() { + return phrases_; + } + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + @java.lang.Override + public int getPhrasesCount() { + return phrases_.size(); + } + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet.Phrase getPhrases(int index) { + return phrases_.get(index); + } + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( + int index) { + return phrases_.get(index); + } + + public static final int BOOST_FIELD_NUMBER = 4; + private float boost_; + /** + *
+   * Hint Boost. Positive value will increase the probability that a specific
+   * phrase will be recognized over other similar sounding phrases. The higher
+   * the boost, the higher the chance of false positive recognition as well.
+   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+   * enabled, so negative boost will simply be ignored. Though `boost` can
+   * accept a wide range of positive values, most use cases are best served with
+   * values between 0 (exclusive) and 20. We recommend using a binary search
+   * approach to finding the optimal value for your use case. Speech recognition
+   * will skip PhraseSets with a boost value of 0.
+   * 
+ * + * float boost = 4; + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < phrases_.size(); i++) { + output.writeMessage(2, phrases_.get(i)); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + output.writeFloat(4, boost_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < phrases_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, phrases_.get(i)); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, boost_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.PhraseSet)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.PhraseSet other = (com.google.cloud.speech.v1.PhraseSet) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getPhrasesList() + .equals(other.getPhrasesList())) return false; + if (java.lang.Float.floatToIntBits(getBoost()) + != java.lang.Float.floatToIntBits( + other.getBoost())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getPhrasesCount() > 0) { + hash = (37 * hash) + PHRASES_FIELD_NUMBER; + hash = (53 * hash) + getPhrasesList().hashCode(); + } + hash = (37 * hash) + BOOST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getBoost()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.PhraseSet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.PhraseSet parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.PhraseSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.PhraseSet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.PhraseSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.PhraseSet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.PhraseSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.PhraseSet parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.PhraseSet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.PhraseSet parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.PhraseSet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.PhraseSet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.PhraseSet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Provides "hints" to the speech recognizer to favor specific words and phrases
+   * in the results.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.PhraseSet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.PhraseSet) + com.google.cloud.speech.v1.PhraseSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.PhraseSet.class, com.google.cloud.speech.v1.PhraseSet.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.PhraseSet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPhrasesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (phrasesBuilder_ == null) { + phrases_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + phrasesBuilder_.clear(); + } + boost_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet getDefaultInstanceForType() { + return com.google.cloud.speech.v1.PhraseSet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet build() { + com.google.cloud.speech.v1.PhraseSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet buildPartial() { + com.google.cloud.speech.v1.PhraseSet result = new com.google.cloud.speech.v1.PhraseSet(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (phrasesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + phrases_ = java.util.Collections.unmodifiableList(phrases_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.phrases_ = phrases_; + } else { + result.phrases_ = phrasesBuilder_.build(); + } + result.boost_ = boost_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.PhraseSet) { + return mergeFrom((com.google.cloud.speech.v1.PhraseSet)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.PhraseSet other) { + if (other == com.google.cloud.speech.v1.PhraseSet.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (phrasesBuilder_ == null) { + if (!other.phrases_.isEmpty()) { + if (phrases_.isEmpty()) { + phrases_ = other.phrases_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePhrasesIsMutable(); + phrases_.addAll(other.phrases_); + } + onChanged(); + } + } else { + if (!other.phrases_.isEmpty()) { + if (phrasesBuilder_.isEmpty()) { + phrasesBuilder_.dispose(); + phrasesBuilder_ = null; + phrases_ = other.phrases_; + bitField0_ = (bitField0_ & ~0x00000001); + phrasesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPhrasesFieldBuilder() : null; + } else { + phrasesBuilder_.addAllMessages(other.phrases_); + } + } + } + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.PhraseSet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.PhraseSet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the phrase set.
+     * 
+ * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name of the phrase set.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name of the phrase set.
+     * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name of the phrase set.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the phrase set.
+     * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.util.List phrases_ = + java.util.Collections.emptyList(); + private void ensurePhrasesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + phrases_ = new java.util.ArrayList(phrases_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet.Phrase, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder, com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder> phrasesBuilder_; + + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public java.util.List getPhrasesList() { + if (phrasesBuilder_ == null) { + return java.util.Collections.unmodifiableList(phrases_); + } else { + return phrasesBuilder_.getMessageList(); + } + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public int getPhrasesCount() { + if (phrasesBuilder_ == null) { + return phrases_.size(); + } else { + return phrasesBuilder_.getCount(); + } + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public com.google.cloud.speech.v1.PhraseSet.Phrase getPhrases(int index) { + if (phrasesBuilder_ == null) { + return phrases_.get(index); + } else { + return phrasesBuilder_.getMessage(index); + } + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public Builder setPhrases( + int index, com.google.cloud.speech.v1.PhraseSet.Phrase value) { + if (phrasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhrasesIsMutable(); + phrases_.set(index, value); + onChanged(); + } else { + phrasesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public Builder setPhrases( + int index, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder builderForValue) { + if (phrasesBuilder_ == null) { + ensurePhrasesIsMutable(); + phrases_.set(index, builderForValue.build()); + onChanged(); + } else { + phrasesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public Builder addPhrases(com.google.cloud.speech.v1.PhraseSet.Phrase value) { + if (phrasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhrasesIsMutable(); + phrases_.add(value); + onChanged(); + } else { + phrasesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public Builder addPhrases( + int index, com.google.cloud.speech.v1.PhraseSet.Phrase value) { + if (phrasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhrasesIsMutable(); + phrases_.add(index, value); + onChanged(); + } else { + phrasesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public Builder addPhrases( + com.google.cloud.speech.v1.PhraseSet.Phrase.Builder builderForValue) { + if (phrasesBuilder_ == null) { + ensurePhrasesIsMutable(); + phrases_.add(builderForValue.build()); + onChanged(); + } else { + phrasesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public Builder addPhrases( + int index, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder builderForValue) { + if (phrasesBuilder_ == null) { + ensurePhrasesIsMutable(); + phrases_.add(index, builderForValue.build()); + onChanged(); + } else { + phrasesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public Builder addAllPhrases( + java.lang.Iterable values) { + if (phrasesBuilder_ == null) { + ensurePhrasesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, phrases_); + onChanged(); + } else { + phrasesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public Builder clearPhrases() { + if (phrasesBuilder_ == null) { + phrases_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + phrasesBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public Builder removePhrases(int index) { + if (phrasesBuilder_ == null) { + ensurePhrasesIsMutable(); + phrases_.remove(index); + onChanged(); + } else { + phrasesBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public com.google.cloud.speech.v1.PhraseSet.Phrase.Builder getPhrasesBuilder( + int index) { + return getPhrasesFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( + int index) { + if (phrasesBuilder_ == null) { + return phrases_.get(index); } else { + return phrasesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public java.util.List + getPhrasesOrBuilderList() { + if (phrasesBuilder_ != null) { + return phrasesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(phrases_); + } + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public com.google.cloud.speech.v1.PhraseSet.Phrase.Builder addPhrasesBuilder() { + return getPhrasesFieldBuilder().addBuilder( + com.google.cloud.speech.v1.PhraseSet.Phrase.getDefaultInstance()); + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public com.google.cloud.speech.v1.PhraseSet.Phrase.Builder addPhrasesBuilder( + int index) { + return getPhrasesFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.PhraseSet.Phrase.getDefaultInstance()); + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + public java.util.List + getPhrasesBuilderList() { + return getPhrasesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet.Phrase, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder, com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder> + getPhrasesFieldBuilder() { + if (phrasesBuilder_ == null) { + phrasesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet.Phrase, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder, com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder>( + phrases_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + phrases_ = null; + } + return phrasesBuilder_; + } + + private float boost_ ; + /** + *
+     * Hint Boost. Positive value will increase the probability that a specific
+     * phrase will be recognized over other similar sounding phrases. The higher
+     * the boost, the higher the chance of false positive recognition as well.
+     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+     * enabled, so negative boost will simply be ignored. Though `boost` can
+     * accept a wide range of positive values, most use cases are best served with
+     * values between 0 (exclusive) and 20. We recommend using a binary search
+     * approach to finding the optimal value for your use case. Speech recognition
+     * will skip PhraseSets with a boost value of 0.
+     * 
+ * + * float boost = 4; + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + /** + *
+     * Hint Boost. Positive value will increase the probability that a specific
+     * phrase will be recognized over other similar sounding phrases. The higher
+     * the boost, the higher the chance of false positive recognition as well.
+     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+     * enabled, so negative boost will simply be ignored. Though `boost` can
+     * accept a wide range of positive values, most use cases are best served with
+     * values between 0 (exclusive) and 20. We recommend using a binary search
+     * approach to finding the optimal value for your use case. Speech recognition
+     * will skip PhraseSets with a boost value of 0.
+     * 
+ * + * float boost = 4; + * @param value The boost to set. + * @return This builder for chaining. + */ + public Builder setBoost(float value) { + + boost_ = value; + onChanged(); + return this; + } + /** + *
+     * Hint Boost. Positive value will increase the probability that a specific
+     * phrase will be recognized over other similar sounding phrases. The higher
+     * the boost, the higher the chance of false positive recognition as well.
+     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+     * enabled, so negative boost will simply be ignored. Though `boost` can
+     * accept a wide range of positive values, most use cases are best served with
+     * values between 0 (exclusive) and 20. We recommend using a binary search
+     * approach to finding the optimal value for your use case. Speech recognition
+     * will skip PhraseSets with a boost value of 0.
+     * 
+ * + * float boost = 4; + * @return This builder for chaining. + */ + public Builder clearBoost() { + + boost_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.PhraseSet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.PhraseSet) + private static final com.google.cloud.speech.v1.PhraseSet DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.PhraseSet(); + } + + public static com.google.cloud.speech.v1.PhraseSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PhraseSet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PhraseSet(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetName.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetName.java new file mode 100644 index 000000000000..99a8feeee073 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetName.java @@ -0,0 +1,223 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class PhraseSetName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_PHRASE_SET = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/phraseSets/{phrase_set}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String phraseSet; + + @Deprecated + protected PhraseSetName() { + project = null; + location = null; + phraseSet = null; + } + + private PhraseSetName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + phraseSet = Preconditions.checkNotNull(builder.getPhraseSet()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPhraseSet() { + return phraseSet; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PhraseSetName of(String project, String location, String phraseSet) { + return newBuilder().setProject(project).setLocation(location).setPhraseSet(phraseSet).build(); + } + + public static String format(String project, String location, String phraseSet) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setPhraseSet(phraseSet) + .build() + .toString(); + } + + public static PhraseSetName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_PHRASE_SET.validatedMatch( + formattedString, "PhraseSetName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("phrase_set")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (PhraseSetName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_PHRASE_SET.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (phraseSet != null) { + fieldMapBuilder.put("phrase_set", phraseSet); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_PHRASE_SET.instantiate( + "project", project, "location", location, "phrase_set", phraseSet); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + PhraseSetName that = ((PhraseSetName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.phraseSet, that.phraseSet); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(phraseSet); + return h; + } + + /** Builder for projects/{project}/locations/{location}/phraseSets/{phrase_set}. */ + public static class Builder { + private String project; + private String location; + private String phraseSet; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPhraseSet() { + return phraseSet; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setPhraseSet(String phraseSet) { + this.phraseSet = phraseSet; + return this; + } + + private Builder(PhraseSetName phraseSetName) { + this.project = phraseSetName.project; + this.location = phraseSetName.location; + this.phraseSet = phraseSetName.phraseSet; + } + + public PhraseSetName build() { + return new PhraseSetName(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetOrBuilder.java new file mode 100644 index 000000000000..c57c3c5d692d --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetOrBuilder.java @@ -0,0 +1,91 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/resource.proto + +package com.google.cloud.speech.v1; + +public interface PhraseSetOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.PhraseSet) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the phrase set.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the phrase set.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + java.util.List + getPhrasesList(); + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + com.google.cloud.speech.v1.PhraseSet.Phrase getPhrases(int index); + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + int getPhrasesCount(); + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + java.util.List + getPhrasesOrBuilderList(); + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; + */ + com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( + int index); + + /** + *
+   * Hint Boost. Positive value will increase the probability that a specific
+   * phrase will be recognized over other similar sounding phrases. The higher
+   * the boost, the higher the chance of false positive recognition as well.
+   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+   * enabled, so negative boost will simply be ignored. Though `boost` can
+   * accept a wide range of positive values, most use cases are best served with
+   * values between 0 (exclusive) and 20. We recommend using a binary search
+   * approach to finding the optimal value for your use case. Speech recognition
+   * will skip PhraseSets with a boost value of 0.
+   * 
+ * + * float boost = 4; + * @return The boost. + */ + float getBoost(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudio.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudio.java new file mode 100644 index 000000000000..13a01ffc4a4e --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudio.java @@ -0,0 +1,906 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Contains audio data in the encoding specified in the `RecognitionConfig`.
+ * Either `content` or `uri` must be supplied. Supplying both or neither
+ * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
+ * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.RecognitionAudio} + */ +public final class RecognitionAudio extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognitionAudio) + RecognitionAudioOrBuilder { +private static final long serialVersionUID = 0L; + // Use RecognitionAudio.newBuilder() to construct. + private RecognitionAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RecognitionAudio() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RecognitionAudio(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RecognitionAudio( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + audioSource_ = input.readBytes(); + audioSourceCase_ = 1; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + audioSourceCase_ = 2; + audioSource_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionAudio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionAudio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.RecognitionAudio.class, com.google.cloud.speech.v1.RecognitionAudio.Builder.class); + } + + private int audioSourceCase_ = 0; + private java.lang.Object audioSource_; + public enum AudioSourceCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CONTENT(1), + URI(2), + AUDIOSOURCE_NOT_SET(0); + private final int value; + private AudioSourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AudioSourceCase valueOf(int value) { + return forNumber(value); + } + + public static AudioSourceCase forNumber(int value) { + switch (value) { + case 1: return CONTENT; + case 2: return URI; + case 0: return AUDIOSOURCE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public AudioSourceCase + getAudioSourceCase() { + return AudioSourceCase.forNumber( + audioSourceCase_); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + /** + *
+   * The audio data bytes encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation, whereas JSON representations use base64.
+   * 
+ * + * bytes content = 1; + * @return Whether the content field is set. + */ + @java.lang.Override + public boolean hasContent() { + return audioSourceCase_ == 1; + } + /** + *
+   * The audio data bytes encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation, whereas JSON representations use base64.
+   * 
+ * + * bytes content = 1; + * @return The content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContent() { + if (audioSourceCase_ == 1) { + return (com.google.protobuf.ByteString) audioSource_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int URI_FIELD_NUMBER = 2; + /** + *
+   * URI that points to a file that contains audio data bytes as specified in
+   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+   * Currently, only Google Cloud Storage URIs are
+   * supported, which must be specified in the following format:
+   * `gs://bucket_name/object_name` (other URI formats return
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+   * 
+ * + * string uri = 2; + * @return Whether the uri field is set. + */ + public boolean hasUri() { + return audioSourceCase_ == 2; + } + /** + *
+   * URI that points to a file that contains audio data bytes as specified in
+   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+   * Currently, only Google Cloud Storage URIs are
+   * supported, which must be specified in the following format:
+   * `gs://bucket_name/object_name` (other URI formats return
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+   * 
+ * + * string uri = 2; + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (audioSourceCase_ == 2) { + ref = audioSource_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (audioSourceCase_ == 2) { + audioSource_ = s; + } + return s; + } + } + /** + *
+   * URI that points to a file that contains audio data bytes as specified in
+   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+   * Currently, only Google Cloud Storage URIs are
+   * supported, which must be specified in the following format:
+   * `gs://bucket_name/object_name` (other URI formats return
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+   * 
+ * + * string uri = 2; + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = ""; + if (audioSourceCase_ == 2) { + ref = audioSource_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (audioSourceCase_ == 2) { + audioSource_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (audioSourceCase_ == 1) { + output.writeBytes( + 1, (com.google.protobuf.ByteString) audioSource_); + } + if (audioSourceCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, audioSource_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (audioSourceCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 1, (com.google.protobuf.ByteString) audioSource_); + } + if (audioSourceCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, audioSource_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.RecognitionAudio)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.RecognitionAudio other = (com.google.cloud.speech.v1.RecognitionAudio) obj; + + if (!getAudioSourceCase().equals(other.getAudioSourceCase())) return false; + switch (audioSourceCase_) { + case 1: + if (!getContent() + .equals(other.getContent())) return false; + break; + case 2: + if (!getUri() + .equals(other.getUri())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (audioSourceCase_) { + case 1: + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + break; + case 2: + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionAudio parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionAudio parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionAudio parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognitionAudio parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.RecognitionAudio prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Contains audio data in the encoding specified in the `RecognitionConfig`.
+   * Either `content` or `uri` must be supplied. Supplying both or neither
+   * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
+   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.RecognitionAudio} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognitionAudio) + com.google.cloud.speech.v1.RecognitionAudioOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionAudio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionAudio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.RecognitionAudio.class, com.google.cloud.speech.v1.RecognitionAudio.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.RecognitionAudio.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + audioSourceCase_ = 0; + audioSource_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionAudio_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionAudio getDefaultInstanceForType() { + return com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionAudio build() { + com.google.cloud.speech.v1.RecognitionAudio result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionAudio buildPartial() { + com.google.cloud.speech.v1.RecognitionAudio result = new com.google.cloud.speech.v1.RecognitionAudio(this); + if (audioSourceCase_ == 1) { + result.audioSource_ = audioSource_; + } + if (audioSourceCase_ == 2) { + result.audioSource_ = audioSource_; + } + result.audioSourceCase_ = audioSourceCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.RecognitionAudio) { + return mergeFrom((com.google.cloud.speech.v1.RecognitionAudio)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.RecognitionAudio other) { + if (other == com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance()) return this; + switch (other.getAudioSourceCase()) { + case CONTENT: { + setContent(other.getContent()); + break; + } + case URI: { + audioSourceCase_ = 2; + audioSource_ = other.audioSource_; + onChanged(); + break; + } + case AUDIOSOURCE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.RecognitionAudio parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.RecognitionAudio) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int audioSourceCase_ = 0; + private java.lang.Object audioSource_; + public AudioSourceCase + getAudioSourceCase() { + return AudioSourceCase.forNumber( + audioSourceCase_); + } + + public Builder clearAudioSource() { + audioSourceCase_ = 0; + audioSource_ = null; + onChanged(); + return this; + } + + + /** + *
+     * The audio data bytes encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation, whereas JSON representations use base64.
+     * 
+ * + * bytes content = 1; + * @return Whether the content field is set. + */ + public boolean hasContent() { + return audioSourceCase_ == 1; + } + /** + *
+     * The audio data bytes encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation, whereas JSON representations use base64.
+     * 
+ * + * bytes content = 1; + * @return The content. + */ + public com.google.protobuf.ByteString getContent() { + if (audioSourceCase_ == 1) { + return (com.google.protobuf.ByteString) audioSource_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
+     * The audio data bytes encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation, whereas JSON representations use base64.
+     * 
+ * + * bytes content = 1; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + audioSourceCase_ = 1; + audioSource_ = value; + onChanged(); + return this; + } + /** + *
+     * The audio data bytes encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation, whereas JSON representations use base64.
+     * 
+ * + * bytes content = 1; + * @return This builder for chaining. + */ + public Builder clearContent() { + if (audioSourceCase_ == 1) { + audioSourceCase_ = 0; + audioSource_ = null; + onChanged(); + } + return this; + } + + /** + *
+     * URI that points to a file that contains audio data bytes as specified in
+     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+     * Currently, only Google Cloud Storage URIs are
+     * supported, which must be specified in the following format:
+     * `gs://bucket_name/object_name` (other URI formats return
+     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+     * 
+ * + * string uri = 2; + * @return Whether the uri field is set. + */ + @java.lang.Override + public boolean hasUri() { + return audioSourceCase_ == 2; + } + /** + *
+     * URI that points to a file that contains audio data bytes as specified in
+     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+     * Currently, only Google Cloud Storage URIs are
+     * supported, which must be specified in the following format:
+     * `gs://bucket_name/object_name` (other URI formats return
+     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+     * 
+ * + * string uri = 2; + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (audioSourceCase_ == 2) { + ref = audioSource_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (audioSourceCase_ == 2) { + audioSource_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * URI that points to a file that contains audio data bytes as specified in
+     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+     * Currently, only Google Cloud Storage URIs are
+     * supported, which must be specified in the following format:
+     * `gs://bucket_name/object_name` (other URI formats return
+     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+     * 
+ * + * string uri = 2; + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = ""; + if (audioSourceCase_ == 2) { + ref = audioSource_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (audioSourceCase_ == 2) { + audioSource_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * URI that points to a file that contains audio data bytes as specified in
+     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+     * Currently, only Google Cloud Storage URIs are
+     * supported, which must be specified in the following format:
+     * `gs://bucket_name/object_name` (other URI formats return
+     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+     * 
+ * + * string uri = 2; + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + audioSourceCase_ = 2; + audioSource_ = value; + onChanged(); + return this; + } + /** + *
+     * URI that points to a file that contains audio data bytes as specified in
+     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+     * Currently, only Google Cloud Storage URIs are
+     * supported, which must be specified in the following format:
+     * `gs://bucket_name/object_name` (other URI formats return
+     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+     * 
+ * + * string uri = 2; + * @return This builder for chaining. + */ + public Builder clearUri() { + if (audioSourceCase_ == 2) { + audioSourceCase_ = 0; + audioSource_ = null; + onChanged(); + } + return this; + } + /** + *
+     * URI that points to a file that contains audio data bytes as specified in
+     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+     * Currently, only Google Cloud Storage URIs are
+     * supported, which must be specified in the following format:
+     * `gs://bucket_name/object_name` (other URI formats return
+     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+     * 
+ * + * string uri = 2; + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + audioSourceCase_ = 2; + audioSource_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.RecognitionAudio) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionAudio) + private static final com.google.cloud.speech.v1.RecognitionAudio DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognitionAudio(); + } + + public static com.google.cloud.speech.v1.RecognitionAudio getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecognitionAudio parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecognitionAudio(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionAudio getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudioOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudioOrBuilder.java new file mode 100644 index 000000000000..4347fb6f5a58 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudioOrBuilder.java @@ -0,0 +1,81 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface RecognitionAudioOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognitionAudio) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The audio data bytes encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation, whereas JSON representations use base64.
+   * 
+ * + * bytes content = 1; + * @return Whether the content field is set. + */ + boolean hasContent(); + /** + *
+   * The audio data bytes encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation, whereas JSON representations use base64.
+   * 
+ * + * bytes content = 1; + * @return The content. + */ + com.google.protobuf.ByteString getContent(); + + /** + *
+   * URI that points to a file that contains audio data bytes as specified in
+   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+   * Currently, only Google Cloud Storage URIs are
+   * supported, which must be specified in the following format:
+   * `gs://bucket_name/object_name` (other URI formats return
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+   * 
+ * + * string uri = 2; + * @return Whether the uri field is set. + */ + boolean hasUri(); + /** + *
+   * URI that points to a file that contains audio data bytes as specified in
+   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+   * Currently, only Google Cloud Storage URIs are
+   * supported, which must be specified in the following format:
+   * `gs://bucket_name/object_name` (other URI formats return
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+   * 
+ * + * string uri = 2; + * @return The uri. + */ + java.lang.String getUri(); + /** + *
+   * URI that points to a file that contains audio data bytes as specified in
+   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+   * Currently, only Google Cloud Storage URIs are
+   * supported, which must be specified in the following format:
+   * `gs://bucket_name/object_name` (other URI formats return
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+   * 
+ * + * string uri = 2; + * @return The bytes for uri. + */ + com.google.protobuf.ByteString + getUriBytes(); + + public com.google.cloud.speech.v1.RecognitionAudio.AudioSourceCase getAudioSourceCase(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java new file mode 100644 index 000000000000..46cadf00f3e3 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java @@ -0,0 +1,4838 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Provides information to the recognizer that specifies how to process the
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.RecognitionConfig} + */ +public final class RecognitionConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognitionConfig) + RecognitionConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use RecognitionConfig.newBuilder() to construct. + private RecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RecognitionConfig() { + encoding_ = 0; + languageCode_ = ""; + alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + speechContexts_ = java.util.Collections.emptyList(); + model_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RecognitionConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RecognitionConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + encoding_ = rawValue; + break; + } + case 16: { + + sampleRateHertz_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + case 32: { + + maxAlternatives_ = input.readInt32(); + break; + } + case 40: { + + profanityFilter_ = input.readBool(); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + speechContexts_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + speechContexts_.add( + input.readMessage(com.google.cloud.speech.v1.SpeechContext.parser(), extensionRegistry)); + break; + } + case 56: { + + audioChannelCount_ = input.readInt32(); + break; + } + case 64: { + + enableWordTimeOffsets_ = input.readBool(); + break; + } + case 74: { + com.google.cloud.speech.v1.RecognitionMetadata.Builder subBuilder = null; + if (metadata_ != null) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = input.readMessage(com.google.cloud.speech.v1.RecognitionMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + + break; + } + case 88: { + + enableAutomaticPunctuation_ = input.readBool(); + break; + } + case 96: { + + enableSeparateRecognitionPerChannel_ = input.readBool(); + break; + } + case 106: { + java.lang.String s = input.readStringRequireUtf8(); + + model_ = s; + break; + } + case 112: { + + useEnhanced_ = input.readBool(); + break; + } + case 120: { + + enableWordConfidence_ = input.readBool(); + break; + } + case 146: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + alternativeLanguageCodes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + alternativeLanguageCodes_.add(s); + break; + } + case 154: { + com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder subBuilder = null; + if (diarizationConfig_ != null) { + subBuilder = diarizationConfig_.toBuilder(); + } + diarizationConfig_ = input.readMessage(com.google.cloud.speech.v1.SpeakerDiarizationConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(diarizationConfig_); + diarizationConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 162: { + com.google.cloud.speech.v1.SpeechAdaptation.Builder subBuilder = null; + if (adaptation_ != null) { + subBuilder = adaptation_.toBuilder(); + } + adaptation_ = input.readMessage(com.google.cloud.speech.v1.SpeechAdaptation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(adaptation_); + adaptation_ = subBuilder.buildPartial(); + } + + break; + } + case 178: { + com.google.protobuf.BoolValue.Builder subBuilder = null; + if (enableSpokenPunctuation_ != null) { + subBuilder = enableSpokenPunctuation_.toBuilder(); + } + enableSpokenPunctuation_ = input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(enableSpokenPunctuation_); + enableSpokenPunctuation_ = subBuilder.buildPartial(); + } + + break; + } + case 186: { + com.google.protobuf.BoolValue.Builder subBuilder = null; + if (enableSpokenEmojis_ != null) { + subBuilder = enableSpokenEmojis_.toBuilder(); + } + enableSpokenEmojis_ = input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(enableSpokenEmojis_); + enableSpokenEmojis_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); + } + if (((mutable_bitField0_ & 0x00000001) != 0)) { + alternativeLanguageCodes_ = alternativeLanguageCodes_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.RecognitionConfig.class, com.google.cloud.speech.v1.RecognitionConfig.Builder.class); + } + + /** + *
+   * The encoding of the audio data sent in the request.
+   * All encodings support only 1 channel (mono) audio, unless the
+   * `audio_channel_count` and `enable_separate_recognition_per_channel` fields
+   * are set.
+   * For best results, the audio source should be captured and transmitted using
+   * a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
+   * recognition can be reduced if lossy codecs are used to capture or transmit
+   * audio, particularly if background noise is present. Lossy codecs include
+   * `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`,
+   * and `WEBM_OPUS`.
+   * The `FLAC` and `WAV` audio file formats include a header that describes the
+   * included audio content. You can request recognition for `WAV` files that
+   * contain either `LINEAR16` or `MULAW` encoded audio.
+   * If you send `FLAC` or `WAV` audio file format in
+   * your request, you do not need to specify an `AudioEncoding`; the audio
+   * encoding format is determined from the file header. If you specify
+   * an `AudioEncoding` when you send  send `FLAC` or `WAV` audio, the
+   * encoding configuration must match the encoding described in the audio
+   * header; otherwise the request returns an
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code.
+   * 
+ * + * Protobuf enum {@code google.cloud.speech.v1.RecognitionConfig.AudioEncoding} + */ + public enum AudioEncoding + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Not specified.
+     * 
+ * + * ENCODING_UNSPECIFIED = 0; + */ + ENCODING_UNSPECIFIED(0), + /** + *
+     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
+     * 
+ * + * LINEAR16 = 1; + */ + LINEAR16(1), + /** + *
+     * `FLAC` (Free Lossless Audio
+     * Codec) is the recommended encoding because it is
+     * lossless--therefore recognition is not compromised--and
+     * requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
+     * encoding supports 16-bit and 24-bit samples, however, not all fields in
+     * `STREAMINFO` are supported.
+     * 
+ * + * FLAC = 2; + */ + FLAC(2), + /** + *
+     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
+     * 
+ * + * MULAW = 3; + */ + MULAW(3), + /** + *
+     * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
+     * 
+ * + * AMR = 4; + */ + AMR(4), + /** + *
+     * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
+     * 
+ * + * AMR_WB = 5; + */ + AMR_WB(5), + /** + *
+     * Opus encoded audio frames in Ogg container
+     * ([OggOpus](https://wiki.xiph.org/OggOpus)).
+     * `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
+     * 
+ * + * OGG_OPUS = 6; + */ + OGG_OPUS(6), + /** + *
+     * Although the use of lossy encodings is not recommended, if a very low
+     * bitrate encoding is required, `OGG_OPUS` is highly preferred over
+     * Speex encoding. The [Speex](https://speex.org/)  encoding supported by
+     * Cloud Speech API has a header byte in each block, as in MIME type
+     * `audio/x-speex-with-header-byte`.
+     * It is a variant of the RTP Speex encoding defined in
+     * [RFC 5574](https://tools.ietf.org/html/rfc5574).
+     * The stream is a sequence of blocks, one block per RTP packet. Each block
+     * starts with a byte containing the length of the block, in bytes, followed
+     * by one or more frames of Speex data, padded to an integral number of
+     * bytes (octets) as specified in RFC 5574. In other words, each RTP header
+     * is replaced with a single byte containing the block length. Only Speex
+     * wideband is supported. `sample_rate_hertz` must be 16000.
+     * 
+ * + * SPEEX_WITH_HEADER_BYTE = 7; + */ + SPEEX_WITH_HEADER_BYTE(7), + /** + *
+     * Opus encoded audio frames in WebM container
+     * ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be
+     * one of 8000, 12000, 16000, 24000, or 48000.
+     * 
+ * + * WEBM_OPUS = 9; + */ + WEBM_OPUS(9), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Not specified.
+     * 
+ * + * ENCODING_UNSPECIFIED = 0; + */ + public static final int ENCODING_UNSPECIFIED_VALUE = 0; + /** + *
+     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
+     * 
+ * + * LINEAR16 = 1; + */ + public static final int LINEAR16_VALUE = 1; + /** + *
+     * `FLAC` (Free Lossless Audio
+     * Codec) is the recommended encoding because it is
+     * lossless--therefore recognition is not compromised--and
+     * requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
+     * encoding supports 16-bit and 24-bit samples, however, not all fields in
+     * `STREAMINFO` are supported.
+     * 
+ * + * FLAC = 2; + */ + public static final int FLAC_VALUE = 2; + /** + *
+     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
+     * 
+ * + * MULAW = 3; + */ + public static final int MULAW_VALUE = 3; + /** + *
+     * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
+     * 
+ * + * AMR = 4; + */ + public static final int AMR_VALUE = 4; + /** + *
+     * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
+     * 
+ * + * AMR_WB = 5; + */ + public static final int AMR_WB_VALUE = 5; + /** + *
+     * Opus encoded audio frames in Ogg container
+     * ([OggOpus](https://wiki.xiph.org/OggOpus)).
+     * `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
+     * 
+ * + * OGG_OPUS = 6; + */ + public static final int OGG_OPUS_VALUE = 6; + /** + *
+     * Although the use of lossy encodings is not recommended, if a very low
+     * bitrate encoding is required, `OGG_OPUS` is highly preferred over
+     * Speex encoding. The [Speex](https://speex.org/)  encoding supported by
+     * Cloud Speech API has a header byte in each block, as in MIME type
+     * `audio/x-speex-with-header-byte`.
+     * It is a variant of the RTP Speex encoding defined in
+     * [RFC 5574](https://tools.ietf.org/html/rfc5574).
+     * The stream is a sequence of blocks, one block per RTP packet. Each block
+     * starts with a byte containing the length of the block, in bytes, followed
+     * by one or more frames of Speex data, padded to an integral number of
+     * bytes (octets) as specified in RFC 5574. In other words, each RTP header
+     * is replaced with a single byte containing the block length. Only Speex
+     * wideband is supported. `sample_rate_hertz` must be 16000.
+     * 
+ * + * SPEEX_WITH_HEADER_BYTE = 7; + */ + public static final int SPEEX_WITH_HEADER_BYTE_VALUE = 7; + /** + *
+     * Opus encoded audio frames in WebM container
+     * ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be
+     * one of 8000, 12000, 16000, 24000, or 48000.
+     * 
+ * + * WEBM_OPUS = 9; + */ + public static final int WEBM_OPUS_VALUE = 9; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AudioEncoding valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static AudioEncoding forNumber(int value) { + switch (value) { + case 0: return ENCODING_UNSPECIFIED; + case 1: return LINEAR16; + case 2: return FLAC; + case 3: return MULAW; + case 4: return AMR; + case 5: return AMR_WB; + case 6: return OGG_OPUS; + case 7: return SPEEX_WITH_HEADER_BYTE; + case 9: return WEBM_OPUS; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AudioEncoding> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AudioEncoding findValueByNumber(int number) { + return AudioEncoding.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.speech.v1.RecognitionConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final AudioEncoding[] VALUES = values(); + + public static AudioEncoding valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private AudioEncoding(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionConfig.AudioEncoding) + } + + public static final int ENCODING_FIELD_NUMBER = 1; + private int encoding_; + /** + *
+   * Encoding of audio data sent in all `RecognitionAudio` messages.
+   * This field is optional for `FLAC` and `WAV` audio files and required
+   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; + * @return The enum numeric value on the wire for encoding. + */ + @java.lang.Override public int getEncodingValue() { + return encoding_; + } + /** + *
+   * Encoding of audio data sent in all `RecognitionAudio` messages.
+   * This field is optional for `FLAC` and `WAV` audio files and required
+   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; + * @return The encoding. + */ + @java.lang.Override public com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding getEncoding() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding result = com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.valueOf(encoding_); + return result == null ? com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.UNRECOGNIZED : result; + } + + public static final int SAMPLE_RATE_HERTZ_FIELD_NUMBER = 2; + private int sampleRateHertz_; + /** + *
+   * Sample rate in Hertz of the audio data sent in all
+   * `RecognitionAudio` messages. Valid values are: 8000-48000.
+   * 16000 is optimal. For best results, set the sampling rate of the audio
+   * source to 16000 Hz. If that's not possible, use the native sample rate of
+   * the audio source (instead of re-sampling).
+   * This field is optional for FLAC and WAV audio files, but is
+   * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+   * 
+ * + * int32 sample_rate_hertz = 2; + * @return The sampleRateHertz. + */ + @java.lang.Override + public int getSampleRateHertz() { + return sampleRateHertz_; + } + + public static final int AUDIO_CHANNEL_COUNT_FIELD_NUMBER = 7; + private int audioChannelCount_; + /** + *
+   * The number of channels in the input audio data.
+   * ONLY set this for MULTI-CHANNEL recognition.
+   * Valid values for LINEAR16 and FLAC are `1`-`8`.
+   * Valid values for OGG_OPUS are '1'-'254'.
+   * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
+   * If `0` or omitted, defaults to one channel (mono).
+   * Note: We only recognize the first channel by default.
+   * To perform independent recognition on each channel set
+   * `enable_separate_recognition_per_channel` to 'true'.
+   * 
+ * + * int32 audio_channel_count = 7; + * @return The audioChannelCount. + */ + @java.lang.Override + public int getAudioChannelCount() { + return audioChannelCount_; + } + + public static final int ENABLE_SEPARATE_RECOGNITION_PER_CHANNEL_FIELD_NUMBER = 12; + private boolean enableSeparateRecognitionPerChannel_; + /** + *
+   * This needs to be set to `true` explicitly and `audio_channel_count` > 1
+   * to get each channel recognized separately. The recognition result will
+   * contain a `channel_tag` field to state which channel that result belongs
+   * to. If this is not true, we will only recognize the first channel. The
+   * request is billed cumulatively for all channels recognized:
+   * `audio_channel_count` multiplied by the length of the audio.
+   * 
+ * + * bool enable_separate_recognition_per_channel = 12; + * @return The enableSeparateRecognitionPerChannel. + */ + @java.lang.Override + public boolean getEnableSeparateRecognitionPerChannel() { + return enableSeparateRecognitionPerChannel_; + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object languageCode_; + /** + *
+   * Required. The language of the supplied audio as a
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+   * Example: "en-US".
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes.
+   * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + *
+   * Required. The language of the supplied audio as a
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+   * Example: "en-US".
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes.
+   * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALTERNATIVE_LANGUAGE_CODES_FIELD_NUMBER = 18; + private com.google.protobuf.LazyStringList alternativeLanguageCodes_; + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @return A list containing the alternativeLanguageCodes. + */ + public com.google.protobuf.ProtocolStringList + getAlternativeLanguageCodesList() { + return alternativeLanguageCodes_; + } + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @return The count of alternativeLanguageCodes. + */ + public int getAlternativeLanguageCodesCount() { + return alternativeLanguageCodes_.size(); + } + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index of the element to return. + * @return The alternativeLanguageCodes at the given index. + */ + public java.lang.String getAlternativeLanguageCodes(int index) { + return alternativeLanguageCodes_.get(index); + } + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index of the value to return. + * @return The bytes of the alternativeLanguageCodes at the given index. + */ + public com.google.protobuf.ByteString + getAlternativeLanguageCodesBytes(int index) { + return alternativeLanguageCodes_.getByteString(index); + } + + public static final int MAX_ALTERNATIVES_FIELD_NUMBER = 4; + private int maxAlternatives_; + /** + *
+   * Maximum number of recognition hypotheses to be returned.
+   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
+   * within each `SpeechRecognitionResult`.
+   * The server may return fewer than `max_alternatives`.
+   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
+   * one. If omitted, will return a maximum of one.
+   * 
+ * + * int32 max_alternatives = 4; + * @return The maxAlternatives. + */ + @java.lang.Override + public int getMaxAlternatives() { + return maxAlternatives_; + } + + public static final int PROFANITY_FILTER_FIELD_NUMBER = 5; + private boolean profanityFilter_; + /** + *
+   * If set to `true`, the server will attempt to filter out
+   * profanities, replacing all but the initial character in each filtered word
+   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
+   * won't be filtered out.
+   * 
+ * + * bool profanity_filter = 5; + * @return The profanityFilter. + */ + @java.lang.Override + public boolean getProfanityFilter() { + return profanityFilter_; + } + + public static final int ADAPTATION_FIELD_NUMBER = 20; + private com.google.cloud.speech.v1.SpeechAdaptation adaptation_; + /** + *
+   * Speech adaptation configuration improves the accuracy of speech
+   * recognition. For more information, see the [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+   * documentation.
+   * When speech adaptation is set it supersedes the `speech_contexts` field.
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + * @return Whether the adaptation field is set. + */ + @java.lang.Override + public boolean hasAdaptation() { + return adaptation_ != null; + } + /** + *
+   * Speech adaptation configuration improves the accuracy of speech
+   * recognition. For more information, see the [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+   * documentation.
+   * When speech adaptation is set it supersedes the `speech_contexts` field.
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + * @return The adaptation. + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptation getAdaptation() { + return adaptation_ == null ? com.google.cloud.speech.v1.SpeechAdaptation.getDefaultInstance() : adaptation_; + } + /** + *
+   * Speech adaptation configuration improves the accuracy of speech
+   * recognition. For more information, see the [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+   * documentation.
+   * When speech adaptation is set it supersedes the `speech_contexts` field.
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptationOrBuilder getAdaptationOrBuilder() { + return getAdaptation(); + } + + public static final int SPEECH_CONTEXTS_FIELD_NUMBER = 6; + private java.util.List speechContexts_; + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + @java.lang.Override + public java.util.List getSpeechContextsList() { + return speechContexts_; + } + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + @java.lang.Override + public java.util.List + getSpeechContextsOrBuilderList() { + return speechContexts_; + } + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + @java.lang.Override + public int getSpeechContextsCount() { + return speechContexts_.size(); + } + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechContext getSpeechContexts(int index) { + return speechContexts_.get(index); + } + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechContextOrBuilder getSpeechContextsOrBuilder( + int index) { + return speechContexts_.get(index); + } + + public static final int ENABLE_WORD_TIME_OFFSETS_FIELD_NUMBER = 8; + private boolean enableWordTimeOffsets_; + /** + *
+   * If `true`, the top result includes a list of words and
+   * the start and end time offsets (timestamps) for those words. If
+   * `false`, no word-level time offset information is returned. The default is
+   * `false`.
+   * 
+ * + * bool enable_word_time_offsets = 8; + * @return The enableWordTimeOffsets. + */ + @java.lang.Override + public boolean getEnableWordTimeOffsets() { + return enableWordTimeOffsets_; + } + + public static final int ENABLE_WORD_CONFIDENCE_FIELD_NUMBER = 15; + private boolean enableWordConfidence_; + /** + *
+   * If `true`, the top result includes a list of words and the
+   * confidence for those words. If `false`, no word-level confidence
+   * information is returned. The default is `false`.
+   * 
+ * + * bool enable_word_confidence = 15; + * @return The enableWordConfidence. + */ + @java.lang.Override + public boolean getEnableWordConfidence() { + return enableWordConfidence_; + } + + public static final int ENABLE_AUTOMATIC_PUNCTUATION_FIELD_NUMBER = 11; + private boolean enableAutomaticPunctuation_; + /** + *
+   * If 'true', adds punctuation to recognition result hypotheses.
+   * This feature is only available in select languages. Setting this for
+   * requests in other languages has no effect at all.
+   * The default 'false' value does not add punctuation to result hypotheses.
+   * 
+ * + * bool enable_automatic_punctuation = 11; + * @return The enableAutomaticPunctuation. + */ + @java.lang.Override + public boolean getEnableAutomaticPunctuation() { + return enableAutomaticPunctuation_; + } + + public static final int ENABLE_SPOKEN_PUNCTUATION_FIELD_NUMBER = 22; + private com.google.protobuf.BoolValue enableSpokenPunctuation_; + /** + *
+   * The spoken punctuation behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * e.g. command_and_search will enable spoken punctuation by default
+   * If 'true', replaces spoken punctuation with the corresponding symbols in
+   * the request. For example, "how are you question mark" becomes "how are
+   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+   * for support. If 'false', spoken punctuation is not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + * @return Whether the enableSpokenPunctuation field is set. + */ + @java.lang.Override + public boolean hasEnableSpokenPunctuation() { + return enableSpokenPunctuation_ != null; + } + /** + *
+   * The spoken punctuation behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * e.g. command_and_search will enable spoken punctuation by default
+   * If 'true', replaces spoken punctuation with the corresponding symbols in
+   * the request. For example, "how are you question mark" becomes "how are
+   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+   * for support. If 'false', spoken punctuation is not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + * @return The enableSpokenPunctuation. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnableSpokenPunctuation() { + return enableSpokenPunctuation_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenPunctuation_; + } + /** + *
+   * The spoken punctuation behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * e.g. command_and_search will enable spoken punctuation by default
+   * If 'true', replaces spoken punctuation with the corresponding symbols in
+   * the request. For example, "how are you question mark" becomes "how are
+   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+   * for support. If 'false', spoken punctuation is not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilder() { + return getEnableSpokenPunctuation(); + } + + public static final int ENABLE_SPOKEN_EMOJIS_FIELD_NUMBER = 23; + private com.google.protobuf.BoolValue enableSpokenEmojis_; + /** + *
+   * The spoken emoji behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * If 'true', adds spoken emoji formatting for the request. This will replace
+   * spoken emojis with the corresponding Unicode symbols in the final
+   * transcript. If 'false', spoken emojis are not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + * @return Whether the enableSpokenEmojis field is set. + */ + @java.lang.Override + public boolean hasEnableSpokenEmojis() { + return enableSpokenEmojis_ != null; + } + /** + *
+   * The spoken emoji behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * If 'true', adds spoken emoji formatting for the request. This will replace
+   * spoken emojis with the corresponding Unicode symbols in the final
+   * transcript. If 'false', spoken emojis are not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + * @return The enableSpokenEmojis. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnableSpokenEmojis() { + return enableSpokenEmojis_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenEmojis_; + } + /** + *
+   * The spoken emoji behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * If 'true', adds spoken emoji formatting for the request. This will replace
+   * spoken emojis with the corresponding Unicode symbols in the final
+   * transcript. If 'false', spoken emojis are not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder() { + return getEnableSpokenEmojis(); + } + + public static final int DIARIZATION_CONFIG_FIELD_NUMBER = 19; + private com.google.cloud.speech.v1.SpeakerDiarizationConfig diarizationConfig_; + /** + *
+   * Config to enable speaker diarization and set additional
+   * parameters to make diarization better suited for your application.
+   * Note: When this is enabled, we send all the words from the beginning of the
+   * audio for the top alternative in every consecutive STREAMING responses.
+   * This is done in order to improve our speaker tags as our models learn to
+   * identify the speakers in the conversation over time.
+   * For non-streaming requests, the diarization results will be provided only
+   * in the top alternative of the FINAL SpeechRecognitionResult.
+   * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + * @return Whether the diarizationConfig field is set. + */ + @java.lang.Override + public boolean hasDiarizationConfig() { + return diarizationConfig_ != null; + } + /** + *
+   * Config to enable speaker diarization and set additional
+   * parameters to make diarization better suited for your application.
+   * Note: When this is enabled, we send all the words from the beginning of the
+   * audio for the top alternative in every consecutive STREAMING responses.
+   * This is done in order to improve our speaker tags as our models learn to
+   * identify the speakers in the conversation over time.
+   * For non-streaming requests, the diarization results will be provided only
+   * in the top alternative of the FINAL SpeechRecognitionResult.
+   * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + * @return The diarizationConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDiarizationConfig() { + return diarizationConfig_ == null ? com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance() : diarizationConfig_; + } + /** + *
+   * Config to enable speaker diarization and set additional
+   * parameters to make diarization better suited for your application.
+   * Note: When this is enabled, we send all the words from the beginning of the
+   * audio for the top alternative in every consecutive STREAMING responses.
+   * This is done in order to improve our speaker tags as our models learn to
+   * identify the speakers in the conversation over time.
+   * For non-streaming requests, the diarization results will be provided only
+   * in the top alternative of the FINAL SpeechRecognitionResult.
+   * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder() { + return getDiarizationConfig(); + } + + public static final int METADATA_FIELD_NUMBER = 9; + private com.google.cloud.speech.v1.RecognitionMetadata metadata_; + /** + *
+   * Metadata regarding this request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + *
+   * Metadata regarding this request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionMetadata getMetadata() { + return metadata_ == null ? com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance() : metadata_; + } + /** + *
+   * Metadata regarding this request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionMetadataOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + public static final int MODEL_FIELD_NUMBER = 13; + private volatile java.lang.Object model_; + /** + *
+   * Which model to select for the given request. Select the model
+   * best suited to your domain to get best results. If a model is not
+   * explicitly specified, then we auto-select a model based on the parameters
+   * in the RecognitionConfig.
+   * <table>
+   *   <tr>
+   *     <td><b>Model</b></td>
+   *     <td><b>Description</b></td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_long</code></td>
+   *     <td>Best for long form content like media or conversation.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_short</code></td>
+   *     <td>Best for short form content like commands or single shot directed
+   *     speech.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>command_and_search</code></td>
+   *     <td>Best for short queries such as voice commands or voice search.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>phone_call</code></td>
+   *     <td>Best for audio that originated from a phone call (typically
+   *     recorded at an 8khz sampling rate).</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>video</code></td>
+   *     <td>Best for audio that originated from video or includes multiple
+   *         speakers. Ideally the audio is recorded at a 16khz or greater
+   *         sampling rate. This is a premium model that costs more than the
+   *         standard rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>default</code></td>
+   *     <td>Best for audio that is not one of the specific audio models.
+   *         For example, long-form audio. Ideally the audio is high-fidelity,
+   *         recorded at a 16khz or greater sampling rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_conversation</code></td>
+   *     <td>Best for audio that originated from a conversation between a
+   *         medical provider and patient.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_dictation</code></td>
+   *     <td>Best for audio that originated from dictation notes by a medical
+   *         provider.</td>
+   *   </tr>
+   * </table>
+   * 
+ * + * string model = 13; + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } + } + /** + *
+   * Which model to select for the given request. Select the model
+   * best suited to your domain to get best results. If a model is not
+   * explicitly specified, then we auto-select a model based on the parameters
+   * in the RecognitionConfig.
+   * <table>
+   *   <tr>
+   *     <td><b>Model</b></td>
+   *     <td><b>Description</b></td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_long</code></td>
+   *     <td>Best for long form content like media or conversation.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_short</code></td>
+   *     <td>Best for short form content like commands or single shot directed
+   *     speech.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>command_and_search</code></td>
+   *     <td>Best for short queries such as voice commands or voice search.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>phone_call</code></td>
+   *     <td>Best for audio that originated from a phone call (typically
+   *     recorded at an 8khz sampling rate).</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>video</code></td>
+   *     <td>Best for audio that originated from video or includes multiple
+   *         speakers. Ideally the audio is recorded at a 16khz or greater
+   *         sampling rate. This is a premium model that costs more than the
+   *         standard rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>default</code></td>
+   *     <td>Best for audio that is not one of the specific audio models.
+   *         For example, long-form audio. Ideally the audio is high-fidelity,
+   *         recorded at a 16khz or greater sampling rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_conversation</code></td>
+   *     <td>Best for audio that originated from a conversation between a
+   *         medical provider and patient.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_dictation</code></td>
+   *     <td>Best for audio that originated from dictation notes by a medical
+   *         provider.</td>
+   *   </tr>
+   * </table>
+   * 
+ * + * string model = 13; + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USE_ENHANCED_FIELD_NUMBER = 14; + private boolean useEnhanced_; + /** + *
+   * Set to true to use an enhanced model for speech recognition.
+   * If `use_enhanced` is set to true and the `model` field is not set, then
+   * an appropriate enhanced model is chosen if an enhanced model exists for
+   * the audio.
+   * If `use_enhanced` is true and an enhanced version of the specified model
+   * does not exist, then the speech is recognized using the standard version
+   * of the specified model.
+   * 
+ * + * bool use_enhanced = 14; + * @return The useEnhanced. + */ + @java.lang.Override + public boolean getUseEnhanced() { + return useEnhanced_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (encoding_ != com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED.getNumber()) { + output.writeEnum(1, encoding_); + } + if (sampleRateHertz_ != 0) { + output.writeInt32(2, sampleRateHertz_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); + } + if (maxAlternatives_ != 0) { + output.writeInt32(4, maxAlternatives_); + } + if (profanityFilter_ != false) { + output.writeBool(5, profanityFilter_); + } + for (int i = 0; i < speechContexts_.size(); i++) { + output.writeMessage(6, speechContexts_.get(i)); + } + if (audioChannelCount_ != 0) { + output.writeInt32(7, audioChannelCount_); + } + if (enableWordTimeOffsets_ != false) { + output.writeBool(8, enableWordTimeOffsets_); + } + if (metadata_ != null) { + output.writeMessage(9, getMetadata()); + } + if (enableAutomaticPunctuation_ != false) { + output.writeBool(11, enableAutomaticPunctuation_); + } + if (enableSeparateRecognitionPerChannel_ != false) { + output.writeBool(12, enableSeparateRecognitionPerChannel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, model_); + } + if (useEnhanced_ != false) { + output.writeBool(14, useEnhanced_); + } + if (enableWordConfidence_ != false) { + output.writeBool(15, enableWordConfidence_); + } + for (int i = 0; i < alternativeLanguageCodes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, alternativeLanguageCodes_.getRaw(i)); + } + if (diarizationConfig_ != null) { + output.writeMessage(19, getDiarizationConfig()); + } + if (adaptation_ != null) { + output.writeMessage(20, getAdaptation()); + } + if (enableSpokenPunctuation_ != null) { + output.writeMessage(22, getEnableSpokenPunctuation()); + } + if (enableSpokenEmojis_ != null) { + output.writeMessage(23, getEnableSpokenEmojis()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encoding_ != com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, encoding_); + } + if (sampleRateHertz_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, sampleRateHertz_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); + } + if (maxAlternatives_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, maxAlternatives_); + } + if (profanityFilter_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, profanityFilter_); + } + for (int i = 0; i < speechContexts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, speechContexts_.get(i)); + } + if (audioChannelCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, audioChannelCount_); + } + if (enableWordTimeOffsets_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, enableWordTimeOffsets_); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getMetadata()); + } + if (enableAutomaticPunctuation_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(11, enableAutomaticPunctuation_); + } + if (enableSeparateRecognitionPerChannel_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(12, enableSeparateRecognitionPerChannel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, model_); + } + if (useEnhanced_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(14, useEnhanced_); + } + if (enableWordConfidence_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(15, enableWordConfidence_); + } + { + int dataSize = 0; + for (int i = 0; i < alternativeLanguageCodes_.size(); i++) { + dataSize += computeStringSizeNoTag(alternativeLanguageCodes_.getRaw(i)); + } + size += dataSize; + size += 2 * getAlternativeLanguageCodesList().size(); + } + if (diarizationConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(19, getDiarizationConfig()); + } + if (adaptation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(20, getAdaptation()); + } + if (enableSpokenPunctuation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(22, getEnableSpokenPunctuation()); + } + if (enableSpokenEmojis_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(23, getEnableSpokenEmojis()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.RecognitionConfig)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.RecognitionConfig other = (com.google.cloud.speech.v1.RecognitionConfig) obj; + + if (encoding_ != other.encoding_) return false; + if (getSampleRateHertz() + != other.getSampleRateHertz()) return false; + if (getAudioChannelCount() + != other.getAudioChannelCount()) return false; + if (getEnableSeparateRecognitionPerChannel() + != other.getEnableSeparateRecognitionPerChannel()) return false; + if (!getLanguageCode() + .equals(other.getLanguageCode())) return false; + if (!getAlternativeLanguageCodesList() + .equals(other.getAlternativeLanguageCodesList())) return false; + if (getMaxAlternatives() + != other.getMaxAlternatives()) return false; + if (getProfanityFilter() + != other.getProfanityFilter()) return false; + if (hasAdaptation() != other.hasAdaptation()) return false; + if (hasAdaptation()) { + if (!getAdaptation() + .equals(other.getAdaptation())) return false; + } + if (!getSpeechContextsList() + .equals(other.getSpeechContextsList())) return false; + if (getEnableWordTimeOffsets() + != other.getEnableWordTimeOffsets()) return false; + if (getEnableWordConfidence() + != other.getEnableWordConfidence()) return false; + if (getEnableAutomaticPunctuation() + != other.getEnableAutomaticPunctuation()) return false; + if (hasEnableSpokenPunctuation() != other.hasEnableSpokenPunctuation()) return false; + if (hasEnableSpokenPunctuation()) { + if (!getEnableSpokenPunctuation() + .equals(other.getEnableSpokenPunctuation())) return false; + } + if (hasEnableSpokenEmojis() != other.hasEnableSpokenEmojis()) return false; + if (hasEnableSpokenEmojis()) { + if (!getEnableSpokenEmojis() + .equals(other.getEnableSpokenEmojis())) return false; + } + if (hasDiarizationConfig() != other.hasDiarizationConfig()) return false; + if (hasDiarizationConfig()) { + if (!getDiarizationConfig() + .equals(other.getDiarizationConfig())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata() + .equals(other.getMetadata())) return false; + } + if (!getModel() + .equals(other.getModel())) return false; + if (getUseEnhanced() + != other.getUseEnhanced()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + encoding_; + hash = (37 * hash) + SAMPLE_RATE_HERTZ_FIELD_NUMBER; + hash = (53 * hash) + getSampleRateHertz(); + hash = (37 * hash) + AUDIO_CHANNEL_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getAudioChannelCount(); + hash = (37 * hash) + ENABLE_SEPARATE_RECOGNITION_PER_CHANNEL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableSeparateRecognitionPerChannel()); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + if (getAlternativeLanguageCodesCount() > 0) { + hash = (37 * hash) + ALTERNATIVE_LANGUAGE_CODES_FIELD_NUMBER; + hash = (53 * hash) + getAlternativeLanguageCodesList().hashCode(); + } + hash = (37 * hash) + MAX_ALTERNATIVES_FIELD_NUMBER; + hash = (53 * hash) + getMaxAlternatives(); + hash = (37 * hash) + PROFANITY_FILTER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getProfanityFilter()); + if (hasAdaptation()) { + hash = (37 * hash) + ADAPTATION_FIELD_NUMBER; + hash = (53 * hash) + getAdaptation().hashCode(); + } + if (getSpeechContextsCount() > 0) { + hash = (37 * hash) + SPEECH_CONTEXTS_FIELD_NUMBER; + hash = (53 * hash) + getSpeechContextsList().hashCode(); + } + hash = (37 * hash) + ENABLE_WORD_TIME_OFFSETS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableWordTimeOffsets()); + hash = (37 * hash) + ENABLE_WORD_CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableWordConfidence()); + hash = (37 * hash) + ENABLE_AUTOMATIC_PUNCTUATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableAutomaticPunctuation()); + if (hasEnableSpokenPunctuation()) { + hash = (37 * hash) + ENABLE_SPOKEN_PUNCTUATION_FIELD_NUMBER; + hash = (53 * hash) + getEnableSpokenPunctuation().hashCode(); + } + if (hasEnableSpokenEmojis()) { + hash = (37 * hash) + ENABLE_SPOKEN_EMOJIS_FIELD_NUMBER; + hash = (53 * hash) + getEnableSpokenEmojis().hashCode(); + } + if (hasDiarizationConfig()) { + hash = (37 * hash) + DIARIZATION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDiarizationConfig().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (37 * hash) + USE_ENHANCED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUseEnhanced()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognitionConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.RecognitionConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.RecognitionConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognitionConfig) + com.google.cloud.speech.v1.RecognitionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.RecognitionConfig.class, com.google.cloud.speech.v1.RecognitionConfig.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.RecognitionConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSpeechContextsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + encoding_ = 0; + + sampleRateHertz_ = 0; + + audioChannelCount_ = 0; + + enableSeparateRecognitionPerChannel_ = false; + + languageCode_ = ""; + + alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + maxAlternatives_ = 0; + + profanityFilter_ = false; + + if (adaptationBuilder_ == null) { + adaptation_ = null; + } else { + adaptation_ = null; + adaptationBuilder_ = null; + } + if (speechContextsBuilder_ == null) { + speechContexts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + speechContextsBuilder_.clear(); + } + enableWordTimeOffsets_ = false; + + enableWordConfidence_ = false; + + enableAutomaticPunctuation_ = false; + + if (enableSpokenPunctuationBuilder_ == null) { + enableSpokenPunctuation_ = null; + } else { + enableSpokenPunctuation_ = null; + enableSpokenPunctuationBuilder_ = null; + } + if (enableSpokenEmojisBuilder_ == null) { + enableSpokenEmojis_ = null; + } else { + enableSpokenEmojis_ = null; + enableSpokenEmojisBuilder_ = null; + } + if (diarizationConfigBuilder_ == null) { + diarizationConfig_ = null; + } else { + diarizationConfig_ = null; + diarizationConfigBuilder_ = null; + } + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + model_ = ""; + + useEnhanced_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionConfig getDefaultInstanceForType() { + return com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionConfig build() { + com.google.cloud.speech.v1.RecognitionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionConfig buildPartial() { + com.google.cloud.speech.v1.RecognitionConfig result = new com.google.cloud.speech.v1.RecognitionConfig(this); + int from_bitField0_ = bitField0_; + result.encoding_ = encoding_; + result.sampleRateHertz_ = sampleRateHertz_; + result.audioChannelCount_ = audioChannelCount_; + result.enableSeparateRecognitionPerChannel_ = enableSeparateRecognitionPerChannel_; + result.languageCode_ = languageCode_; + if (((bitField0_ & 0x00000001) != 0)) { + alternativeLanguageCodes_ = alternativeLanguageCodes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.alternativeLanguageCodes_ = alternativeLanguageCodes_; + result.maxAlternatives_ = maxAlternatives_; + result.profanityFilter_ = profanityFilter_; + if (adaptationBuilder_ == null) { + result.adaptation_ = adaptation_; + } else { + result.adaptation_ = adaptationBuilder_.build(); + } + if (speechContextsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.speechContexts_ = speechContexts_; + } else { + result.speechContexts_ = speechContextsBuilder_.build(); + } + result.enableWordTimeOffsets_ = enableWordTimeOffsets_; + result.enableWordConfidence_ = enableWordConfidence_; + result.enableAutomaticPunctuation_ = enableAutomaticPunctuation_; + if (enableSpokenPunctuationBuilder_ == null) { + result.enableSpokenPunctuation_ = enableSpokenPunctuation_; + } else { + result.enableSpokenPunctuation_ = enableSpokenPunctuationBuilder_.build(); + } + if (enableSpokenEmojisBuilder_ == null) { + result.enableSpokenEmojis_ = enableSpokenEmojis_; + } else { + result.enableSpokenEmojis_ = enableSpokenEmojisBuilder_.build(); + } + if (diarizationConfigBuilder_ == null) { + result.diarizationConfig_ = diarizationConfig_; + } else { + result.diarizationConfig_ = diarizationConfigBuilder_.build(); + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + result.model_ = model_; + result.useEnhanced_ = useEnhanced_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.RecognitionConfig) { + return mergeFrom((com.google.cloud.speech.v1.RecognitionConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.RecognitionConfig other) { + if (other == com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance()) return this; + if (other.encoding_ != 0) { + setEncodingValue(other.getEncodingValue()); + } + if (other.getSampleRateHertz() != 0) { + setSampleRateHertz(other.getSampleRateHertz()); + } + if (other.getAudioChannelCount() != 0) { + setAudioChannelCount(other.getAudioChannelCount()); + } + if (other.getEnableSeparateRecognitionPerChannel() != false) { + setEnableSeparateRecognitionPerChannel(other.getEnableSeparateRecognitionPerChannel()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + if (!other.alternativeLanguageCodes_.isEmpty()) { + if (alternativeLanguageCodes_.isEmpty()) { + alternativeLanguageCodes_ = other.alternativeLanguageCodes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAlternativeLanguageCodesIsMutable(); + alternativeLanguageCodes_.addAll(other.alternativeLanguageCodes_); + } + onChanged(); + } + if (other.getMaxAlternatives() != 0) { + setMaxAlternatives(other.getMaxAlternatives()); + } + if (other.getProfanityFilter() != false) { + setProfanityFilter(other.getProfanityFilter()); + } + if (other.hasAdaptation()) { + mergeAdaptation(other.getAdaptation()); + } + if (speechContextsBuilder_ == null) { + if (!other.speechContexts_.isEmpty()) { + if (speechContexts_.isEmpty()) { + speechContexts_ = other.speechContexts_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSpeechContextsIsMutable(); + speechContexts_.addAll(other.speechContexts_); + } + onChanged(); + } + } else { + if (!other.speechContexts_.isEmpty()) { + if (speechContextsBuilder_.isEmpty()) { + speechContextsBuilder_.dispose(); + speechContextsBuilder_ = null; + speechContexts_ = other.speechContexts_; + bitField0_ = (bitField0_ & ~0x00000002); + speechContextsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSpeechContextsFieldBuilder() : null; + } else { + speechContextsBuilder_.addAllMessages(other.speechContexts_); + } + } + } + if (other.getEnableWordTimeOffsets() != false) { + setEnableWordTimeOffsets(other.getEnableWordTimeOffsets()); + } + if (other.getEnableWordConfidence() != false) { + setEnableWordConfidence(other.getEnableWordConfidence()); + } + if (other.getEnableAutomaticPunctuation() != false) { + setEnableAutomaticPunctuation(other.getEnableAutomaticPunctuation()); + } + if (other.hasEnableSpokenPunctuation()) { + mergeEnableSpokenPunctuation(other.getEnableSpokenPunctuation()); + } + if (other.hasEnableSpokenEmojis()) { + mergeEnableSpokenEmojis(other.getEnableSpokenEmojis()); + } + if (other.hasDiarizationConfig()) { + mergeDiarizationConfig(other.getDiarizationConfig()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + onChanged(); + } + if (other.getUseEnhanced() != false) { + setUseEnhanced(other.getUseEnhanced()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.RecognitionConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.RecognitionConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int encoding_ = 0; + /** + *
+     * Encoding of audio data sent in all `RecognitionAudio` messages.
+     * This field is optional for `FLAC` and `WAV` audio files and required
+     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; + * @return The enum numeric value on the wire for encoding. + */ + @java.lang.Override public int getEncodingValue() { + return encoding_; + } + /** + *
+     * Encoding of audio data sent in all `RecognitionAudio` messages.
+     * This field is optional for `FLAC` and `WAV` audio files and required
+     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; + * @param value The enum numeric value on the wire for encoding to set. + * @return This builder for chaining. + */ + public Builder setEncodingValue(int value) { + + encoding_ = value; + onChanged(); + return this; + } + /** + *
+     * Encoding of audio data sent in all `RecognitionAudio` messages.
+     * This field is optional for `FLAC` and `WAV` audio files and required
+     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; + * @return The encoding. + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding getEncoding() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding result = com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.valueOf(encoding_); + return result == null ? com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.UNRECOGNIZED : result; + } + /** + *
+     * Encoding of audio data sent in all `RecognitionAudio` messages.
+     * This field is optional for `FLAC` and `WAV` audio files and required
+     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; + * @param value The encoding to set. + * @return This builder for chaining. + */ + public Builder setEncoding(com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding value) { + if (value == null) { + throw new NullPointerException(); + } + + encoding_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Encoding of audio data sent in all `RecognitionAudio` messages.
+     * This field is optional for `FLAC` and `WAV` audio files and required
+     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; + * @return This builder for chaining. + */ + public Builder clearEncoding() { + + encoding_ = 0; + onChanged(); + return this; + } + + private int sampleRateHertz_ ; + /** + *
+     * Sample rate in Hertz of the audio data sent in all
+     * `RecognitionAudio` messages. Valid values are: 8000-48000.
+     * 16000 is optimal. For best results, set the sampling rate of the audio
+     * source to 16000 Hz. If that's not possible, use the native sample rate of
+     * the audio source (instead of re-sampling).
+     * This field is optional for FLAC and WAV audio files, but is
+     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * int32 sample_rate_hertz = 2; + * @return The sampleRateHertz. + */ + @java.lang.Override + public int getSampleRateHertz() { + return sampleRateHertz_; + } + /** + *
+     * Sample rate in Hertz of the audio data sent in all
+     * `RecognitionAudio` messages. Valid values are: 8000-48000.
+     * 16000 is optimal. For best results, set the sampling rate of the audio
+     * source to 16000 Hz. If that's not possible, use the native sample rate of
+     * the audio source (instead of re-sampling).
+     * This field is optional for FLAC and WAV audio files, but is
+     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * int32 sample_rate_hertz = 2; + * @param value The sampleRateHertz to set. + * @return This builder for chaining. + */ + public Builder setSampleRateHertz(int value) { + + sampleRateHertz_ = value; + onChanged(); + return this; + } + /** + *
+     * Sample rate in Hertz of the audio data sent in all
+     * `RecognitionAudio` messages. Valid values are: 8000-48000.
+     * 16000 is optimal. For best results, set the sampling rate of the audio
+     * source to 16000 Hz. If that's not possible, use the native sample rate of
+     * the audio source (instead of re-sampling).
+     * This field is optional for FLAC and WAV audio files, but is
+     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * int32 sample_rate_hertz = 2; + * @return This builder for chaining. + */ + public Builder clearSampleRateHertz() { + + sampleRateHertz_ = 0; + onChanged(); + return this; + } + + private int audioChannelCount_ ; + /** + *
+     * The number of channels in the input audio data.
+     * ONLY set this for MULTI-CHANNEL recognition.
+     * Valid values for LINEAR16 and FLAC are `1`-`8`.
+     * Valid values for OGG_OPUS are '1'-'254'.
+     * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
+     * If `0` or omitted, defaults to one channel (mono).
+     * Note: We only recognize the first channel by default.
+     * To perform independent recognition on each channel set
+     * `enable_separate_recognition_per_channel` to 'true'.
+     * 
+ * + * int32 audio_channel_count = 7; + * @return The audioChannelCount. + */ + @java.lang.Override + public int getAudioChannelCount() { + return audioChannelCount_; + } + /** + *
+     * The number of channels in the input audio data.
+     * ONLY set this for MULTI-CHANNEL recognition.
+     * Valid values for LINEAR16 and FLAC are `1`-`8`.
+     * Valid values for OGG_OPUS are '1'-'254'.
+     * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
+     * If `0` or omitted, defaults to one channel (mono).
+     * Note: We only recognize the first channel by default.
+     * To perform independent recognition on each channel set
+     * `enable_separate_recognition_per_channel` to 'true'.
+     * 
+ * + * int32 audio_channel_count = 7; + * @param value The audioChannelCount to set. + * @return This builder for chaining. + */ + public Builder setAudioChannelCount(int value) { + + audioChannelCount_ = value; + onChanged(); + return this; + } + /** + *
+     * The number of channels in the input audio data.
+     * ONLY set this for MULTI-CHANNEL recognition.
+     * Valid values for LINEAR16 and FLAC are `1`-`8`.
+     * Valid values for OGG_OPUS are '1'-'254'.
+     * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
+     * If `0` or omitted, defaults to one channel (mono).
+     * Note: We only recognize the first channel by default.
+     * To perform independent recognition on each channel set
+     * `enable_separate_recognition_per_channel` to 'true'.
+     * 
+ * + * int32 audio_channel_count = 7; + * @return This builder for chaining. + */ + public Builder clearAudioChannelCount() { + + audioChannelCount_ = 0; + onChanged(); + return this; + } + + private boolean enableSeparateRecognitionPerChannel_ ; + /** + *
+     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
+     * to get each channel recognized separately. The recognition result will
+     * contain a `channel_tag` field to state which channel that result belongs
+     * to. If this is not true, we will only recognize the first channel. The
+     * request is billed cumulatively for all channels recognized:
+     * `audio_channel_count` multiplied by the length of the audio.
+     * 
+ * + * bool enable_separate_recognition_per_channel = 12; + * @return The enableSeparateRecognitionPerChannel. + */ + @java.lang.Override + public boolean getEnableSeparateRecognitionPerChannel() { + return enableSeparateRecognitionPerChannel_; + } + /** + *
+     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
+     * to get each channel recognized separately. The recognition result will
+     * contain a `channel_tag` field to state which channel that result belongs
+     * to. If this is not true, we will only recognize the first channel. The
+     * request is billed cumulatively for all channels recognized:
+     * `audio_channel_count` multiplied by the length of the audio.
+     * 
+ * + * bool enable_separate_recognition_per_channel = 12; + * @param value The enableSeparateRecognitionPerChannel to set. + * @return This builder for chaining. + */ + public Builder setEnableSeparateRecognitionPerChannel(boolean value) { + + enableSeparateRecognitionPerChannel_ = value; + onChanged(); + return this; + } + /** + *
+     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
+     * to get each channel recognized separately. The recognition result will
+     * contain a `channel_tag` field to state which channel that result belongs
+     * to. If this is not true, we will only recognize the first channel. The
+     * request is billed cumulatively for all channels recognized:
+     * `audio_channel_count` multiplied by the length of the audio.
+     * 
+ * + * bool enable_separate_recognition_per_channel = 12; + * @return This builder for chaining. + */ + public Builder clearEnableSeparateRecognitionPerChannel() { + + enableSeparateRecognitionPerChannel_ = false; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + *
+     * Required. The language of the supplied audio as a
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+     * Example: "en-US".
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes.
+     * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The language of the supplied audio as a
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+     * Example: "en-US".
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes.
+     * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The language of the supplied audio as a
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+     * Example: "en-US".
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes.
+     * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The language of the supplied audio as a
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+     * Example: "en-US".
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes.
+     * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + *
+     * Required. The language of the supplied audio as a
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+     * Example: "en-US".
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes.
+     * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureAlternativeLanguageCodesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + alternativeLanguageCodes_ = new com.google.protobuf.LazyStringArrayList(alternativeLanguageCodes_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @return A list containing the alternativeLanguageCodes. + */ + public com.google.protobuf.ProtocolStringList + getAlternativeLanguageCodesList() { + return alternativeLanguageCodes_.getUnmodifiableView(); + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @return The count of alternativeLanguageCodes. + */ + public int getAlternativeLanguageCodesCount() { + return alternativeLanguageCodes_.size(); + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index of the element to return. + * @return The alternativeLanguageCodes at the given index. + */ + public java.lang.String getAlternativeLanguageCodes(int index) { + return alternativeLanguageCodes_.get(index); + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index of the value to return. + * @return The bytes of the alternativeLanguageCodes at the given index. + */ + public com.google.protobuf.ByteString + getAlternativeLanguageCodesBytes(int index) { + return alternativeLanguageCodes_.getByteString(index); + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index to set the value at. + * @param value The alternativeLanguageCodes to set. + * @return This builder for chaining. + */ + public Builder setAlternativeLanguageCodes( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativeLanguageCodesIsMutable(); + alternativeLanguageCodes_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @param value The alternativeLanguageCodes to add. + * @return This builder for chaining. + */ + public Builder addAlternativeLanguageCodes( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativeLanguageCodesIsMutable(); + alternativeLanguageCodes_.add(value); + onChanged(); + return this; + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @param values The alternativeLanguageCodes to add. + * @return This builder for chaining. + */ + public Builder addAllAlternativeLanguageCodes( + java.lang.Iterable values) { + ensureAlternativeLanguageCodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, alternativeLanguageCodes_); + onChanged(); + return this; + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @return This builder for chaining. + */ + public Builder clearAlternativeLanguageCodes() { + alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @param value The bytes of the alternativeLanguageCodes to add. + * @return This builder for chaining. + */ + public Builder addAlternativeLanguageCodesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAlternativeLanguageCodesIsMutable(); + alternativeLanguageCodes_.add(value); + onChanged(); + return this; + } + + private int maxAlternatives_ ; + /** + *
+     * Maximum number of recognition hypotheses to be returned.
+     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
+     * within each `SpeechRecognitionResult`.
+     * The server may return fewer than `max_alternatives`.
+     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
+     * one. If omitted, will return a maximum of one.
+     * 
+ * + * int32 max_alternatives = 4; + * @return The maxAlternatives. + */ + @java.lang.Override + public int getMaxAlternatives() { + return maxAlternatives_; + } + /** + *
+     * Maximum number of recognition hypotheses to be returned.
+     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
+     * within each `SpeechRecognitionResult`.
+     * The server may return fewer than `max_alternatives`.
+     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
+     * one. If omitted, will return a maximum of one.
+     * 
+ * + * int32 max_alternatives = 4; + * @param value The maxAlternatives to set. + * @return This builder for chaining. + */ + public Builder setMaxAlternatives(int value) { + + maxAlternatives_ = value; + onChanged(); + return this; + } + /** + *
+     * Maximum number of recognition hypotheses to be returned.
+     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
+     * within each `SpeechRecognitionResult`.
+     * The server may return fewer than `max_alternatives`.
+     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
+     * one. If omitted, will return a maximum of one.
+     * 
+ * + * int32 max_alternatives = 4; + * @return This builder for chaining. + */ + public Builder clearMaxAlternatives() { + + maxAlternatives_ = 0; + onChanged(); + return this; + } + + private boolean profanityFilter_ ; + /** + *
+     * If set to `true`, the server will attempt to filter out
+     * profanities, replacing all but the initial character in each filtered word
+     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
+     * won't be filtered out.
+     * 
+ * + * bool profanity_filter = 5; + * @return The profanityFilter. + */ + @java.lang.Override + public boolean getProfanityFilter() { + return profanityFilter_; + } + /** + *
+     * If set to `true`, the server will attempt to filter out
+     * profanities, replacing all but the initial character in each filtered word
+     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
+     * won't be filtered out.
+     * 
+ * + * bool profanity_filter = 5; + * @param value The profanityFilter to set. + * @return This builder for chaining. + */ + public Builder setProfanityFilter(boolean value) { + + profanityFilter_ = value; + onChanged(); + return this; + } + /** + *
+     * If set to `true`, the server will attempt to filter out
+     * profanities, replacing all but the initial character in each filtered word
+     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
+     * won't be filtered out.
+     * 
+ * + * bool profanity_filter = 5; + * @return This builder for chaining. + */ + public Builder clearProfanityFilter() { + + profanityFilter_ = false; + onChanged(); + return this; + } + + private com.google.cloud.speech.v1.SpeechAdaptation adaptation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeechAdaptation, com.google.cloud.speech.v1.SpeechAdaptation.Builder, com.google.cloud.speech.v1.SpeechAdaptationOrBuilder> adaptationBuilder_; + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + * @return Whether the adaptation field is set. + */ + public boolean hasAdaptation() { + return adaptationBuilder_ != null || adaptation_ != null; + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + * @return The adaptation. + */ + public com.google.cloud.speech.v1.SpeechAdaptation getAdaptation() { + if (adaptationBuilder_ == null) { + return adaptation_ == null ? com.google.cloud.speech.v1.SpeechAdaptation.getDefaultInstance() : adaptation_; + } else { + return adaptationBuilder_.getMessage(); + } + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + */ + public Builder setAdaptation(com.google.cloud.speech.v1.SpeechAdaptation value) { + if (adaptationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + adaptation_ = value; + onChanged(); + } else { + adaptationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + */ + public Builder setAdaptation( + com.google.cloud.speech.v1.SpeechAdaptation.Builder builderForValue) { + if (adaptationBuilder_ == null) { + adaptation_ = builderForValue.build(); + onChanged(); + } else { + adaptationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + */ + public Builder mergeAdaptation(com.google.cloud.speech.v1.SpeechAdaptation value) { + if (adaptationBuilder_ == null) { + if (adaptation_ != null) { + adaptation_ = + com.google.cloud.speech.v1.SpeechAdaptation.newBuilder(adaptation_).mergeFrom(value).buildPartial(); + } else { + adaptation_ = value; + } + onChanged(); + } else { + adaptationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + */ + public Builder clearAdaptation() { + if (adaptationBuilder_ == null) { + adaptation_ = null; + onChanged(); + } else { + adaptation_ = null; + adaptationBuilder_ = null; + } + + return this; + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + */ + public com.google.cloud.speech.v1.SpeechAdaptation.Builder getAdaptationBuilder() { + + onChanged(); + return getAdaptationFieldBuilder().getBuilder(); + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + */ + public com.google.cloud.speech.v1.SpeechAdaptationOrBuilder getAdaptationOrBuilder() { + if (adaptationBuilder_ != null) { + return adaptationBuilder_.getMessageOrBuilder(); + } else { + return adaptation_ == null ? + com.google.cloud.speech.v1.SpeechAdaptation.getDefaultInstance() : adaptation_; + } + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeechAdaptation, com.google.cloud.speech.v1.SpeechAdaptation.Builder, com.google.cloud.speech.v1.SpeechAdaptationOrBuilder> + getAdaptationFieldBuilder() { + if (adaptationBuilder_ == null) { + adaptationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeechAdaptation, com.google.cloud.speech.v1.SpeechAdaptation.Builder, com.google.cloud.speech.v1.SpeechAdaptationOrBuilder>( + getAdaptation(), + getParentForChildren(), + isClean()); + adaptation_ = null; + } + return adaptationBuilder_; + } + + private java.util.List speechContexts_ = + java.util.Collections.emptyList(); + private void ensureSpeechContextsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + speechContexts_ = new java.util.ArrayList(speechContexts_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechContext, com.google.cloud.speech.v1.SpeechContext.Builder, com.google.cloud.speech.v1.SpeechContextOrBuilder> speechContextsBuilder_; + + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public java.util.List getSpeechContextsList() { + if (speechContextsBuilder_ == null) { + return java.util.Collections.unmodifiableList(speechContexts_); + } else { + return speechContextsBuilder_.getMessageList(); + } + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public int getSpeechContextsCount() { + if (speechContextsBuilder_ == null) { + return speechContexts_.size(); + } else { + return speechContextsBuilder_.getCount(); + } + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public com.google.cloud.speech.v1.SpeechContext getSpeechContexts(int index) { + if (speechContextsBuilder_ == null) { + return speechContexts_.get(index); + } else { + return speechContextsBuilder_.getMessage(index); + } + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public Builder setSpeechContexts( + int index, com.google.cloud.speech.v1.SpeechContext value) { + if (speechContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeechContextsIsMutable(); + speechContexts_.set(index, value); + onChanged(); + } else { + speechContextsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public Builder setSpeechContexts( + int index, com.google.cloud.speech.v1.SpeechContext.Builder builderForValue) { + if (speechContextsBuilder_ == null) { + ensureSpeechContextsIsMutable(); + speechContexts_.set(index, builderForValue.build()); + onChanged(); + } else { + speechContextsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public Builder addSpeechContexts(com.google.cloud.speech.v1.SpeechContext value) { + if (speechContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeechContextsIsMutable(); + speechContexts_.add(value); + onChanged(); + } else { + speechContextsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public Builder addSpeechContexts( + int index, com.google.cloud.speech.v1.SpeechContext value) { + if (speechContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeechContextsIsMutable(); + speechContexts_.add(index, value); + onChanged(); + } else { + speechContextsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public Builder addSpeechContexts( + com.google.cloud.speech.v1.SpeechContext.Builder builderForValue) { + if (speechContextsBuilder_ == null) { + ensureSpeechContextsIsMutable(); + speechContexts_.add(builderForValue.build()); + onChanged(); + } else { + speechContextsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public Builder addSpeechContexts( + int index, com.google.cloud.speech.v1.SpeechContext.Builder builderForValue) { + if (speechContextsBuilder_ == null) { + ensureSpeechContextsIsMutable(); + speechContexts_.add(index, builderForValue.build()); + onChanged(); + } else { + speechContextsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public Builder addAllSpeechContexts( + java.lang.Iterable values) { + if (speechContextsBuilder_ == null) { + ensureSpeechContextsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, speechContexts_); + onChanged(); + } else { + speechContextsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public Builder clearSpeechContexts() { + if (speechContextsBuilder_ == null) { + speechContexts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + speechContextsBuilder_.clear(); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public Builder removeSpeechContexts(int index) { + if (speechContextsBuilder_ == null) { + ensureSpeechContextsIsMutable(); + speechContexts_.remove(index); + onChanged(); + } else { + speechContextsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public com.google.cloud.speech.v1.SpeechContext.Builder getSpeechContextsBuilder( + int index) { + return getSpeechContextsFieldBuilder().getBuilder(index); + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public com.google.cloud.speech.v1.SpeechContextOrBuilder getSpeechContextsOrBuilder( + int index) { + if (speechContextsBuilder_ == null) { + return speechContexts_.get(index); } else { + return speechContextsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public java.util.List + getSpeechContextsOrBuilderList() { + if (speechContextsBuilder_ != null) { + return speechContextsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(speechContexts_); + } + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public com.google.cloud.speech.v1.SpeechContext.Builder addSpeechContextsBuilder() { + return getSpeechContextsFieldBuilder().addBuilder( + com.google.cloud.speech.v1.SpeechContext.getDefaultInstance()); + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public com.google.cloud.speech.v1.SpeechContext.Builder addSpeechContextsBuilder( + int index) { + return getSpeechContextsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.SpeechContext.getDefaultInstance()); + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + public java.util.List + getSpeechContextsBuilderList() { + return getSpeechContextsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechContext, com.google.cloud.speech.v1.SpeechContext.Builder, com.google.cloud.speech.v1.SpeechContextOrBuilder> + getSpeechContextsFieldBuilder() { + if (speechContextsBuilder_ == null) { + speechContextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechContext, com.google.cloud.speech.v1.SpeechContext.Builder, com.google.cloud.speech.v1.SpeechContextOrBuilder>( + speechContexts_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + speechContexts_ = null; + } + return speechContextsBuilder_; + } + + private boolean enableWordTimeOffsets_ ; + /** + *
+     * If `true`, the top result includes a list of words and
+     * the start and end time offsets (timestamps) for those words. If
+     * `false`, no word-level time offset information is returned. The default is
+     * `false`.
+     * 
+ * + * bool enable_word_time_offsets = 8; + * @return The enableWordTimeOffsets. + */ + @java.lang.Override + public boolean getEnableWordTimeOffsets() { + return enableWordTimeOffsets_; + } + /** + *
+     * If `true`, the top result includes a list of words and
+     * the start and end time offsets (timestamps) for those words. If
+     * `false`, no word-level time offset information is returned. The default is
+     * `false`.
+     * 
+ * + * bool enable_word_time_offsets = 8; + * @param value The enableWordTimeOffsets to set. + * @return This builder for chaining. + */ + public Builder setEnableWordTimeOffsets(boolean value) { + + enableWordTimeOffsets_ = value; + onChanged(); + return this; + } + /** + *
+     * If `true`, the top result includes a list of words and
+     * the start and end time offsets (timestamps) for those words. If
+     * `false`, no word-level time offset information is returned. The default is
+     * `false`.
+     * 
+ * + * bool enable_word_time_offsets = 8; + * @return This builder for chaining. + */ + public Builder clearEnableWordTimeOffsets() { + + enableWordTimeOffsets_ = false; + onChanged(); + return this; + } + + private boolean enableWordConfidence_ ; + /** + *
+     * If `true`, the top result includes a list of words and the
+     * confidence for those words. If `false`, no word-level confidence
+     * information is returned. The default is `false`.
+     * 
+ * + * bool enable_word_confidence = 15; + * @return The enableWordConfidence. + */ + @java.lang.Override + public boolean getEnableWordConfidence() { + return enableWordConfidence_; + } + /** + *
+     * If `true`, the top result includes a list of words and the
+     * confidence for those words. If `false`, no word-level confidence
+     * information is returned. The default is `false`.
+     * 
+ * + * bool enable_word_confidence = 15; + * @param value The enableWordConfidence to set. + * @return This builder for chaining. + */ + public Builder setEnableWordConfidence(boolean value) { + + enableWordConfidence_ = value; + onChanged(); + return this; + } + /** + *
+     * If `true`, the top result includes a list of words and the
+     * confidence for those words. If `false`, no word-level confidence
+     * information is returned. The default is `false`.
+     * 
+ * + * bool enable_word_confidence = 15; + * @return This builder for chaining. + */ + public Builder clearEnableWordConfidence() { + + enableWordConfidence_ = false; + onChanged(); + return this; + } + + private boolean enableAutomaticPunctuation_ ; + /** + *
+     * If 'true', adds punctuation to recognition result hypotheses.
+     * This feature is only available in select languages. Setting this for
+     * requests in other languages has no effect at all.
+     * The default 'false' value does not add punctuation to result hypotheses.
+     * 
+ * + * bool enable_automatic_punctuation = 11; + * @return The enableAutomaticPunctuation. + */ + @java.lang.Override + public boolean getEnableAutomaticPunctuation() { + return enableAutomaticPunctuation_; + } + /** + *
+     * If 'true', adds punctuation to recognition result hypotheses.
+     * This feature is only available in select languages. Setting this for
+     * requests in other languages has no effect at all.
+     * The default 'false' value does not add punctuation to result hypotheses.
+     * 
+ * + * bool enable_automatic_punctuation = 11; + * @param value The enableAutomaticPunctuation to set. + * @return This builder for chaining. + */ + public Builder setEnableAutomaticPunctuation(boolean value) { + + enableAutomaticPunctuation_ = value; + onChanged(); + return this; + } + /** + *
+     * If 'true', adds punctuation to recognition result hypotheses.
+     * This feature is only available in select languages. Setting this for
+     * requests in other languages has no effect at all.
+     * The default 'false' value does not add punctuation to result hypotheses.
+     * 
+ * + * bool enable_automatic_punctuation = 11; + * @return This builder for chaining. + */ + public Builder clearEnableAutomaticPunctuation() { + + enableAutomaticPunctuation_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue enableSpokenPunctuation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> enableSpokenPunctuationBuilder_; + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + * @return Whether the enableSpokenPunctuation field is set. + */ + public boolean hasEnableSpokenPunctuation() { + return enableSpokenPunctuationBuilder_ != null || enableSpokenPunctuation_ != null; + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + * @return The enableSpokenPunctuation. + */ + public com.google.protobuf.BoolValue getEnableSpokenPunctuation() { + if (enableSpokenPunctuationBuilder_ == null) { + return enableSpokenPunctuation_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenPunctuation_; + } else { + return enableSpokenPunctuationBuilder_.getMessage(); + } + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + public Builder setEnableSpokenPunctuation(com.google.protobuf.BoolValue value) { + if (enableSpokenPunctuationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enableSpokenPunctuation_ = value; + onChanged(); + } else { + enableSpokenPunctuationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + public Builder setEnableSpokenPunctuation( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (enableSpokenPunctuationBuilder_ == null) { + enableSpokenPunctuation_ = builderForValue.build(); + onChanged(); + } else { + enableSpokenPunctuationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + public Builder mergeEnableSpokenPunctuation(com.google.protobuf.BoolValue value) { + if (enableSpokenPunctuationBuilder_ == null) { + if (enableSpokenPunctuation_ != null) { + enableSpokenPunctuation_ = + com.google.protobuf.BoolValue.newBuilder(enableSpokenPunctuation_).mergeFrom(value).buildPartial(); + } else { + enableSpokenPunctuation_ = value; + } + onChanged(); + } else { + enableSpokenPunctuationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + public Builder clearEnableSpokenPunctuation() { + if (enableSpokenPunctuationBuilder_ == null) { + enableSpokenPunctuation_ = null; + onChanged(); + } else { + enableSpokenPunctuation_ = null; + enableSpokenPunctuationBuilder_ = null; + } + + return this; + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + public com.google.protobuf.BoolValue.Builder getEnableSpokenPunctuationBuilder() { + + onChanged(); + return getEnableSpokenPunctuationFieldBuilder().getBuilder(); + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + public com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilder() { + if (enableSpokenPunctuationBuilder_ != null) { + return enableSpokenPunctuationBuilder_.getMessageOrBuilder(); + } else { + return enableSpokenPunctuation_ == null ? + com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenPunctuation_; + } + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> + getEnableSpokenPunctuationFieldBuilder() { + if (enableSpokenPunctuationBuilder_ == null) { + enableSpokenPunctuationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder>( + getEnableSpokenPunctuation(), + getParentForChildren(), + isClean()); + enableSpokenPunctuation_ = null; + } + return enableSpokenPunctuationBuilder_; + } + + private com.google.protobuf.BoolValue enableSpokenEmojis_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> enableSpokenEmojisBuilder_; + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + * @return Whether the enableSpokenEmojis field is set. + */ + public boolean hasEnableSpokenEmojis() { + return enableSpokenEmojisBuilder_ != null || enableSpokenEmojis_ != null; + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + * @return The enableSpokenEmojis. + */ + public com.google.protobuf.BoolValue getEnableSpokenEmojis() { + if (enableSpokenEmojisBuilder_ == null) { + return enableSpokenEmojis_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenEmojis_; + } else { + return enableSpokenEmojisBuilder_.getMessage(); + } + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + public Builder setEnableSpokenEmojis(com.google.protobuf.BoolValue value) { + if (enableSpokenEmojisBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enableSpokenEmojis_ = value; + onChanged(); + } else { + enableSpokenEmojisBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + public Builder setEnableSpokenEmojis( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (enableSpokenEmojisBuilder_ == null) { + enableSpokenEmojis_ = builderForValue.build(); + onChanged(); + } else { + enableSpokenEmojisBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + public Builder mergeEnableSpokenEmojis(com.google.protobuf.BoolValue value) { + if (enableSpokenEmojisBuilder_ == null) { + if (enableSpokenEmojis_ != null) { + enableSpokenEmojis_ = + com.google.protobuf.BoolValue.newBuilder(enableSpokenEmojis_).mergeFrom(value).buildPartial(); + } else { + enableSpokenEmojis_ = value; + } + onChanged(); + } else { + enableSpokenEmojisBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + public Builder clearEnableSpokenEmojis() { + if (enableSpokenEmojisBuilder_ == null) { + enableSpokenEmojis_ = null; + onChanged(); + } else { + enableSpokenEmojis_ = null; + enableSpokenEmojisBuilder_ = null; + } + + return this; + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + public com.google.protobuf.BoolValue.Builder getEnableSpokenEmojisBuilder() { + + onChanged(); + return getEnableSpokenEmojisFieldBuilder().getBuilder(); + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + public com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder() { + if (enableSpokenEmojisBuilder_ != null) { + return enableSpokenEmojisBuilder_.getMessageOrBuilder(); + } else { + return enableSpokenEmojis_ == null ? + com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenEmojis_; + } + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> + getEnableSpokenEmojisFieldBuilder() { + if (enableSpokenEmojisBuilder_ == null) { + enableSpokenEmojisBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder>( + getEnableSpokenEmojis(), + getParentForChildren(), + isClean()); + enableSpokenEmojis_ = null; + } + return enableSpokenEmojisBuilder_; + } + + private com.google.cloud.speech.v1.SpeakerDiarizationConfig diarizationConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeakerDiarizationConfig, com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder, com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder> diarizationConfigBuilder_; + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + * @return Whether the diarizationConfig field is set. + */ + public boolean hasDiarizationConfig() { + return diarizationConfigBuilder_ != null || diarizationConfig_ != null; + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + * @return The diarizationConfig. + */ + public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDiarizationConfig() { + if (diarizationConfigBuilder_ == null) { + return diarizationConfig_ == null ? com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance() : diarizationConfig_; + } else { + return diarizationConfigBuilder_.getMessage(); + } + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + */ + public Builder setDiarizationConfig(com.google.cloud.speech.v1.SpeakerDiarizationConfig value) { + if (diarizationConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diarizationConfig_ = value; + onChanged(); + } else { + diarizationConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + */ + public Builder setDiarizationConfig( + com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder builderForValue) { + if (diarizationConfigBuilder_ == null) { + diarizationConfig_ = builderForValue.build(); + onChanged(); + } else { + diarizationConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + */ + public Builder mergeDiarizationConfig(com.google.cloud.speech.v1.SpeakerDiarizationConfig value) { + if (diarizationConfigBuilder_ == null) { + if (diarizationConfig_ != null) { + diarizationConfig_ = + com.google.cloud.speech.v1.SpeakerDiarizationConfig.newBuilder(diarizationConfig_).mergeFrom(value).buildPartial(); + } else { + diarizationConfig_ = value; + } + onChanged(); + } else { + diarizationConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + */ + public Builder clearDiarizationConfig() { + if (diarizationConfigBuilder_ == null) { + diarizationConfig_ = null; + onChanged(); + } else { + diarizationConfig_ = null; + diarizationConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + */ + public com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder getDiarizationConfigBuilder() { + + onChanged(); + return getDiarizationConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + */ + public com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder() { + if (diarizationConfigBuilder_ != null) { + return diarizationConfigBuilder_.getMessageOrBuilder(); + } else { + return diarizationConfig_ == null ? + com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance() : diarizationConfig_; + } + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeakerDiarizationConfig, com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder, com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder> + getDiarizationConfigFieldBuilder() { + if (diarizationConfigBuilder_ == null) { + diarizationConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.SpeakerDiarizationConfig, com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder, com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder>( + getDiarizationConfig(), + getParentForChildren(), + isClean()); + diarizationConfig_ = null; + } + return diarizationConfigBuilder_; + } + + private com.google.cloud.speech.v1.RecognitionMetadata metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionMetadata, com.google.cloud.speech.v1.RecognitionMetadata.Builder, com.google.cloud.speech.v1.RecognitionMetadataOrBuilder> metadataBuilder_; + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + * @return The metadata. + */ + public com.google.cloud.speech.v1.RecognitionMetadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + */ + public Builder setMetadata(com.google.cloud.speech.v1.RecognitionMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + */ + public Builder setMetadata( + com.google.cloud.speech.v1.RecognitionMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + */ + public Builder mergeMetadata(com.google.cloud.speech.v1.RecognitionMetadata value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.cloud.speech.v1.RecognitionMetadata.newBuilder(metadata_).mergeFrom(value).buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + */ + public com.google.cloud.speech.v1.RecognitionMetadata.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + */ + public com.google.cloud.speech.v1.RecognitionMetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? + com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance() : metadata_; + } + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionMetadata, com.google.cloud.speech.v1.RecognitionMetadata.Builder, com.google.cloud.speech.v1.RecognitionMetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionMetadata, com.google.cloud.speech.v1.RecognitionMetadata.Builder, com.google.cloud.speech.v1.RecognitionMetadataOrBuilder>( + getMetadata(), + getParentForChildren(), + isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private java.lang.Object model_ = ""; + /** + *
+     * Which model to select for the given request. Select the model
+     * best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the RecognitionConfig.
+     * <table>
+     *   <tr>
+     *     <td><b>Model</b></td>
+     *     <td><b>Description</b></td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_long</code></td>
+     *     <td>Best for long form content like media or conversation.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_short</code></td>
+     *     <td>Best for short form content like commands or single shot directed
+     *     speech.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>command_and_search</code></td>
+     *     <td>Best for short queries such as voice commands or voice search.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>phone_call</code></td>
+     *     <td>Best for audio that originated from a phone call (typically
+     *     recorded at an 8khz sampling rate).</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>video</code></td>
+     *     <td>Best for audio that originated from video or includes multiple
+     *         speakers. Ideally the audio is recorded at a 16khz or greater
+     *         sampling rate. This is a premium model that costs more than the
+     *         standard rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>default</code></td>
+     *     <td>Best for audio that is not one of the specific audio models.
+     *         For example, long-form audio. Ideally the audio is high-fidelity,
+     *         recorded at a 16khz or greater sampling rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_conversation</code></td>
+     *     <td>Best for audio that originated from a conversation between a
+     *         medical provider and patient.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_dictation</code></td>
+     *     <td>Best for audio that originated from dictation notes by a medical
+     *         provider.</td>
+     *   </tr>
+     * </table>
+     * 
+ * + * string model = 13; + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Which model to select for the given request. Select the model
+     * best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the RecognitionConfig.
+     * <table>
+     *   <tr>
+     *     <td><b>Model</b></td>
+     *     <td><b>Description</b></td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_long</code></td>
+     *     <td>Best for long form content like media or conversation.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_short</code></td>
+     *     <td>Best for short form content like commands or single shot directed
+     *     speech.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>command_and_search</code></td>
+     *     <td>Best for short queries such as voice commands or voice search.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>phone_call</code></td>
+     *     <td>Best for audio that originated from a phone call (typically
+     *     recorded at an 8khz sampling rate).</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>video</code></td>
+     *     <td>Best for audio that originated from video or includes multiple
+     *         speakers. Ideally the audio is recorded at a 16khz or greater
+     *         sampling rate. This is a premium model that costs more than the
+     *         standard rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>default</code></td>
+     *     <td>Best for audio that is not one of the specific audio models.
+     *         For example, long-form audio. Ideally the audio is high-fidelity,
+     *         recorded at a 16khz or greater sampling rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_conversation</code></td>
+     *     <td>Best for audio that originated from a conversation between a
+     *         medical provider and patient.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_dictation</code></td>
+     *     <td>Best for audio that originated from dictation notes by a medical
+     *         provider.</td>
+     *   </tr>
+     * </table>
+     * 
+ * + * string model = 13; + * @return The bytes for model. + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Which model to select for the given request. Select the model
+     * best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the RecognitionConfig.
+     * <table>
+     *   <tr>
+     *     <td><b>Model</b></td>
+     *     <td><b>Description</b></td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_long</code></td>
+     *     <td>Best for long form content like media or conversation.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_short</code></td>
+     *     <td>Best for short form content like commands or single shot directed
+     *     speech.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>command_and_search</code></td>
+     *     <td>Best for short queries such as voice commands or voice search.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>phone_call</code></td>
+     *     <td>Best for audio that originated from a phone call (typically
+     *     recorded at an 8khz sampling rate).</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>video</code></td>
+     *     <td>Best for audio that originated from video or includes multiple
+     *         speakers. Ideally the audio is recorded at a 16khz or greater
+     *         sampling rate. This is a premium model that costs more than the
+     *         standard rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>default</code></td>
+     *     <td>Best for audio that is not one of the specific audio models.
+     *         For example, long-form audio. Ideally the audio is high-fidelity,
+     *         recorded at a 16khz or greater sampling rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_conversation</code></td>
+     *     <td>Best for audio that originated from a conversation between a
+     *         medical provider and patient.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_dictation</code></td>
+     *     <td>Best for audio that originated from dictation notes by a medical
+     *         provider.</td>
+     *   </tr>
+     * </table>
+     * 
+ * + * string model = 13; + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + model_ = value; + onChanged(); + return this; + } + /** + *
+     * Which model to select for the given request. Select the model
+     * best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the RecognitionConfig.
+     * <table>
+     *   <tr>
+     *     <td><b>Model</b></td>
+     *     <td><b>Description</b></td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_long</code></td>
+     *     <td>Best for long form content like media or conversation.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_short</code></td>
+     *     <td>Best for short form content like commands or single shot directed
+     *     speech.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>command_and_search</code></td>
+     *     <td>Best for short queries such as voice commands or voice search.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>phone_call</code></td>
+     *     <td>Best for audio that originated from a phone call (typically
+     *     recorded at an 8khz sampling rate).</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>video</code></td>
+     *     <td>Best for audio that originated from video or includes multiple
+     *         speakers. Ideally the audio is recorded at a 16khz or greater
+     *         sampling rate. This is a premium model that costs more than the
+     *         standard rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>default</code></td>
+     *     <td>Best for audio that is not one of the specific audio models.
+     *         For example, long-form audio. Ideally the audio is high-fidelity,
+     *         recorded at a 16khz or greater sampling rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_conversation</code></td>
+     *     <td>Best for audio that originated from a conversation between a
+     *         medical provider and patient.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_dictation</code></td>
+     *     <td>Best for audio that originated from dictation notes by a medical
+     *         provider.</td>
+     *   </tr>
+     * </table>
+     * 
+ * + * string model = 13; + * @return This builder for chaining. + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + *
+     * Which model to select for the given request. Select the model
+     * best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the RecognitionConfig.
+     * <table>
+     *   <tr>
+     *     <td><b>Model</b></td>
+     *     <td><b>Description</b></td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_long</code></td>
+     *     <td>Best for long form content like media or conversation.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_short</code></td>
+     *     <td>Best for short form content like commands or single shot directed
+     *     speech.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>command_and_search</code></td>
+     *     <td>Best for short queries such as voice commands or voice search.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>phone_call</code></td>
+     *     <td>Best for audio that originated from a phone call (typically
+     *     recorded at an 8khz sampling rate).</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>video</code></td>
+     *     <td>Best for audio that originated from video or includes multiple
+     *         speakers. Ideally the audio is recorded at a 16khz or greater
+     *         sampling rate. This is a premium model that costs more than the
+     *         standard rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>default</code></td>
+     *     <td>Best for audio that is not one of the specific audio models.
+     *         For example, long-form audio. Ideally the audio is high-fidelity,
+     *         recorded at a 16khz or greater sampling rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_conversation</code></td>
+     *     <td>Best for audio that originated from a conversation between a
+     *         medical provider and patient.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_dictation</code></td>
+     *     <td>Best for audio that originated from dictation notes by a medical
+     *         provider.</td>
+     *   </tr>
+     * </table>
+     * 
+ * + * string model = 13; + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + model_ = value; + onChanged(); + return this; + } + + private boolean useEnhanced_ ; + /** + *
+     * Set to true to use an enhanced model for speech recognition.
+     * If `use_enhanced` is set to true and the `model` field is not set, then
+     * an appropriate enhanced model is chosen if an enhanced model exists for
+     * the audio.
+     * If `use_enhanced` is true and an enhanced version of the specified model
+     * does not exist, then the speech is recognized using the standard version
+     * of the specified model.
+     * 
+ * + * bool use_enhanced = 14; + * @return The useEnhanced. + */ + @java.lang.Override + public boolean getUseEnhanced() { + return useEnhanced_; + } + /** + *
+     * Set to true to use an enhanced model for speech recognition.
+     * If `use_enhanced` is set to true and the `model` field is not set, then
+     * an appropriate enhanced model is chosen if an enhanced model exists for
+     * the audio.
+     * If `use_enhanced` is true and an enhanced version of the specified model
+     * does not exist, then the speech is recognized using the standard version
+     * of the specified model.
+     * 
+ * + * bool use_enhanced = 14; + * @param value The useEnhanced to set. + * @return This builder for chaining. + */ + public Builder setUseEnhanced(boolean value) { + + useEnhanced_ = value; + onChanged(); + return this; + } + /** + *
+     * Set to true to use an enhanced model for speech recognition.
+     * If `use_enhanced` is set to true and the `model` field is not set, then
+     * an appropriate enhanced model is chosen if an enhanced model exists for
+     * the audio.
+     * If `use_enhanced` is true and an enhanced version of the specified model
+     * does not exist, then the speech is recognized using the standard version
+     * of the specified model.
+     * 
+ * + * bool use_enhanced = 14; + * @return This builder for chaining. + */ + public Builder clearUseEnhanced() { + + useEnhanced_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.RecognitionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionConfig) + private static final com.google.cloud.speech.v1.RecognitionConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognitionConfig(); + } + + public static com.google.cloud.speech.v1.RecognitionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecognitionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecognitionConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java new file mode 100644 index 000000000000..a07304d06265 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java @@ -0,0 +1,660 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface RecognitionConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognitionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Encoding of audio data sent in all `RecognitionAudio` messages.
+   * This field is optional for `FLAC` and `WAV` audio files and required
+   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; + * @return The enum numeric value on the wire for encoding. + */ + int getEncodingValue(); + /** + *
+   * Encoding of audio data sent in all `RecognitionAudio` messages.
+   * This field is optional for `FLAC` and `WAV` audio files and required
+   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; + * @return The encoding. + */ + com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding getEncoding(); + + /** + *
+   * Sample rate in Hertz of the audio data sent in all
+   * `RecognitionAudio` messages. Valid values are: 8000-48000.
+   * 16000 is optimal. For best results, set the sampling rate of the audio
+   * source to 16000 Hz. If that's not possible, use the native sample rate of
+   * the audio source (instead of re-sampling).
+   * This field is optional for FLAC and WAV audio files, but is
+   * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
+   * 
+ * + * int32 sample_rate_hertz = 2; + * @return The sampleRateHertz. + */ + int getSampleRateHertz(); + + /** + *
+   * The number of channels in the input audio data.
+   * ONLY set this for MULTI-CHANNEL recognition.
+   * Valid values for LINEAR16 and FLAC are `1`-`8`.
+   * Valid values for OGG_OPUS are '1'-'254'.
+   * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
+   * If `0` or omitted, defaults to one channel (mono).
+   * Note: We only recognize the first channel by default.
+   * To perform independent recognition on each channel set
+   * `enable_separate_recognition_per_channel` to 'true'.
+   * 
+ * + * int32 audio_channel_count = 7; + * @return The audioChannelCount. + */ + int getAudioChannelCount(); + + /** + *
+   * This needs to be set to `true` explicitly and `audio_channel_count` > 1
+   * to get each channel recognized separately. The recognition result will
+   * contain a `channel_tag` field to state which channel that result belongs
+   * to. If this is not true, we will only recognize the first channel. The
+   * request is billed cumulatively for all channels recognized:
+   * `audio_channel_count` multiplied by the length of the audio.
+   * 
+ * + * bool enable_separate_recognition_per_channel = 12; + * @return The enableSeparateRecognitionPerChannel. + */ + boolean getEnableSeparateRecognitionPerChannel(); + + /** + *
+   * Required. The language of the supplied audio as a
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+   * Example: "en-US".
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes.
+   * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + *
+   * Required. The language of the supplied audio as a
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+   * Example: "en-US".
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes.
+   * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString + getLanguageCodeBytes(); + + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @return A list containing the alternativeLanguageCodes. + */ + java.util.List + getAlternativeLanguageCodesList(); + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @return The count of alternativeLanguageCodes. + */ + int getAlternativeLanguageCodesCount(); + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index of the element to return. + * @return The alternativeLanguageCodes at the given index. + */ + java.lang.String getAlternativeLanguageCodes(int index); + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index of the value to return. + * @return The bytes of the alternativeLanguageCodes at the given index. + */ + com.google.protobuf.ByteString + getAlternativeLanguageCodesBytes(int index); + + /** + *
+   * Maximum number of recognition hypotheses to be returned.
+   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
+   * within each `SpeechRecognitionResult`.
+   * The server may return fewer than `max_alternatives`.
+   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
+   * one. If omitted, will return a maximum of one.
+   * 
+ * + * int32 max_alternatives = 4; + * @return The maxAlternatives. + */ + int getMaxAlternatives(); + + /** + *
+   * If set to `true`, the server will attempt to filter out
+   * profanities, replacing all but the initial character in each filtered word
+   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
+   * won't be filtered out.
+   * 
+ * + * bool profanity_filter = 5; + * @return The profanityFilter. + */ + boolean getProfanityFilter(); + + /** + *
+   * Speech adaptation configuration improves the accuracy of speech
+   * recognition. For more information, see the [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+   * documentation.
+   * When speech adaptation is set it supersedes the `speech_contexts` field.
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + * @return Whether the adaptation field is set. + */ + boolean hasAdaptation(); + /** + *
+   * Speech adaptation configuration improves the accuracy of speech
+   * recognition. For more information, see the [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+   * documentation.
+   * When speech adaptation is set it supersedes the `speech_contexts` field.
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + * @return The adaptation. + */ + com.google.cloud.speech.v1.SpeechAdaptation getAdaptation(); + /** + *
+   * Speech adaptation configuration improves the accuracy of speech
+   * recognition. For more information, see the [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+   * documentation.
+   * When speech adaptation is set it supersedes the `speech_contexts` field.
+   * 
+ * + * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; + */ + com.google.cloud.speech.v1.SpeechAdaptationOrBuilder getAdaptationOrBuilder(); + + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + java.util.List + getSpeechContextsList(); + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + com.google.cloud.speech.v1.SpeechContext getSpeechContexts(int index); + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + int getSpeechContextsCount(); + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + java.util.List + getSpeechContextsOrBuilderList(); + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; + */ + com.google.cloud.speech.v1.SpeechContextOrBuilder getSpeechContextsOrBuilder( + int index); + + /** + *
+   * If `true`, the top result includes a list of words and
+   * the start and end time offsets (timestamps) for those words. If
+   * `false`, no word-level time offset information is returned. The default is
+   * `false`.
+   * 
+ * + * bool enable_word_time_offsets = 8; + * @return The enableWordTimeOffsets. + */ + boolean getEnableWordTimeOffsets(); + + /** + *
+   * If `true`, the top result includes a list of words and the
+   * confidence for those words. If `false`, no word-level confidence
+   * information is returned. The default is `false`.
+   * 
+ * + * bool enable_word_confidence = 15; + * @return The enableWordConfidence. + */ + boolean getEnableWordConfidence(); + + /** + *
+   * If 'true', adds punctuation to recognition result hypotheses.
+   * This feature is only available in select languages. Setting this for
+   * requests in other languages has no effect at all.
+   * The default 'false' value does not add punctuation to result hypotheses.
+   * 
+ * + * bool enable_automatic_punctuation = 11; + * @return The enableAutomaticPunctuation. + */ + boolean getEnableAutomaticPunctuation(); + + /** + *
+   * The spoken punctuation behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * e.g. command_and_search will enable spoken punctuation by default
+   * If 'true', replaces spoken punctuation with the corresponding symbols in
+   * the request. For example, "how are you question mark" becomes "how are
+   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+   * for support. If 'false', spoken punctuation is not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + * @return Whether the enableSpokenPunctuation field is set. + */ + boolean hasEnableSpokenPunctuation(); + /** + *
+   * The spoken punctuation behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * e.g. command_and_search will enable spoken punctuation by default
+   * If 'true', replaces spoken punctuation with the corresponding symbols in
+   * the request. For example, "how are you question mark" becomes "how are
+   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+   * for support. If 'false', spoken punctuation is not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + * @return The enableSpokenPunctuation. + */ + com.google.protobuf.BoolValue getEnableSpokenPunctuation(); + /** + *
+   * The spoken punctuation behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * e.g. command_and_search will enable spoken punctuation by default
+   * If 'true', replaces spoken punctuation with the corresponding symbols in
+   * the request. For example, "how are you question mark" becomes "how are
+   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+   * for support. If 'false', spoken punctuation is not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilder(); + + /** + *
+   * The spoken emoji behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * If 'true', adds spoken emoji formatting for the request. This will replace
+   * spoken emojis with the corresponding Unicode symbols in the final
+   * transcript. If 'false', spoken emojis are not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + * @return Whether the enableSpokenEmojis field is set. + */ + boolean hasEnableSpokenEmojis(); + /** + *
+   * The spoken emoji behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * If 'true', adds spoken emoji formatting for the request. This will replace
+   * spoken emojis with the corresponding Unicode symbols in the final
+   * transcript. If 'false', spoken emojis are not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + * @return The enableSpokenEmojis. + */ + com.google.protobuf.BoolValue getEnableSpokenEmojis(); + /** + *
+   * The spoken emoji behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * If 'true', adds spoken emoji formatting for the request. This will replace
+   * spoken emojis with the corresponding Unicode symbols in the final
+   * transcript. If 'false', spoken emojis are not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder(); + + /** + *
+   * Config to enable speaker diarization and set additional
+   * parameters to make diarization better suited for your application.
+   * Note: When this is enabled, we send all the words from the beginning of the
+   * audio for the top alternative in every consecutive STREAMING responses.
+   * This is done in order to improve our speaker tags as our models learn to
+   * identify the speakers in the conversation over time.
+   * For non-streaming requests, the diarization results will be provided only
+   * in the top alternative of the FINAL SpeechRecognitionResult.
+   * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + * @return Whether the diarizationConfig field is set. + */ + boolean hasDiarizationConfig(); + /** + *
+   * Config to enable speaker diarization and set additional
+   * parameters to make diarization better suited for your application.
+   * Note: When this is enabled, we send all the words from the beginning of the
+   * audio for the top alternative in every consecutive STREAMING responses.
+   * This is done in order to improve our speaker tags as our models learn to
+   * identify the speakers in the conversation over time.
+   * For non-streaming requests, the diarization results will be provided only
+   * in the top alternative of the FINAL SpeechRecognitionResult.
+   * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + * @return The diarizationConfig. + */ + com.google.cloud.speech.v1.SpeakerDiarizationConfig getDiarizationConfig(); + /** + *
+   * Config to enable speaker diarization and set additional
+   * parameters to make diarization better suited for your application.
+   * Note: When this is enabled, we send all the words from the beginning of the
+   * audio for the top alternative in every consecutive STREAMING responses.
+   * This is done in order to improve our speaker tags as our models learn to
+   * identify the speakers in the conversation over time.
+   * For non-streaming requests, the diarization results will be provided only
+   * in the top alternative of the FINAL SpeechRecognitionResult.
+   * 
+ * + * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; + */ + com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder(); + + /** + *
+   * Metadata regarding this request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + *
+   * Metadata regarding this request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + * @return The metadata. + */ + com.google.cloud.speech.v1.RecognitionMetadata getMetadata(); + /** + *
+   * Metadata regarding this request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; + */ + com.google.cloud.speech.v1.RecognitionMetadataOrBuilder getMetadataOrBuilder(); + + /** + *
+   * Which model to select for the given request. Select the model
+   * best suited to your domain to get best results. If a model is not
+   * explicitly specified, then we auto-select a model based on the parameters
+   * in the RecognitionConfig.
+   * <table>
+   *   <tr>
+   *     <td><b>Model</b></td>
+   *     <td><b>Description</b></td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_long</code></td>
+   *     <td>Best for long form content like media or conversation.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_short</code></td>
+   *     <td>Best for short form content like commands or single shot directed
+   *     speech.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>command_and_search</code></td>
+   *     <td>Best for short queries such as voice commands or voice search.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>phone_call</code></td>
+   *     <td>Best for audio that originated from a phone call (typically
+   *     recorded at an 8khz sampling rate).</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>video</code></td>
+   *     <td>Best for audio that originated from video or includes multiple
+   *         speakers. Ideally the audio is recorded at a 16khz or greater
+   *         sampling rate. This is a premium model that costs more than the
+   *         standard rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>default</code></td>
+   *     <td>Best for audio that is not one of the specific audio models.
+   *         For example, long-form audio. Ideally the audio is high-fidelity,
+   *         recorded at a 16khz or greater sampling rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_conversation</code></td>
+   *     <td>Best for audio that originated from a conversation between a
+   *         medical provider and patient.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_dictation</code></td>
+   *     <td>Best for audio that originated from dictation notes by a medical
+   *         provider.</td>
+   *   </tr>
+   * </table>
+   * 
+ * + * string model = 13; + * @return The model. + */ + java.lang.String getModel(); + /** + *
+   * Which model to select for the given request. Select the model
+   * best suited to your domain to get best results. If a model is not
+   * explicitly specified, then we auto-select a model based on the parameters
+   * in the RecognitionConfig.
+   * <table>
+   *   <tr>
+   *     <td><b>Model</b></td>
+   *     <td><b>Description</b></td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_long</code></td>
+   *     <td>Best for long form content like media or conversation.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_short</code></td>
+   *     <td>Best for short form content like commands or single shot directed
+   *     speech.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>command_and_search</code></td>
+   *     <td>Best for short queries such as voice commands or voice search.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>phone_call</code></td>
+   *     <td>Best for audio that originated from a phone call (typically
+   *     recorded at an 8khz sampling rate).</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>video</code></td>
+   *     <td>Best for audio that originated from video or includes multiple
+   *         speakers. Ideally the audio is recorded at a 16khz or greater
+   *         sampling rate. This is a premium model that costs more than the
+   *         standard rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>default</code></td>
+   *     <td>Best for audio that is not one of the specific audio models.
+   *         For example, long-form audio. Ideally the audio is high-fidelity,
+   *         recorded at a 16khz or greater sampling rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_conversation</code></td>
+   *     <td>Best for audio that originated from a conversation between a
+   *         medical provider and patient.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_dictation</code></td>
+   *     <td>Best for audio that originated from dictation notes by a medical
+   *         provider.</td>
+   *   </tr>
+   * </table>
+   * 
+ * + * string model = 13; + * @return The bytes for model. + */ + com.google.protobuf.ByteString + getModelBytes(); + + /** + *
+   * Set to true to use an enhanced model for speech recognition.
+   * If `use_enhanced` is set to true and the `model` field is not set, then
+   * an appropriate enhanced model is chosen if an enhanced model exists for
+   * the audio.
+   * If `use_enhanced` is true and an enhanced version of the specified model
+   * does not exist, then the speech is recognized using the standard version
+   * of the specified model.
+   * 
+ * + * bool use_enhanced = 14; + * @return The useEnhanced. + */ + boolean getUseEnhanced(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadata.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadata.java new file mode 100644 index 000000000000..5e39e8ad8a53 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadata.java @@ -0,0 +1,2343 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Description of audio data to be recognized.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.RecognitionMetadata} + */ +@java.lang.Deprecated public final class RecognitionMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognitionMetadata) + RecognitionMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use RecognitionMetadata.newBuilder() to construct. + private RecognitionMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RecognitionMetadata() { + interactionType_ = 0; + microphoneDistance_ = 0; + originalMediaType_ = 0; + recordingDeviceType_ = 0; + recordingDeviceName_ = ""; + originalMimeType_ = ""; + audioTopic_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RecognitionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RecognitionMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + interactionType_ = rawValue; + break; + } + case 24: { + + industryNaicsCodeOfAudio_ = input.readUInt32(); + break; + } + case 32: { + int rawValue = input.readEnum(); + + microphoneDistance_ = rawValue; + break; + } + case 40: { + int rawValue = input.readEnum(); + + originalMediaType_ = rawValue; + break; + } + case 48: { + int rawValue = input.readEnum(); + + recordingDeviceType_ = rawValue; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + recordingDeviceName_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + originalMimeType_ = s; + break; + } + case 82: { + java.lang.String s = input.readStringRequireUtf8(); + + audioTopic_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.RecognitionMetadata.class, com.google.cloud.speech.v1.RecognitionMetadata.Builder.class); + } + + /** + *
+   * Use case categories that the audio recognition request can be described
+   * by.
+   * 
+ * + * Protobuf enum {@code google.cloud.speech.v1.RecognitionMetadata.InteractionType} + */ + public enum InteractionType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Use case is either unknown or is something other than one of the other
+     * values below.
+     * 
+ * + * INTERACTION_TYPE_UNSPECIFIED = 0; + */ + INTERACTION_TYPE_UNSPECIFIED(0), + /** + *
+     * Multiple people in a conversation or discussion. For example in a
+     * meeting with two or more people actively participating. Typically
+     * all the primary people speaking would be in the same room (if not,
+     * see PHONE_CALL)
+     * 
+ * + * DISCUSSION = 1; + */ + DISCUSSION(1), + /** + *
+     * One or more persons lecturing or presenting to others, mostly
+     * uninterrupted.
+     * 
+ * + * PRESENTATION = 2; + */ + PRESENTATION(2), + /** + *
+     * A phone-call or video-conference in which two or more people, who are
+     * not in the same room, are actively participating.
+     * 
+ * + * PHONE_CALL = 3; + */ + PHONE_CALL(3), + /** + *
+     * A recorded message intended for another person to listen to.
+     * 
+ * + * VOICEMAIL = 4; + */ + VOICEMAIL(4), + /** + *
+     * Professionally produced audio (eg. TV Show, Podcast).
+     * 
+ * + * PROFESSIONALLY_PRODUCED = 5; + */ + PROFESSIONALLY_PRODUCED(5), + /** + *
+     * Transcribe spoken questions and queries into text.
+     * 
+ * + * VOICE_SEARCH = 6; + */ + VOICE_SEARCH(6), + /** + *
+     * Transcribe voice commands, such as for controlling a device.
+     * 
+ * + * VOICE_COMMAND = 7; + */ + VOICE_COMMAND(7), + /** + *
+     * Transcribe speech to text to create a written document, such as a
+     * text-message, email or report.
+     * 
+ * + * DICTATION = 8; + */ + DICTATION(8), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Use case is either unknown or is something other than one of the other
+     * values below.
+     * 
+ * + * INTERACTION_TYPE_UNSPECIFIED = 0; + */ + public static final int INTERACTION_TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * Multiple people in a conversation or discussion. For example in a
+     * meeting with two or more people actively participating. Typically
+     * all the primary people speaking would be in the same room (if not,
+     * see PHONE_CALL)
+     * 
+ * + * DISCUSSION = 1; + */ + public static final int DISCUSSION_VALUE = 1; + /** + *
+     * One or more persons lecturing or presenting to others, mostly
+     * uninterrupted.
+     * 
+ * + * PRESENTATION = 2; + */ + public static final int PRESENTATION_VALUE = 2; + /** + *
+     * A phone-call or video-conference in which two or more people, who are
+     * not in the same room, are actively participating.
+     * 
+ * + * PHONE_CALL = 3; + */ + public static final int PHONE_CALL_VALUE = 3; + /** + *
+     * A recorded message intended for another person to listen to.
+     * 
+ * + * VOICEMAIL = 4; + */ + public static final int VOICEMAIL_VALUE = 4; + /** + *
+     * Professionally produced audio (eg. TV Show, Podcast).
+     * 
+ * + * PROFESSIONALLY_PRODUCED = 5; + */ + public static final int PROFESSIONALLY_PRODUCED_VALUE = 5; + /** + *
+     * Transcribe spoken questions and queries into text.
+     * 
+ * + * VOICE_SEARCH = 6; + */ + public static final int VOICE_SEARCH_VALUE = 6; + /** + *
+     * Transcribe voice commands, such as for controlling a device.
+     * 
+ * + * VOICE_COMMAND = 7; + */ + public static final int VOICE_COMMAND_VALUE = 7; + /** + *
+     * Transcribe speech to text to create a written document, such as a
+     * text-message, email or report.
+     * 
+ * + * DICTATION = 8; + */ + public static final int DICTATION_VALUE = 8; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static InteractionType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static InteractionType forNumber(int value) { + switch (value) { + case 0: return INTERACTION_TYPE_UNSPECIFIED; + case 1: return DISCUSSION; + case 2: return PRESENTATION; + case 3: return PHONE_CALL; + case 4: return VOICEMAIL; + case 5: return PROFESSIONALLY_PRODUCED; + case 6: return VOICE_SEARCH; + case 7: return VOICE_COMMAND; + case 8: return DICTATION; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + InteractionType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public InteractionType findValueByNumber(int number) { + return InteractionType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.speech.v1.RecognitionMetadata.getDescriptor().getEnumTypes().get(0); + } + + private static final InteractionType[] VALUES = values(); + + public static InteractionType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private InteractionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionMetadata.InteractionType) + } + + /** + *
+   * Enumerates the types of capture settings describing an audio file.
+   * 
+ * + * Protobuf enum {@code google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance} + */ + public enum MicrophoneDistance + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Audio type is not known.
+     * 
+ * + * MICROPHONE_DISTANCE_UNSPECIFIED = 0; + */ + MICROPHONE_DISTANCE_UNSPECIFIED(0), + /** + *
+     * The audio was captured from a closely placed microphone. Eg. phone,
+     * dictaphone, or handheld microphone. Generally if there speaker is within
+     * 1 meter of the microphone.
+     * 
+ * + * NEARFIELD = 1; + */ + NEARFIELD(1), + /** + *
+     * The speaker if within 3 meters of the microphone.
+     * 
+ * + * MIDFIELD = 2; + */ + MIDFIELD(2), + /** + *
+     * The speaker is more than 3 meters away from the microphone.
+     * 
+ * + * FARFIELD = 3; + */ + FARFIELD(3), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Audio type is not known.
+     * 
+ * + * MICROPHONE_DISTANCE_UNSPECIFIED = 0; + */ + public static final int MICROPHONE_DISTANCE_UNSPECIFIED_VALUE = 0; + /** + *
+     * The audio was captured from a closely placed microphone. Eg. phone,
+     * dictaphone, or handheld microphone. Generally if there speaker is within
+     * 1 meter of the microphone.
+     * 
+ * + * NEARFIELD = 1; + */ + public static final int NEARFIELD_VALUE = 1; + /** + *
+     * The speaker if within 3 meters of the microphone.
+     * 
+ * + * MIDFIELD = 2; + */ + public static final int MIDFIELD_VALUE = 2; + /** + *
+     * The speaker is more than 3 meters away from the microphone.
+     * 
+ * + * FARFIELD = 3; + */ + public static final int FARFIELD_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MicrophoneDistance valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static MicrophoneDistance forNumber(int value) { + switch (value) { + case 0: return MICROPHONE_DISTANCE_UNSPECIFIED; + case 1: return NEARFIELD; + case 2: return MIDFIELD; + case 3: return FARFIELD; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + MicrophoneDistance> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public MicrophoneDistance findValueByNumber(int number) { + return MicrophoneDistance.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.speech.v1.RecognitionMetadata.getDescriptor().getEnumTypes().get(1); + } + + private static final MicrophoneDistance[] VALUES = values(); + + public static MicrophoneDistance valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private MicrophoneDistance(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance) + } + + /** + *
+   * The original media the speech was recorded on.
+   * 
+ * + * Protobuf enum {@code google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType} + */ + public enum OriginalMediaType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unknown original media type.
+     * 
+ * + * ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; + */ + ORIGINAL_MEDIA_TYPE_UNSPECIFIED(0), + /** + *
+     * The speech data is an audio recording.
+     * 
+ * + * AUDIO = 1; + */ + AUDIO(1), + /** + *
+     * The speech data originally recorded on a video.
+     * 
+ * + * VIDEO = 2; + */ + VIDEO(2), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unknown original media type.
+     * 
+ * + * ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; + */ + public static final int ORIGINAL_MEDIA_TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * The speech data is an audio recording.
+     * 
+ * + * AUDIO = 1; + */ + public static final int AUDIO_VALUE = 1; + /** + *
+     * The speech data originally recorded on a video.
+     * 
+ * + * VIDEO = 2; + */ + public static final int VIDEO_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OriginalMediaType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static OriginalMediaType forNumber(int value) { + switch (value) { + case 0: return ORIGINAL_MEDIA_TYPE_UNSPECIFIED; + case 1: return AUDIO; + case 2: return VIDEO; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + OriginalMediaType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public OriginalMediaType findValueByNumber(int number) { + return OriginalMediaType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.speech.v1.RecognitionMetadata.getDescriptor().getEnumTypes().get(2); + } + + private static final OriginalMediaType[] VALUES = values(); + + public static OriginalMediaType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private OriginalMediaType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType) + } + + /** + *
+   * The type of device the speech was recorded with.
+   * 
+ * + * Protobuf enum {@code google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType} + */ + public enum RecordingDeviceType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * The recording device is unknown.
+     * 
+ * + * RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; + */ + RECORDING_DEVICE_TYPE_UNSPECIFIED(0), + /** + *
+     * Speech was recorded on a smartphone.
+     * 
+ * + * SMARTPHONE = 1; + */ + SMARTPHONE(1), + /** + *
+     * Speech was recorded using a personal computer or tablet.
+     * 
+ * + * PC = 2; + */ + PC(2), + /** + *
+     * Speech was recorded over a phone line.
+     * 
+ * + * PHONE_LINE = 3; + */ + PHONE_LINE(3), + /** + *
+     * Speech was recorded in a vehicle.
+     * 
+ * + * VEHICLE = 4; + */ + VEHICLE(4), + /** + *
+     * Speech was recorded outdoors.
+     * 
+ * + * OTHER_OUTDOOR_DEVICE = 5; + */ + OTHER_OUTDOOR_DEVICE(5), + /** + *
+     * Speech was recorded indoors.
+     * 
+ * + * OTHER_INDOOR_DEVICE = 6; + */ + OTHER_INDOOR_DEVICE(6), + UNRECOGNIZED(-1), + ; + + /** + *
+     * The recording device is unknown.
+     * 
+ * + * RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; + */ + public static final int RECORDING_DEVICE_TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * Speech was recorded on a smartphone.
+     * 
+ * + * SMARTPHONE = 1; + */ + public static final int SMARTPHONE_VALUE = 1; + /** + *
+     * Speech was recorded using a personal computer or tablet.
+     * 
+ * + * PC = 2; + */ + public static final int PC_VALUE = 2; + /** + *
+     * Speech was recorded over a phone line.
+     * 
+ * + * PHONE_LINE = 3; + */ + public static final int PHONE_LINE_VALUE = 3; + /** + *
+     * Speech was recorded in a vehicle.
+     * 
+ * + * VEHICLE = 4; + */ + public static final int VEHICLE_VALUE = 4; + /** + *
+     * Speech was recorded outdoors.
+     * 
+ * + * OTHER_OUTDOOR_DEVICE = 5; + */ + public static final int OTHER_OUTDOOR_DEVICE_VALUE = 5; + /** + *
+     * Speech was recorded indoors.
+     * 
+ * + * OTHER_INDOOR_DEVICE = 6; + */ + public static final int OTHER_INDOOR_DEVICE_VALUE = 6; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RecordingDeviceType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RecordingDeviceType forNumber(int value) { + switch (value) { + case 0: return RECORDING_DEVICE_TYPE_UNSPECIFIED; + case 1: return SMARTPHONE; + case 2: return PC; + case 3: return PHONE_LINE; + case 4: return VEHICLE; + case 5: return OTHER_OUTDOOR_DEVICE; + case 6: return OTHER_INDOOR_DEVICE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + RecordingDeviceType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RecordingDeviceType findValueByNumber(int number) { + return RecordingDeviceType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.speech.v1.RecognitionMetadata.getDescriptor().getEnumTypes().get(3); + } + + private static final RecordingDeviceType[] VALUES = values(); + + public static RecordingDeviceType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RecordingDeviceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType) + } + + public static final int INTERACTION_TYPE_FIELD_NUMBER = 1; + private int interactionType_; + /** + *
+   * The use case most closely describing the audio content to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return The enum numeric value on the wire for interactionType. + */ + @java.lang.Override public int getInteractionTypeValue() { + return interactionType_; + } + /** + *
+   * The use case most closely describing the audio content to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return The interactionType. + */ + @java.lang.Override public com.google.cloud.speech.v1.RecognitionMetadata.InteractionType getInteractionType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1.RecognitionMetadata.InteractionType result = com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.valueOf(interactionType_); + return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.UNRECOGNIZED : result; + } + + public static final int INDUSTRY_NAICS_CODE_OF_AUDIO_FIELD_NUMBER = 3; + private int industryNaicsCodeOfAudio_; + /** + *
+   * The industry vertical to which this speech recognition request most
+   * closely applies. This is most indicative of the topics contained
+   * in the audio.  Use the 6-digit NAICS code to identify the industry
+   * vertical - see https://www.naics.com/search/.
+   * 
+ * + * uint32 industry_naics_code_of_audio = 3; + * @return The industryNaicsCodeOfAudio. + */ + @java.lang.Override + public int getIndustryNaicsCodeOfAudio() { + return industryNaicsCodeOfAudio_; + } + + public static final int MICROPHONE_DISTANCE_FIELD_NUMBER = 4; + private int microphoneDistance_; + /** + *
+   * The audio type that most closely describes the audio being recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return The enum numeric value on the wire for microphoneDistance. + */ + @java.lang.Override public int getMicrophoneDistanceValue() { + return microphoneDistance_; + } + /** + *
+   * The audio type that most closely describes the audio being recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return The microphoneDistance. + */ + @java.lang.Override public com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance result = com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.valueOf(microphoneDistance_); + return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.UNRECOGNIZED : result; + } + + public static final int ORIGINAL_MEDIA_TYPE_FIELD_NUMBER = 5; + private int originalMediaType_; + /** + *
+   * The original media the speech was recorded on.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return The enum numeric value on the wire for originalMediaType. + */ + @java.lang.Override public int getOriginalMediaTypeValue() { + return originalMediaType_; + } + /** + *
+   * The original media the speech was recorded on.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return The originalMediaType. + */ + @java.lang.Override public com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType getOriginalMediaType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType result = com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.valueOf(originalMediaType_); + return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.UNRECOGNIZED : result; + } + + public static final int RECORDING_DEVICE_TYPE_FIELD_NUMBER = 6; + private int recordingDeviceType_; + /** + *
+   * The type of device the speech was recorded with.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return The enum numeric value on the wire for recordingDeviceType. + */ + @java.lang.Override public int getRecordingDeviceTypeValue() { + return recordingDeviceType_; + } + /** + *
+   * The type of device the speech was recorded with.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return The recordingDeviceType. + */ + @java.lang.Override public com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType result = com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.valueOf(recordingDeviceType_); + return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.UNRECOGNIZED : result; + } + + public static final int RECORDING_DEVICE_NAME_FIELD_NUMBER = 7; + private volatile java.lang.Object recordingDeviceName_; + /** + *
+   * The device used to make the recording.  Examples 'Nexus 5X' or
+   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+   * 'Cardioid Microphone'.
+   * 
+ * + * string recording_device_name = 7; + * @return The recordingDeviceName. + */ + @java.lang.Override + public java.lang.String getRecordingDeviceName() { + java.lang.Object ref = recordingDeviceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recordingDeviceName_ = s; + return s; + } + } + /** + *
+   * The device used to make the recording.  Examples 'Nexus 5X' or
+   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+   * 'Cardioid Microphone'.
+   * 
+ * + * string recording_device_name = 7; + * @return The bytes for recordingDeviceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRecordingDeviceNameBytes() { + java.lang.Object ref = recordingDeviceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + recordingDeviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORIGINAL_MIME_TYPE_FIELD_NUMBER = 8; + private volatile java.lang.Object originalMimeType_; + /** + *
+   * Mime type of the original audio file.  For example `audio/m4a`,
+   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+   * A list of possible audio mime types is maintained at
+   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+   * 
+ * + * string original_mime_type = 8; + * @return The originalMimeType. + */ + @java.lang.Override + public java.lang.String getOriginalMimeType() { + java.lang.Object ref = originalMimeType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + originalMimeType_ = s; + return s; + } + } + /** + *
+   * Mime type of the original audio file.  For example `audio/m4a`,
+   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+   * A list of possible audio mime types is maintained at
+   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+   * 
+ * + * string original_mime_type = 8; + * @return The bytes for originalMimeType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOriginalMimeTypeBytes() { + java.lang.Object ref = originalMimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + originalMimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUDIO_TOPIC_FIELD_NUMBER = 10; + private volatile java.lang.Object audioTopic_; + /** + *
+   * Description of the content. Eg. "Recordings of federal supreme court
+   * hearings from 2012".
+   * 
+ * + * string audio_topic = 10; + * @return The audioTopic. + */ + @java.lang.Override + public java.lang.String getAudioTopic() { + java.lang.Object ref = audioTopic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + audioTopic_ = s; + return s; + } + } + /** + *
+   * Description of the content. Eg. "Recordings of federal supreme court
+   * hearings from 2012".
+   * 
+ * + * string audio_topic = 10; + * @return The bytes for audioTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAudioTopicBytes() { + java.lang.Object ref = audioTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + audioTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (interactionType_ != com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.INTERACTION_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, interactionType_); + } + if (industryNaicsCodeOfAudio_ != 0) { + output.writeUInt32(3, industryNaicsCodeOfAudio_); + } + if (microphoneDistance_ != com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.MICROPHONE_DISTANCE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, microphoneDistance_); + } + if (originalMediaType_ != com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.ORIGINAL_MEDIA_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, originalMediaType_); + } + if (recordingDeviceType_ != com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.RECORDING_DEVICE_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, recordingDeviceType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordingDeviceName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, recordingDeviceName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalMimeType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, originalMimeType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audioTopic_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, audioTopic_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (interactionType_ != com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.INTERACTION_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, interactionType_); + } + if (industryNaicsCodeOfAudio_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, industryNaicsCodeOfAudio_); + } + if (microphoneDistance_ != com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.MICROPHONE_DISTANCE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, microphoneDistance_); + } + if (originalMediaType_ != com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.ORIGINAL_MEDIA_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(5, originalMediaType_); + } + if (recordingDeviceType_ != com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.RECORDING_DEVICE_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, recordingDeviceType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordingDeviceName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, recordingDeviceName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalMimeType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, originalMimeType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audioTopic_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, audioTopic_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.RecognitionMetadata)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.RecognitionMetadata other = (com.google.cloud.speech.v1.RecognitionMetadata) obj; + + if (interactionType_ != other.interactionType_) return false; + if (getIndustryNaicsCodeOfAudio() + != other.getIndustryNaicsCodeOfAudio()) return false; + if (microphoneDistance_ != other.microphoneDistance_) return false; + if (originalMediaType_ != other.originalMediaType_) return false; + if (recordingDeviceType_ != other.recordingDeviceType_) return false; + if (!getRecordingDeviceName() + .equals(other.getRecordingDeviceName())) return false; + if (!getOriginalMimeType() + .equals(other.getOriginalMimeType())) return false; + if (!getAudioTopic() + .equals(other.getAudioTopic())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + INTERACTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + interactionType_; + hash = (37 * hash) + INDUSTRY_NAICS_CODE_OF_AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getIndustryNaicsCodeOfAudio(); + hash = (37 * hash) + MICROPHONE_DISTANCE_FIELD_NUMBER; + hash = (53 * hash) + microphoneDistance_; + hash = (37 * hash) + ORIGINAL_MEDIA_TYPE_FIELD_NUMBER; + hash = (53 * hash) + originalMediaType_; + hash = (37 * hash) + RECORDING_DEVICE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + recordingDeviceType_; + hash = (37 * hash) + RECORDING_DEVICE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getRecordingDeviceName().hashCode(); + hash = (37 * hash) + ORIGINAL_MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getOriginalMimeType().hashCode(); + hash = (37 * hash) + AUDIO_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getAudioTopic().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognitionMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.RecognitionMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Description of audio data to be recognized.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.RecognitionMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognitionMetadata) + com.google.cloud.speech.v1.RecognitionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.RecognitionMetadata.class, com.google.cloud.speech.v1.RecognitionMetadata.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.RecognitionMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + interactionType_ = 0; + + industryNaicsCodeOfAudio_ = 0; + + microphoneDistance_ = 0; + + originalMediaType_ = 0; + + recordingDeviceType_ = 0; + + recordingDeviceName_ = ""; + + originalMimeType_ = ""; + + audioTopic_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionMetadata getDefaultInstanceForType() { + return com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionMetadata build() { + com.google.cloud.speech.v1.RecognitionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionMetadata buildPartial() { + com.google.cloud.speech.v1.RecognitionMetadata result = new com.google.cloud.speech.v1.RecognitionMetadata(this); + result.interactionType_ = interactionType_; + result.industryNaicsCodeOfAudio_ = industryNaicsCodeOfAudio_; + result.microphoneDistance_ = microphoneDistance_; + result.originalMediaType_ = originalMediaType_; + result.recordingDeviceType_ = recordingDeviceType_; + result.recordingDeviceName_ = recordingDeviceName_; + result.originalMimeType_ = originalMimeType_; + result.audioTopic_ = audioTopic_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.RecognitionMetadata) { + return mergeFrom((com.google.cloud.speech.v1.RecognitionMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.RecognitionMetadata other) { + if (other == com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance()) return this; + if (other.interactionType_ != 0) { + setInteractionTypeValue(other.getInteractionTypeValue()); + } + if (other.getIndustryNaicsCodeOfAudio() != 0) { + setIndustryNaicsCodeOfAudio(other.getIndustryNaicsCodeOfAudio()); + } + if (other.microphoneDistance_ != 0) { + setMicrophoneDistanceValue(other.getMicrophoneDistanceValue()); + } + if (other.originalMediaType_ != 0) { + setOriginalMediaTypeValue(other.getOriginalMediaTypeValue()); + } + if (other.recordingDeviceType_ != 0) { + setRecordingDeviceTypeValue(other.getRecordingDeviceTypeValue()); + } + if (!other.getRecordingDeviceName().isEmpty()) { + recordingDeviceName_ = other.recordingDeviceName_; + onChanged(); + } + if (!other.getOriginalMimeType().isEmpty()) { + originalMimeType_ = other.originalMimeType_; + onChanged(); + } + if (!other.getAudioTopic().isEmpty()) { + audioTopic_ = other.audioTopic_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.RecognitionMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.RecognitionMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int interactionType_ = 0; + /** + *
+     * The use case most closely describing the audio content to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return The enum numeric value on the wire for interactionType. + */ + @java.lang.Override public int getInteractionTypeValue() { + return interactionType_; + } + /** + *
+     * The use case most closely describing the audio content to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; + * @param value The enum numeric value on the wire for interactionType to set. + * @return This builder for chaining. + */ + public Builder setInteractionTypeValue(int value) { + + interactionType_ = value; + onChanged(); + return this; + } + /** + *
+     * The use case most closely describing the audio content to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return The interactionType. + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionMetadata.InteractionType getInteractionType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1.RecognitionMetadata.InteractionType result = com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.valueOf(interactionType_); + return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.UNRECOGNIZED : result; + } + /** + *
+     * The use case most closely describing the audio content to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; + * @param value The interactionType to set. + * @return This builder for chaining. + */ + public Builder setInteractionType(com.google.cloud.speech.v1.RecognitionMetadata.InteractionType value) { + if (value == null) { + throw new NullPointerException(); + } + + interactionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The use case most closely describing the audio content to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return This builder for chaining. + */ + public Builder clearInteractionType() { + + interactionType_ = 0; + onChanged(); + return this; + } + + private int industryNaicsCodeOfAudio_ ; + /** + *
+     * The industry vertical to which this speech recognition request most
+     * closely applies. This is most indicative of the topics contained
+     * in the audio.  Use the 6-digit NAICS code to identify the industry
+     * vertical - see https://www.naics.com/search/.
+     * 
+ * + * uint32 industry_naics_code_of_audio = 3; + * @return The industryNaicsCodeOfAudio. + */ + @java.lang.Override + public int getIndustryNaicsCodeOfAudio() { + return industryNaicsCodeOfAudio_; + } + /** + *
+     * The industry vertical to which this speech recognition request most
+     * closely applies. This is most indicative of the topics contained
+     * in the audio.  Use the 6-digit NAICS code to identify the industry
+     * vertical - see https://www.naics.com/search/.
+     * 
+ * + * uint32 industry_naics_code_of_audio = 3; + * @param value The industryNaicsCodeOfAudio to set. + * @return This builder for chaining. + */ + public Builder setIndustryNaicsCodeOfAudio(int value) { + + industryNaicsCodeOfAudio_ = value; + onChanged(); + return this; + } + /** + *
+     * The industry vertical to which this speech recognition request most
+     * closely applies. This is most indicative of the topics contained
+     * in the audio.  Use the 6-digit NAICS code to identify the industry
+     * vertical - see https://www.naics.com/search/.
+     * 
+ * + * uint32 industry_naics_code_of_audio = 3; + * @return This builder for chaining. + */ + public Builder clearIndustryNaicsCodeOfAudio() { + + industryNaicsCodeOfAudio_ = 0; + onChanged(); + return this; + } + + private int microphoneDistance_ = 0; + /** + *
+     * The audio type that most closely describes the audio being recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return The enum numeric value on the wire for microphoneDistance. + */ + @java.lang.Override public int getMicrophoneDistanceValue() { + return microphoneDistance_; + } + /** + *
+     * The audio type that most closely describes the audio being recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @param value The enum numeric value on the wire for microphoneDistance to set. + * @return This builder for chaining. + */ + public Builder setMicrophoneDistanceValue(int value) { + + microphoneDistance_ = value; + onChanged(); + return this; + } + /** + *
+     * The audio type that most closely describes the audio being recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return The microphoneDistance. + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance result = com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.valueOf(microphoneDistance_); + return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.UNRECOGNIZED : result; + } + /** + *
+     * The audio type that most closely describes the audio being recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @param value The microphoneDistance to set. + * @return This builder for chaining. + */ + public Builder setMicrophoneDistance(com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance value) { + if (value == null) { + throw new NullPointerException(); + } + + microphoneDistance_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The audio type that most closely describes the audio being recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return This builder for chaining. + */ + public Builder clearMicrophoneDistance() { + + microphoneDistance_ = 0; + onChanged(); + return this; + } + + private int originalMediaType_ = 0; + /** + *
+     * The original media the speech was recorded on.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return The enum numeric value on the wire for originalMediaType. + */ + @java.lang.Override public int getOriginalMediaTypeValue() { + return originalMediaType_; + } + /** + *
+     * The original media the speech was recorded on.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @param value The enum numeric value on the wire for originalMediaType to set. + * @return This builder for chaining. + */ + public Builder setOriginalMediaTypeValue(int value) { + + originalMediaType_ = value; + onChanged(); + return this; + } + /** + *
+     * The original media the speech was recorded on.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return The originalMediaType. + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType getOriginalMediaType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType result = com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.valueOf(originalMediaType_); + return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.UNRECOGNIZED : result; + } + /** + *
+     * The original media the speech was recorded on.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @param value The originalMediaType to set. + * @return This builder for chaining. + */ + public Builder setOriginalMediaType(com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType value) { + if (value == null) { + throw new NullPointerException(); + } + + originalMediaType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The original media the speech was recorded on.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return This builder for chaining. + */ + public Builder clearOriginalMediaType() { + + originalMediaType_ = 0; + onChanged(); + return this; + } + + private int recordingDeviceType_ = 0; + /** + *
+     * The type of device the speech was recorded with.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return The enum numeric value on the wire for recordingDeviceType. + */ + @java.lang.Override public int getRecordingDeviceTypeValue() { + return recordingDeviceType_; + } + /** + *
+     * The type of device the speech was recorded with.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @param value The enum numeric value on the wire for recordingDeviceType to set. + * @return This builder for chaining. + */ + public Builder setRecordingDeviceTypeValue(int value) { + + recordingDeviceType_ = value; + onChanged(); + return this; + } + /** + *
+     * The type of device the speech was recorded with.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return The recordingDeviceType. + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType result = com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.valueOf(recordingDeviceType_); + return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.UNRECOGNIZED : result; + } + /** + *
+     * The type of device the speech was recorded with.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @param value The recordingDeviceType to set. + * @return This builder for chaining. + */ + public Builder setRecordingDeviceType(com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType value) { + if (value == null) { + throw new NullPointerException(); + } + + recordingDeviceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The type of device the speech was recorded with.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return This builder for chaining. + */ + public Builder clearRecordingDeviceType() { + + recordingDeviceType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object recordingDeviceName_ = ""; + /** + *
+     * The device used to make the recording.  Examples 'Nexus 5X' or
+     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+     * 'Cardioid Microphone'.
+     * 
+ * + * string recording_device_name = 7; + * @return The recordingDeviceName. + */ + public java.lang.String getRecordingDeviceName() { + java.lang.Object ref = recordingDeviceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recordingDeviceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The device used to make the recording.  Examples 'Nexus 5X' or
+     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+     * 'Cardioid Microphone'.
+     * 
+ * + * string recording_device_name = 7; + * @return The bytes for recordingDeviceName. + */ + public com.google.protobuf.ByteString + getRecordingDeviceNameBytes() { + java.lang.Object ref = recordingDeviceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + recordingDeviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The device used to make the recording.  Examples 'Nexus 5X' or
+     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+     * 'Cardioid Microphone'.
+     * 
+ * + * string recording_device_name = 7; + * @param value The recordingDeviceName to set. + * @return This builder for chaining. + */ + public Builder setRecordingDeviceName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + recordingDeviceName_ = value; + onChanged(); + return this; + } + /** + *
+     * The device used to make the recording.  Examples 'Nexus 5X' or
+     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+     * 'Cardioid Microphone'.
+     * 
+ * + * string recording_device_name = 7; + * @return This builder for chaining. + */ + public Builder clearRecordingDeviceName() { + + recordingDeviceName_ = getDefaultInstance().getRecordingDeviceName(); + onChanged(); + return this; + } + /** + *
+     * The device used to make the recording.  Examples 'Nexus 5X' or
+     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+     * 'Cardioid Microphone'.
+     * 
+ * + * string recording_device_name = 7; + * @param value The bytes for recordingDeviceName to set. + * @return This builder for chaining. + */ + public Builder setRecordingDeviceNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + recordingDeviceName_ = value; + onChanged(); + return this; + } + + private java.lang.Object originalMimeType_ = ""; + /** + *
+     * Mime type of the original audio file.  For example `audio/m4a`,
+     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+     * A list of possible audio mime types is maintained at
+     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+     * 
+ * + * string original_mime_type = 8; + * @return The originalMimeType. + */ + public java.lang.String getOriginalMimeType() { + java.lang.Object ref = originalMimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + originalMimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Mime type of the original audio file.  For example `audio/m4a`,
+     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+     * A list of possible audio mime types is maintained at
+     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+     * 
+ * + * string original_mime_type = 8; + * @return The bytes for originalMimeType. + */ + public com.google.protobuf.ByteString + getOriginalMimeTypeBytes() { + java.lang.Object ref = originalMimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + originalMimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Mime type of the original audio file.  For example `audio/m4a`,
+     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+     * A list of possible audio mime types is maintained at
+     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+     * 
+ * + * string original_mime_type = 8; + * @param value The originalMimeType to set. + * @return This builder for chaining. + */ + public Builder setOriginalMimeType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + originalMimeType_ = value; + onChanged(); + return this; + } + /** + *
+     * Mime type of the original audio file.  For example `audio/m4a`,
+     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+     * A list of possible audio mime types is maintained at
+     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+     * 
+ * + * string original_mime_type = 8; + * @return This builder for chaining. + */ + public Builder clearOriginalMimeType() { + + originalMimeType_ = getDefaultInstance().getOriginalMimeType(); + onChanged(); + return this; + } + /** + *
+     * Mime type of the original audio file.  For example `audio/m4a`,
+     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+     * A list of possible audio mime types is maintained at
+     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+     * 
+ * + * string original_mime_type = 8; + * @param value The bytes for originalMimeType to set. + * @return This builder for chaining. + */ + public Builder setOriginalMimeTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + originalMimeType_ = value; + onChanged(); + return this; + } + + private java.lang.Object audioTopic_ = ""; + /** + *
+     * Description of the content. Eg. "Recordings of federal supreme court
+     * hearings from 2012".
+     * 
+ * + * string audio_topic = 10; + * @return The audioTopic. + */ + public java.lang.String getAudioTopic() { + java.lang.Object ref = audioTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + audioTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Description of the content. Eg. "Recordings of federal supreme court
+     * hearings from 2012".
+     * 
+ * + * string audio_topic = 10; + * @return The bytes for audioTopic. + */ + public com.google.protobuf.ByteString + getAudioTopicBytes() { + java.lang.Object ref = audioTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + audioTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Description of the content. Eg. "Recordings of federal supreme court
+     * hearings from 2012".
+     * 
+ * + * string audio_topic = 10; + * @param value The audioTopic to set. + * @return This builder for chaining. + */ + public Builder setAudioTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + audioTopic_ = value; + onChanged(); + return this; + } + /** + *
+     * Description of the content. Eg. "Recordings of federal supreme court
+     * hearings from 2012".
+     * 
+ * + * string audio_topic = 10; + * @return This builder for chaining. + */ + public Builder clearAudioTopic() { + + audioTopic_ = getDefaultInstance().getAudioTopic(); + onChanged(); + return this; + } + /** + *
+     * Description of the content. Eg. "Recordings of federal supreme court
+     * hearings from 2012".
+     * 
+ * + * string audio_topic = 10; + * @param value The bytes for audioTopic to set. + * @return This builder for chaining. + */ + public Builder setAudioTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + audioTopic_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.RecognitionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionMetadata) + private static final com.google.cloud.speech.v1.RecognitionMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognitionMetadata(); + } + + public static com.google.cloud.speech.v1.RecognitionMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecognitionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecognitionMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadataOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadataOrBuilder.java new file mode 100644 index 000000000000..5b3a0073fc09 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadataOrBuilder.java @@ -0,0 +1,170 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +@java.lang.Deprecated public interface RecognitionMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognitionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The use case most closely describing the audio content to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return The enum numeric value on the wire for interactionType. + */ + int getInteractionTypeValue(); + /** + *
+   * The use case most closely describing the audio content to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return The interactionType. + */ + com.google.cloud.speech.v1.RecognitionMetadata.InteractionType getInteractionType(); + + /** + *
+   * The industry vertical to which this speech recognition request most
+   * closely applies. This is most indicative of the topics contained
+   * in the audio.  Use the 6-digit NAICS code to identify the industry
+   * vertical - see https://www.naics.com/search/.
+   * 
+ * + * uint32 industry_naics_code_of_audio = 3; + * @return The industryNaicsCodeOfAudio. + */ + int getIndustryNaicsCodeOfAudio(); + + /** + *
+   * The audio type that most closely describes the audio being recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return The enum numeric value on the wire for microphoneDistance. + */ + int getMicrophoneDistanceValue(); + /** + *
+   * The audio type that most closely describes the audio being recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return The microphoneDistance. + */ + com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance(); + + /** + *
+   * The original media the speech was recorded on.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return The enum numeric value on the wire for originalMediaType. + */ + int getOriginalMediaTypeValue(); + /** + *
+   * The original media the speech was recorded on.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return The originalMediaType. + */ + com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType getOriginalMediaType(); + + /** + *
+   * The type of device the speech was recorded with.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return The enum numeric value on the wire for recordingDeviceType. + */ + int getRecordingDeviceTypeValue(); + /** + *
+   * The type of device the speech was recorded with.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return The recordingDeviceType. + */ + com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType(); + + /** + *
+   * The device used to make the recording.  Examples 'Nexus 5X' or
+   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+   * 'Cardioid Microphone'.
+   * 
+ * + * string recording_device_name = 7; + * @return The recordingDeviceName. + */ + java.lang.String getRecordingDeviceName(); + /** + *
+   * The device used to make the recording.  Examples 'Nexus 5X' or
+   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+   * 'Cardioid Microphone'.
+   * 
+ * + * string recording_device_name = 7; + * @return The bytes for recordingDeviceName. + */ + com.google.protobuf.ByteString + getRecordingDeviceNameBytes(); + + /** + *
+   * Mime type of the original audio file.  For example `audio/m4a`,
+   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+   * A list of possible audio mime types is maintained at
+   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+   * 
+ * + * string original_mime_type = 8; + * @return The originalMimeType. + */ + java.lang.String getOriginalMimeType(); + /** + *
+   * Mime type of the original audio file.  For example `audio/m4a`,
+   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+   * A list of possible audio mime types is maintained at
+   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+   * 
+ * + * string original_mime_type = 8; + * @return The bytes for originalMimeType. + */ + com.google.protobuf.ByteString + getOriginalMimeTypeBytes(); + + /** + *
+   * Description of the content. Eg. "Recordings of federal supreme court
+   * hearings from 2012".
+   * 
+ * + * string audio_topic = 10; + * @return The audioTopic. + */ + java.lang.String getAudioTopic(); + /** + *
+   * Description of the content. Eg. "Recordings of federal supreme court
+   * hearings from 2012".
+   * 
+ * + * string audio_topic = 10; + * @return The bytes for audioTopic. + */ + com.google.protobuf.ByteString + getAudioTopicBytes(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequest.java new file mode 100644 index 000000000000..8940768dafab --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequest.java @@ -0,0 +1,913 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * The top-level message sent by the client for the `Recognize` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.RecognizeRequest} + */ +public final class RecognizeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognizeRequest) + RecognizeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use RecognizeRequest.newBuilder() to construct. + private RecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RecognizeRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RecognizeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RecognizeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.cloud.speech.v1.RecognitionConfig.Builder subBuilder = null; + if (config_ != null) { + subBuilder = config_.toBuilder(); + } + config_ = input.readMessage(com.google.cloud.speech.v1.RecognitionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(config_); + config_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.cloud.speech.v1.RecognitionAudio.Builder subBuilder = null; + if (audio_ != null) { + subBuilder = audio_.toBuilder(); + } + audio_ = input.readMessage(com.google.cloud.speech.v1.RecognitionAudio.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(audio_); + audio_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.RecognizeRequest.class, com.google.cloud.speech.v1.RecognizeRequest.Builder.class); + } + + public static final int CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.speech.v1.RecognitionConfig config_; + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return config_ != null; + } + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionConfig getConfig() { + return config_ == null ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; + } + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { + return getConfig(); + } + + public static final int AUDIO_FIELD_NUMBER = 2; + private com.google.cloud.speech.v1.RecognitionAudio audio_; + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the audio field is set. + */ + @java.lang.Override + public boolean hasAudio() { + return audio_ != null; + } + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The audio. + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionAudio getAudio() { + return audio_ == null ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() : audio_; + } + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder() { + return getAudio(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (config_ != null) { + output.writeMessage(1, getConfig()); + } + if (audio_ != null) { + output.writeMessage(2, getAudio()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (config_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getConfig()); + } + if (audio_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getAudio()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.RecognizeRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.RecognizeRequest other = (com.google.cloud.speech.v1.RecognizeRequest) obj; + + if (hasConfig() != other.hasConfig()) return false; + if (hasConfig()) { + if (!getConfig() + .equals(other.getConfig())) return false; + } + if (hasAudio() != other.hasAudio()) return false; + if (hasAudio()) { + if (!getAudio() + .equals(other.getAudio())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + if (hasAudio()) { + hash = (37 * hash) + AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getAudio().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognizeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognizeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognizeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognizeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.RecognizeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The top-level message sent by the client for the `Recognize` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.RecognizeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognizeRequest) + com.google.cloud.speech.v1.RecognizeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.RecognizeRequest.class, com.google.cloud.speech.v1.RecognizeRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.RecognizeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (configBuilder_ == null) { + config_ = null; + } else { + config_ = null; + configBuilder_ = null; + } + if (audioBuilder_ == null) { + audio_ = null; + } else { + audio_ = null; + audioBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognizeRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.RecognizeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognizeRequest build() { + com.google.cloud.speech.v1.RecognizeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognizeRequest buildPartial() { + com.google.cloud.speech.v1.RecognizeRequest result = new com.google.cloud.speech.v1.RecognizeRequest(this); + if (configBuilder_ == null) { + result.config_ = config_; + } else { + result.config_ = configBuilder_.build(); + } + if (audioBuilder_ == null) { + result.audio_ = audio_; + } else { + result.audio_ = audioBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.RecognizeRequest) { + return mergeFrom((com.google.cloud.speech.v1.RecognizeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.RecognizeRequest other) { + if (other == com.google.cloud.speech.v1.RecognizeRequest.getDefaultInstance()) return this; + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + if (other.hasAudio()) { + mergeAudio(other.getAudio()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.RecognizeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.RecognizeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.speech.v1.RecognitionConfig config_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder> configBuilder_; + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + public boolean hasConfig() { + return configBuilder_ != null || config_ != null; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + public com.google.cloud.speech.v1.RecognitionConfig getConfig() { + if (configBuilder_ == null) { + return config_ == null ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig(com.google.cloud.speech.v1.RecognitionConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig( + com.google.cloud.speech.v1.RecognitionConfig.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeConfig(com.google.cloud.speech.v1.RecognitionConfig value) { + if (configBuilder_ == null) { + if (config_ != null) { + config_ = + com.google.cloud.speech.v1.RecognitionConfig.newBuilder(config_).mergeFrom(value).buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + configBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + config_ = null; + onChanged(); + } else { + config_ = null; + configBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.RecognitionConfig.Builder getConfigBuilder() { + + onChanged(); + return getConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null ? + com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; + } + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder>( + getConfig(), + getParentForChildren(), + isClean()); + config_ = null; + } + return configBuilder_; + } + + private com.google.cloud.speech.v1.RecognitionAudio audio_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionAudio, com.google.cloud.speech.v1.RecognitionAudio.Builder, com.google.cloud.speech.v1.RecognitionAudioOrBuilder> audioBuilder_; + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the audio field is set. + */ + public boolean hasAudio() { + return audioBuilder_ != null || audio_ != null; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The audio. + */ + public com.google.cloud.speech.v1.RecognitionAudio getAudio() { + if (audioBuilder_ == null) { + return audio_ == null ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() : audio_; + } else { + return audioBuilder_.getMessage(); + } + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setAudio(com.google.cloud.speech.v1.RecognitionAudio value) { + if (audioBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + audio_ = value; + onChanged(); + } else { + audioBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setAudio( + com.google.cloud.speech.v1.RecognitionAudio.Builder builderForValue) { + if (audioBuilder_ == null) { + audio_ = builderForValue.build(); + onChanged(); + } else { + audioBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeAudio(com.google.cloud.speech.v1.RecognitionAudio value) { + if (audioBuilder_ == null) { + if (audio_ != null) { + audio_ = + com.google.cloud.speech.v1.RecognitionAudio.newBuilder(audio_).mergeFrom(value).buildPartial(); + } else { + audio_ = value; + } + onChanged(); + } else { + audioBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearAudio() { + if (audioBuilder_ == null) { + audio_ = null; + onChanged(); + } else { + audio_ = null; + audioBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.RecognitionAudio.Builder getAudioBuilder() { + + onChanged(); + return getAudioFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder() { + if (audioBuilder_ != null) { + return audioBuilder_.getMessageOrBuilder(); + } else { + return audio_ == null ? + com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() : audio_; + } + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionAudio, com.google.cloud.speech.v1.RecognitionAudio.Builder, com.google.cloud.speech.v1.RecognitionAudioOrBuilder> + getAudioFieldBuilder() { + if (audioBuilder_ == null) { + audioBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionAudio, com.google.cloud.speech.v1.RecognitionAudio.Builder, com.google.cloud.speech.v1.RecognitionAudioOrBuilder>( + getAudio(), + getParentForChildren(), + isClean()); + audio_ = null; + } + return audioBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.RecognizeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognizeRequest) + private static final com.google.cloud.speech.v1.RecognizeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognizeRequest(); + } + + public static com.google.cloud.speech.v1.RecognizeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecognizeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecognizeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognizeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequestOrBuilder.java new file mode 100644 index 000000000000..5811af70356e --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequestOrBuilder.java @@ -0,0 +1,66 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface RecognizeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognizeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + boolean hasConfig(); + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + com.google.cloud.speech.v1.RecognitionConfig getConfig(); + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder(); + + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the audio field is set. + */ + boolean hasAudio(); + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The audio. + */ + com.google.cloud.speech.v1.RecognitionAudio getAudio(); + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java new file mode 100644 index 000000000000..42ddf12c6f61 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java @@ -0,0 +1,1135 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * The only message returned to the client by the `Recognize` method. It
+ * contains the result as zero or more sequential `SpeechRecognitionResult`
+ * messages.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.RecognizeResponse} + */ +public final class RecognizeResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognizeResponse) + RecognizeResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use RecognizeResponse.newBuilder() to construct. + private RecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RecognizeResponse() { + results_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RecognizeResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RecognizeResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + results_.add( + input.readMessage(com.google.cloud.speech.v1.SpeechRecognitionResult.parser(), extensionRegistry)); + break; + } + case 26: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (totalBilledTime_ != null) { + subBuilder = totalBilledTime_.toBuilder(); + } + totalBilledTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(totalBilledTime_); + totalBilledTime_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.RecognizeResponse.class, com.google.cloud.speech.v1.RecognizeResponse.Builder.class); + } + + public static final int RESULTS_FIELD_NUMBER = 2; + private java.util.List results_; + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public java.util.List getResultsList() { + return results_; + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public java.util.List + getResultsOrBuilderList() { + return results_; + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index) { + return results_.get(index); + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( + int index) { + return results_.get(index); + } + + public static final int TOTAL_BILLED_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Duration totalBilledTime_; + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return Whether the totalBilledTime field is set. + */ + @java.lang.Override + public boolean hasTotalBilledTime() { + return totalBilledTime_ != null; + } + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return The totalBilledTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getTotalBilledTime() { + return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { + return getTotalBilledTime(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(2, results_.get(i)); + } + if (totalBilledTime_ != null) { + output.writeMessage(3, getTotalBilledTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, results_.get(i)); + } + if (totalBilledTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getTotalBilledTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.RecognizeResponse)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.RecognizeResponse other = (com.google.cloud.speech.v1.RecognizeResponse) obj; + + if (!getResultsList() + .equals(other.getResultsList())) return false; + if (hasTotalBilledTime() != other.hasTotalBilledTime()) return false; + if (hasTotalBilledTime()) { + if (!getTotalBilledTime() + .equals(other.getTotalBilledTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + if (hasTotalBilledTime()) { + hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; + hash = (53 * hash) + getTotalBilledTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognizeResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognizeResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognizeResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognizeResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.RecognizeResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The only message returned to the client by the `Recognize` method. It
+   * contains the result as zero or more sequential `SpeechRecognitionResult`
+   * messages.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.RecognizeResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognizeResponse) + com.google.cloud.speech.v1.RecognizeResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.RecognizeResponse.class, com.google.cloud.speech.v1.RecognizeResponse.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.RecognizeResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resultsBuilder_.clear(); + } + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = null; + } else { + totalBilledTime_ = null; + totalBilledTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognizeResponse getDefaultInstanceForType() { + return com.google.cloud.speech.v1.RecognizeResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognizeResponse build() { + com.google.cloud.speech.v1.RecognizeResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognizeResponse buildPartial() { + com.google.cloud.speech.v1.RecognizeResponse result = new com.google.cloud.speech.v1.RecognizeResponse(this); + int from_bitField0_ = bitField0_; + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + if (totalBilledTimeBuilder_ == null) { + result.totalBilledTime_ = totalBilledTime_; + } else { + result.totalBilledTime_ = totalBilledTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.RecognizeResponse) { + return mergeFrom((com.google.cloud.speech.v1.RecognizeResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.RecognizeResponse other) { + if (other == com.google.cloud.speech.v1.RecognizeResponse.getDefaultInstance()) return this; + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResultsFieldBuilder() : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (other.hasTotalBilledTime()) { + mergeTotalBilledTime(other.getTotalBilledTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.RecognizeResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.RecognizeResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List results_ = + java.util.Collections.emptyList(); + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechRecognitionResult, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder> resultsBuilder_; + + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public java.util.List getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder setResults( + int index, com.google.cloud.speech.v1.SpeechRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder setResults( + int index, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder addResults(com.google.cloud.speech.v1.SpeechRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder addResults( + int index, com.google.cloud.speech.v1.SpeechRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder addResults( + com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder addResults( + int index, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder addAllResults( + java.lang.Iterable values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( + int index) { + if (resultsBuilder_ == null) { + return results_.get(index); } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public java.util.List + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder addResultsBuilder() { + return getResultsFieldBuilder().addBuilder( + com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()); + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()); + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechRecognitionResult, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechRecognitionResult, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder>( + results_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private com.google.protobuf.Duration totalBilledTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalBilledTimeBuilder_; + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return Whether the totalBilledTime field is set. + */ + public boolean hasTotalBilledTime() { + return totalBilledTimeBuilder_ != null || totalBilledTime_ != null; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return The totalBilledTime. + */ + public com.google.protobuf.Duration getTotalBilledTime() { + if (totalBilledTimeBuilder_ == null) { + return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } else { + return totalBilledTimeBuilder_.getMessage(); + } + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder setTotalBilledTime(com.google.protobuf.Duration value) { + if (totalBilledTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + totalBilledTime_ = value; + onChanged(); + } else { + totalBilledTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder setTotalBilledTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = builderForValue.build(); + onChanged(); + } else { + totalBilledTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder mergeTotalBilledTime(com.google.protobuf.Duration value) { + if (totalBilledTimeBuilder_ == null) { + if (totalBilledTime_ != null) { + totalBilledTime_ = + com.google.protobuf.Duration.newBuilder(totalBilledTime_).mergeFrom(value).buildPartial(); + } else { + totalBilledTime_ = value; + } + onChanged(); + } else { + totalBilledTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder clearTotalBilledTime() { + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = null; + onChanged(); + } else { + totalBilledTime_ = null; + totalBilledTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public com.google.protobuf.Duration.Builder getTotalBilledTimeBuilder() { + + onChanged(); + return getTotalBilledTimeFieldBuilder().getBuilder(); + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { + if (totalBilledTimeBuilder_ != null) { + return totalBilledTimeBuilder_.getMessageOrBuilder(); + } else { + return totalBilledTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getTotalBilledTimeFieldBuilder() { + if (totalBilledTimeBuilder_ == null) { + totalBilledTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getTotalBilledTime(), + getParentForChildren(), + isClean()); + totalBilledTime_ = null; + } + return totalBilledTimeBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.RecognizeResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognizeResponse) + private static final com.google.cloud.speech.v1.RecognizeResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognizeResponse(); + } + + public static com.google.cloud.speech.v1.RecognizeResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecognizeResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecognizeResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.RecognizeResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java new file mode 100644 index 000000000000..d2b282a71005 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface RecognizeResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognizeResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + java.util.List + getResultsList(); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + int getResultsCount(); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + java.util.List + getResultsOrBuilderList(); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; + */ + com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( + int index); + + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return Whether the totalBilledTime field is set. + */ + boolean hasTotalBilledTime(); + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return The totalBilledTime. + */ + com.google.protobuf.Duration getTotalBilledTime(); + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java new file mode 100644 index 000000000000..72dfa283a0b5 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java @@ -0,0 +1,782 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Config to enable speaker diarization.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.SpeakerDiarizationConfig} + */ +public final class SpeakerDiarizationConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeakerDiarizationConfig) + SpeakerDiarizationConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use SpeakerDiarizationConfig.newBuilder() to construct. + private SpeakerDiarizationConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SpeakerDiarizationConfig() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SpeakerDiarizationConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SpeakerDiarizationConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + enableSpeakerDiarization_ = input.readBool(); + break; + } + case 16: { + + minSpeakerCount_ = input.readInt32(); + break; + } + case 24: { + + maxSpeakerCount_ = input.readInt32(); + break; + } + case 40: { + + speakerTag_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.SpeakerDiarizationConfig.class, com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder.class); + } + + public static final int ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER = 1; + private boolean enableSpeakerDiarization_; + /** + *
+   * If 'true', enables speaker detection for each recognized word in
+   * the top alternative of the recognition result using a speaker_tag provided
+   * in the WordInfo.
+   * 
+ * + * bool enable_speaker_diarization = 1; + * @return The enableSpeakerDiarization. + */ + @java.lang.Override + public boolean getEnableSpeakerDiarization() { + return enableSpeakerDiarization_; + } + + public static final int MIN_SPEAKER_COUNT_FIELD_NUMBER = 2; + private int minSpeakerCount_; + /** + *
+   * Minimum number of speakers in the conversation. This range gives you more
+   * flexibility by allowing the system to automatically determine the correct
+   * number of speakers. If not set, the default value is 2.
+   * 
+ * + * int32 min_speaker_count = 2; + * @return The minSpeakerCount. + */ + @java.lang.Override + public int getMinSpeakerCount() { + return minSpeakerCount_; + } + + public static final int MAX_SPEAKER_COUNT_FIELD_NUMBER = 3; + private int maxSpeakerCount_; + /** + *
+   * Maximum number of speakers in the conversation. This range gives you more
+   * flexibility by allowing the system to automatically determine the correct
+   * number of speakers. If not set, the default value is 6.
+   * 
+ * + * int32 max_speaker_count = 3; + * @return The maxSpeakerCount. + */ + @java.lang.Override + public int getMaxSpeakerCount() { + return maxSpeakerCount_; + } + + public static final int SPEAKER_TAG_FIELD_NUMBER = 5; + private int speakerTag_; + /** + *
+   * Output only. Unused.
+   * 
+ * + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. + * See google/cloud/speech/v1/cloud_speech.proto;l=457 + * @return The speakerTag. + */ + @java.lang.Override + @java.lang.Deprecated public int getSpeakerTag() { + return speakerTag_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (enableSpeakerDiarization_ != false) { + output.writeBool(1, enableSpeakerDiarization_); + } + if (minSpeakerCount_ != 0) { + output.writeInt32(2, minSpeakerCount_); + } + if (maxSpeakerCount_ != 0) { + output.writeInt32(3, maxSpeakerCount_); + } + if (speakerTag_ != 0) { + output.writeInt32(5, speakerTag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enableSpeakerDiarization_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, enableSpeakerDiarization_); + } + if (minSpeakerCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, minSpeakerCount_); + } + if (maxSpeakerCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, maxSpeakerCount_); + } + if (speakerTag_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, speakerTag_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.SpeakerDiarizationConfig)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.SpeakerDiarizationConfig other = (com.google.cloud.speech.v1.SpeakerDiarizationConfig) obj; + + if (getEnableSpeakerDiarization() + != other.getEnableSpeakerDiarization()) return false; + if (getMinSpeakerCount() + != other.getMinSpeakerCount()) return false; + if (getMaxSpeakerCount() + != other.getMaxSpeakerCount()) return false; + if (getSpeakerTag() + != other.getSpeakerTag()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableSpeakerDiarization()); + hash = (37 * hash) + MIN_SPEAKER_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinSpeakerCount(); + hash = (37 * hash) + MAX_SPEAKER_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxSpeakerCount(); + hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; + hash = (53 * hash) + getSpeakerTag(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.SpeakerDiarizationConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Config to enable speaker diarization.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.SpeakerDiarizationConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeakerDiarizationConfig) + com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.SpeakerDiarizationConfig.class, com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.SpeakerDiarizationConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + enableSpeakerDiarization_ = false; + + minSpeakerCount_ = 0; + + maxSpeakerCount_ = 0; + + speakerTag_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDefaultInstanceForType() { + return com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeakerDiarizationConfig build() { + com.google.cloud.speech.v1.SpeakerDiarizationConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeakerDiarizationConfig buildPartial() { + com.google.cloud.speech.v1.SpeakerDiarizationConfig result = new com.google.cloud.speech.v1.SpeakerDiarizationConfig(this); + result.enableSpeakerDiarization_ = enableSpeakerDiarization_; + result.minSpeakerCount_ = minSpeakerCount_; + result.maxSpeakerCount_ = maxSpeakerCount_; + result.speakerTag_ = speakerTag_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.SpeakerDiarizationConfig) { + return mergeFrom((com.google.cloud.speech.v1.SpeakerDiarizationConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.SpeakerDiarizationConfig other) { + if (other == com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance()) return this; + if (other.getEnableSpeakerDiarization() != false) { + setEnableSpeakerDiarization(other.getEnableSpeakerDiarization()); + } + if (other.getMinSpeakerCount() != 0) { + setMinSpeakerCount(other.getMinSpeakerCount()); + } + if (other.getMaxSpeakerCount() != 0) { + setMaxSpeakerCount(other.getMaxSpeakerCount()); + } + if (other.getSpeakerTag() != 0) { + setSpeakerTag(other.getSpeakerTag()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.SpeakerDiarizationConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.SpeakerDiarizationConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean enableSpeakerDiarization_ ; + /** + *
+     * If 'true', enables speaker detection for each recognized word in
+     * the top alternative of the recognition result using a speaker_tag provided
+     * in the WordInfo.
+     * 
+ * + * bool enable_speaker_diarization = 1; + * @return The enableSpeakerDiarization. + */ + @java.lang.Override + public boolean getEnableSpeakerDiarization() { + return enableSpeakerDiarization_; + } + /** + *
+     * If 'true', enables speaker detection for each recognized word in
+     * the top alternative of the recognition result using a speaker_tag provided
+     * in the WordInfo.
+     * 
+ * + * bool enable_speaker_diarization = 1; + * @param value The enableSpeakerDiarization to set. + * @return This builder for chaining. + */ + public Builder setEnableSpeakerDiarization(boolean value) { + + enableSpeakerDiarization_ = value; + onChanged(); + return this; + } + /** + *
+     * If 'true', enables speaker detection for each recognized word in
+     * the top alternative of the recognition result using a speaker_tag provided
+     * in the WordInfo.
+     * 
+ * + * bool enable_speaker_diarization = 1; + * @return This builder for chaining. + */ + public Builder clearEnableSpeakerDiarization() { + + enableSpeakerDiarization_ = false; + onChanged(); + return this; + } + + private int minSpeakerCount_ ; + /** + *
+     * Minimum number of speakers in the conversation. This range gives you more
+     * flexibility by allowing the system to automatically determine the correct
+     * number of speakers. If not set, the default value is 2.
+     * 
+ * + * int32 min_speaker_count = 2; + * @return The minSpeakerCount. + */ + @java.lang.Override + public int getMinSpeakerCount() { + return minSpeakerCount_; + } + /** + *
+     * Minimum number of speakers in the conversation. This range gives you more
+     * flexibility by allowing the system to automatically determine the correct
+     * number of speakers. If not set, the default value is 2.
+     * 
+ * + * int32 min_speaker_count = 2; + * @param value The minSpeakerCount to set. + * @return This builder for chaining. + */ + public Builder setMinSpeakerCount(int value) { + + minSpeakerCount_ = value; + onChanged(); + return this; + } + /** + *
+     * Minimum number of speakers in the conversation. This range gives you more
+     * flexibility by allowing the system to automatically determine the correct
+     * number of speakers. If not set, the default value is 2.
+     * 
+ * + * int32 min_speaker_count = 2; + * @return This builder for chaining. + */ + public Builder clearMinSpeakerCount() { + + minSpeakerCount_ = 0; + onChanged(); + return this; + } + + private int maxSpeakerCount_ ; + /** + *
+     * Maximum number of speakers in the conversation. This range gives you more
+     * flexibility by allowing the system to automatically determine the correct
+     * number of speakers. If not set, the default value is 6.
+     * 
+ * + * int32 max_speaker_count = 3; + * @return The maxSpeakerCount. + */ + @java.lang.Override + public int getMaxSpeakerCount() { + return maxSpeakerCount_; + } + /** + *
+     * Maximum number of speakers in the conversation. This range gives you more
+     * flexibility by allowing the system to automatically determine the correct
+     * number of speakers. If not set, the default value is 6.
+     * 
+ * + * int32 max_speaker_count = 3; + * @param value The maxSpeakerCount to set. + * @return This builder for chaining. + */ + public Builder setMaxSpeakerCount(int value) { + + maxSpeakerCount_ = value; + onChanged(); + return this; + } + /** + *
+     * Maximum number of speakers in the conversation. This range gives you more
+     * flexibility by allowing the system to automatically determine the correct
+     * number of speakers. If not set, the default value is 6.
+     * 
+ * + * int32 max_speaker_count = 3; + * @return This builder for chaining. + */ + public Builder clearMaxSpeakerCount() { + + maxSpeakerCount_ = 0; + onChanged(); + return this; + } + + private int speakerTag_ ; + /** + *
+     * Output only. Unused.
+     * 
+ * + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. + * See google/cloud/speech/v1/cloud_speech.proto;l=457 + * @return The speakerTag. + */ + @java.lang.Override + @java.lang.Deprecated public int getSpeakerTag() { + return speakerTag_; + } + /** + *
+     * Output only. Unused.
+     * 
+ * + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. + * See google/cloud/speech/v1/cloud_speech.proto;l=457 + * @param value The speakerTag to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setSpeakerTag(int value) { + + speakerTag_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. Unused.
+     * 
+ * + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. + * See google/cloud/speech/v1/cloud_speech.proto;l=457 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearSpeakerTag() { + + speakerTag_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeakerDiarizationConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeakerDiarizationConfig) + private static final com.google.cloud.speech.v1.SpeakerDiarizationConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeakerDiarizationConfig(); + } + + public static com.google.cloud.speech.v1.SpeakerDiarizationConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeakerDiarizationConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SpeakerDiarizationConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java new file mode 100644 index 000000000000..cb178fda1320 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java @@ -0,0 +1,57 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface SpeakerDiarizationConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeakerDiarizationConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * If 'true', enables speaker detection for each recognized word in
+   * the top alternative of the recognition result using a speaker_tag provided
+   * in the WordInfo.
+   * 
+ * + * bool enable_speaker_diarization = 1; + * @return The enableSpeakerDiarization. + */ + boolean getEnableSpeakerDiarization(); + + /** + *
+   * Minimum number of speakers in the conversation. This range gives you more
+   * flexibility by allowing the system to automatically determine the correct
+   * number of speakers. If not set, the default value is 2.
+   * 
+ * + * int32 min_speaker_count = 2; + * @return The minSpeakerCount. + */ + int getMinSpeakerCount(); + + /** + *
+   * Maximum number of speakers in the conversation. This range gives you more
+   * flexibility by allowing the system to automatically determine the correct
+   * number of speakers. If not set, the default value is 6.
+   * 
+ * + * int32 max_speaker_count = 3; + * @return The maxSpeakerCount. + */ + int getMaxSpeakerCount(); + + /** + *
+   * Output only. Unused.
+   * 
+ * + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. + * See google/cloud/speech/v1/cloud_speech.proto;l=457 + * @return The speakerTag. + */ + @java.lang.Deprecated int getSpeakerTag(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptation.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptation.java new file mode 100644 index 000000000000..1ba9f5acf756 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptation.java @@ -0,0 +1,1671 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/resource.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Speech adaptation configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.SpeechAdaptation} + */ +public final class SpeechAdaptation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechAdaptation) + SpeechAdaptationOrBuilder { +private static final long serialVersionUID = 0L; + // Use SpeechAdaptation.newBuilder() to construct. + private SpeechAdaptation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SpeechAdaptation() { + phraseSets_ = java.util.Collections.emptyList(); + phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; + customClasses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SpeechAdaptation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SpeechAdaptation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + phraseSets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + phraseSets_.add( + input.readMessage(com.google.cloud.speech.v1.PhraseSet.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + phraseSetReferences_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + phraseSetReferences_.add(s); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + customClasses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + customClasses_.add( + input.readMessage(com.google.cloud.speech.v1.CustomClass.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + phraseSetReferences_ = phraseSetReferences_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + customClasses_ = java.util.Collections.unmodifiableList(customClasses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_SpeechAdaptation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_SpeechAdaptation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.SpeechAdaptation.class, com.google.cloud.speech.v1.SpeechAdaptation.Builder.class); + } + + public static final int PHRASE_SETS_FIELD_NUMBER = 1; + private java.util.List phraseSets_; + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public java.util.List getPhraseSetsList() { + return phraseSets_; + } + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public java.util.List + getPhraseSetsOrBuilderList() { + return phraseSets_; + } + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public int getPhraseSetsCount() { + return phraseSets_.size(); + } + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet getPhraseSets(int index) { + return phraseSets_.get(index); + } + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetsOrBuilder( + int index) { + return phraseSets_.get(index); + } + + public static final int PHRASE_SET_REFERENCES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList phraseSetReferences_; + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return A list containing the phraseSetReferences. + */ + public com.google.protobuf.ProtocolStringList + getPhraseSetReferencesList() { + return phraseSetReferences_; + } + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return The count of phraseSetReferences. + */ + public int getPhraseSetReferencesCount() { + return phraseSetReferences_.size(); + } + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index of the element to return. + * @return The phraseSetReferences at the given index. + */ + public java.lang.String getPhraseSetReferences(int index) { + return phraseSetReferences_.get(index); + } + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index of the value to return. + * @return The bytes of the phraseSetReferences at the given index. + */ + public com.google.protobuf.ByteString + getPhraseSetReferencesBytes(int index) { + return phraseSetReferences_.getByteString(index); + } + + public static final int CUSTOM_CLASSES_FIELD_NUMBER = 3; + private java.util.List customClasses_; + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + @java.lang.Override + public java.util.List getCustomClassesList() { + return customClasses_; + } + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + @java.lang.Override + public java.util.List + getCustomClassesOrBuilderList() { + return customClasses_; + } + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + @java.lang.Override + public int getCustomClassesCount() { + return customClasses_.size(); + } + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass getCustomClasses(int index) { + return customClasses_.get(index); + } + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + @java.lang.Override + public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index) { + return customClasses_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < phraseSets_.size(); i++) { + output.writeMessage(1, phraseSets_.get(i)); + } + for (int i = 0; i < phraseSetReferences_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, phraseSetReferences_.getRaw(i)); + } + for (int i = 0; i < customClasses_.size(); i++) { + output.writeMessage(3, customClasses_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < phraseSets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, phraseSets_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < phraseSetReferences_.size(); i++) { + dataSize += computeStringSizeNoTag(phraseSetReferences_.getRaw(i)); + } + size += dataSize; + size += 1 * getPhraseSetReferencesList().size(); + } + for (int i = 0; i < customClasses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, customClasses_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.SpeechAdaptation)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.SpeechAdaptation other = (com.google.cloud.speech.v1.SpeechAdaptation) obj; + + if (!getPhraseSetsList() + .equals(other.getPhraseSetsList())) return false; + if (!getPhraseSetReferencesList() + .equals(other.getPhraseSetReferencesList())) return false; + if (!getCustomClassesList() + .equals(other.getCustomClassesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPhraseSetsCount() > 0) { + hash = (37 * hash) + PHRASE_SETS_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSetsList().hashCode(); + } + if (getPhraseSetReferencesCount() > 0) { + hash = (37 * hash) + PHRASE_SET_REFERENCES_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSetReferencesList().hashCode(); + } + if (getCustomClassesCount() > 0) { + hash = (37 * hash) + CUSTOM_CLASSES_FIELD_NUMBER; + hash = (53 * hash) + getCustomClassesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechAdaptation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeechAdaptation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.SpeechAdaptation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Speech adaptation configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.SpeechAdaptation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechAdaptation) + com.google.cloud.speech.v1.SpeechAdaptationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_SpeechAdaptation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_SpeechAdaptation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.SpeechAdaptation.class, com.google.cloud.speech.v1.SpeechAdaptation.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.SpeechAdaptation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPhraseSetsFieldBuilder(); + getCustomClassesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (phraseSetsBuilder_ == null) { + phraseSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + phraseSetsBuilder_.clear(); + } + phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + if (customClassesBuilder_ == null) { + customClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + customClassesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_SpeechAdaptation_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptation getDefaultInstanceForType() { + return com.google.cloud.speech.v1.SpeechAdaptation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptation build() { + com.google.cloud.speech.v1.SpeechAdaptation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptation buildPartial() { + com.google.cloud.speech.v1.SpeechAdaptation result = new com.google.cloud.speech.v1.SpeechAdaptation(this); + int from_bitField0_ = bitField0_; + if (phraseSetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.phraseSets_ = phraseSets_; + } else { + result.phraseSets_ = phraseSetsBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + phraseSetReferences_ = phraseSetReferences_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.phraseSetReferences_ = phraseSetReferences_; + if (customClassesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + customClasses_ = java.util.Collections.unmodifiableList(customClasses_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.customClasses_ = customClasses_; + } else { + result.customClasses_ = customClassesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.SpeechAdaptation) { + return mergeFrom((com.google.cloud.speech.v1.SpeechAdaptation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.SpeechAdaptation other) { + if (other == com.google.cloud.speech.v1.SpeechAdaptation.getDefaultInstance()) return this; + if (phraseSetsBuilder_ == null) { + if (!other.phraseSets_.isEmpty()) { + if (phraseSets_.isEmpty()) { + phraseSets_ = other.phraseSets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePhraseSetsIsMutable(); + phraseSets_.addAll(other.phraseSets_); + } + onChanged(); + } + } else { + if (!other.phraseSets_.isEmpty()) { + if (phraseSetsBuilder_.isEmpty()) { + phraseSetsBuilder_.dispose(); + phraseSetsBuilder_ = null; + phraseSets_ = other.phraseSets_; + bitField0_ = (bitField0_ & ~0x00000001); + phraseSetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPhraseSetsFieldBuilder() : null; + } else { + phraseSetsBuilder_.addAllMessages(other.phraseSets_); + } + } + } + if (!other.phraseSetReferences_.isEmpty()) { + if (phraseSetReferences_.isEmpty()) { + phraseSetReferences_ = other.phraseSetReferences_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePhraseSetReferencesIsMutable(); + phraseSetReferences_.addAll(other.phraseSetReferences_); + } + onChanged(); + } + if (customClassesBuilder_ == null) { + if (!other.customClasses_.isEmpty()) { + if (customClasses_.isEmpty()) { + customClasses_ = other.customClasses_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureCustomClassesIsMutable(); + customClasses_.addAll(other.customClasses_); + } + onChanged(); + } + } else { + if (!other.customClasses_.isEmpty()) { + if (customClassesBuilder_.isEmpty()) { + customClassesBuilder_.dispose(); + customClassesBuilder_ = null; + customClasses_ = other.customClasses_; + bitField0_ = (bitField0_ & ~0x00000004); + customClassesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getCustomClassesFieldBuilder() : null; + } else { + customClassesBuilder_.addAllMessages(other.customClasses_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.SpeechAdaptation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.SpeechAdaptation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List phraseSets_ = + java.util.Collections.emptyList(); + private void ensurePhraseSetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + phraseSets_ = new java.util.ArrayList(phraseSets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> phraseSetsBuilder_; + + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public java.util.List getPhraseSetsList() { + if (phraseSetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(phraseSets_); + } else { + return phraseSetsBuilder_.getMessageList(); + } + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public int getPhraseSetsCount() { + if (phraseSetsBuilder_ == null) { + return phraseSets_.size(); + } else { + return phraseSetsBuilder_.getCount(); + } + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1.PhraseSet getPhraseSets(int index) { + if (phraseSetsBuilder_ == null) { + return phraseSets_.get(index); + } else { + return phraseSetsBuilder_.getMessage(index); + } + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder setPhraseSets( + int index, com.google.cloud.speech.v1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.set(index, value); + onChanged(); + } else { + phraseSetsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder setPhraseSets( + int index, com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.set(index, builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets(com.google.cloud.speech.v1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.add(value); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + int index, com.google.cloud.speech.v1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.add(index, value); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.add(builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + int index, com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.add(index, builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder addAllPhraseSets( + java.lang.Iterable values) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, phraseSets_); + onChanged(); + } else { + phraseSetsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder clearPhraseSets() { + if (phraseSetsBuilder_ == null) { + phraseSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + phraseSetsBuilder_.clear(); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public Builder removePhraseSets(int index) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.remove(index); + onChanged(); + } else { + phraseSetsBuilder_.remove(index); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1.PhraseSet.Builder getPhraseSetsBuilder( + int index) { + return getPhraseSetsFieldBuilder().getBuilder(index); + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetsOrBuilder( + int index) { + if (phraseSetsBuilder_ == null) { + return phraseSets_.get(index); } else { + return phraseSetsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public java.util.List + getPhraseSetsOrBuilderList() { + if (phraseSetsBuilder_ != null) { + return phraseSetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(phraseSets_); + } + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1.PhraseSet.Builder addPhraseSetsBuilder() { + return getPhraseSetsFieldBuilder().addBuilder( + com.google.cloud.speech.v1.PhraseSet.getDefaultInstance()); + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1.PhraseSet.Builder addPhraseSetsBuilder( + int index) { + return getPhraseSetsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.PhraseSet.getDefaultInstance()); + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + public java.util.List + getPhraseSetsBuilderList() { + return getPhraseSetsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> + getPhraseSetsFieldBuilder() { + if (phraseSetsBuilder_ == null) { + phraseSetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder>( + phraseSets_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + phraseSets_ = null; + } + return phraseSetsBuilder_; + } + + private com.google.protobuf.LazyStringList phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensurePhraseSetReferencesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + phraseSetReferences_ = new com.google.protobuf.LazyStringArrayList(phraseSetReferences_); + bitField0_ |= 0x00000002; + } + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return A list containing the phraseSetReferences. + */ + public com.google.protobuf.ProtocolStringList + getPhraseSetReferencesList() { + return phraseSetReferences_.getUnmodifiableView(); + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return The count of phraseSetReferences. + */ + public int getPhraseSetReferencesCount() { + return phraseSetReferences_.size(); + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index of the element to return. + * @return The phraseSetReferences at the given index. + */ + public java.lang.String getPhraseSetReferences(int index) { + return phraseSetReferences_.get(index); + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index of the value to return. + * @return The bytes of the phraseSetReferences at the given index. + */ + public com.google.protobuf.ByteString + getPhraseSetReferencesBytes(int index) { + return phraseSetReferences_.getByteString(index); + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index to set the value at. + * @param value The phraseSetReferences to set. + * @return This builder for chaining. + */ + public Builder setPhraseSetReferences( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetReferencesIsMutable(); + phraseSetReferences_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param value The phraseSetReferences to add. + * @return This builder for chaining. + */ + public Builder addPhraseSetReferences( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetReferencesIsMutable(); + phraseSetReferences_.add(value); + onChanged(); + return this; + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param values The phraseSetReferences to add. + * @return This builder for chaining. + */ + public Builder addAllPhraseSetReferences( + java.lang.Iterable values) { + ensurePhraseSetReferencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, phraseSetReferences_); + onChanged(); + return this; + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearPhraseSetReferences() { + phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param value The bytes of the phraseSetReferences to add. + * @return This builder for chaining. + */ + public Builder addPhraseSetReferencesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePhraseSetReferencesIsMutable(); + phraseSetReferences_.add(value); + onChanged(); + return this; + } + + private java.util.List customClasses_ = + java.util.Collections.emptyList(); + private void ensureCustomClassesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + customClasses_ = new java.util.ArrayList(customClasses_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> customClassesBuilder_; + + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public java.util.List getCustomClassesList() { + if (customClassesBuilder_ == null) { + return java.util.Collections.unmodifiableList(customClasses_); + } else { + return customClassesBuilder_.getMessageList(); + } + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public int getCustomClassesCount() { + if (customClassesBuilder_ == null) { + return customClasses_.size(); + } else { + return customClassesBuilder_.getCount(); + } + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public com.google.cloud.speech.v1.CustomClass getCustomClasses(int index) { + if (customClassesBuilder_ == null) { + return customClasses_.get(index); + } else { + return customClassesBuilder_.getMessage(index); + } + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public Builder setCustomClasses( + int index, com.google.cloud.speech.v1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.set(index, value); + onChanged(); + } else { + customClassesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public Builder setCustomClasses( + int index, com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.set(index, builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public Builder addCustomClasses(com.google.cloud.speech.v1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.add(value); + onChanged(); + } else { + customClassesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public Builder addCustomClasses( + int index, com.google.cloud.speech.v1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.add(index, value); + onChanged(); + } else { + customClassesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public Builder addCustomClasses( + com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.add(builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public Builder addCustomClasses( + int index, com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.add(index, builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public Builder addAllCustomClasses( + java.lang.Iterable values) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, customClasses_); + onChanged(); + } else { + customClassesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public Builder clearCustomClasses() { + if (customClassesBuilder_ == null) { + customClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + customClassesBuilder_.clear(); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public Builder removeCustomClasses(int index) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.remove(index); + onChanged(); + } else { + customClassesBuilder_.remove(index); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public com.google.cloud.speech.v1.CustomClass.Builder getCustomClassesBuilder( + int index) { + return getCustomClassesFieldBuilder().getBuilder(index); + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index) { + if (customClassesBuilder_ == null) { + return customClasses_.get(index); } else { + return customClassesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public java.util.List + getCustomClassesOrBuilderList() { + if (customClassesBuilder_ != null) { + return customClassesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(customClasses_); + } + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public com.google.cloud.speech.v1.CustomClass.Builder addCustomClassesBuilder() { + return getCustomClassesFieldBuilder().addBuilder( + com.google.cloud.speech.v1.CustomClass.getDefaultInstance()); + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public com.google.cloud.speech.v1.CustomClass.Builder addCustomClassesBuilder( + int index) { + return getCustomClassesFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.CustomClass.getDefaultInstance()); + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + public java.util.List + getCustomClassesBuilderList() { + return getCustomClassesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> + getCustomClassesFieldBuilder() { + if (customClassesBuilder_ == null) { + customClassesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder>( + customClasses_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + customClasses_ = null; + } + return customClassesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeechAdaptation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechAdaptation) + private static final com.google.cloud.speech.v1.SpeechAdaptation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechAdaptation(); + } + + public static com.google.cloud.speech.v1.SpeechAdaptation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeechAdaptation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SpeechAdaptation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechAdaptation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationOrBuilder.java new file mode 100644 index 000000000000..b40c4c5a0477 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationOrBuilder.java @@ -0,0 +1,163 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/resource.proto + +package com.google.cloud.speech.v1; + +public interface SpeechAdaptationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeechAdaptation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + java.util.List + getPhraseSetsList(); + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + com.google.cloud.speech.v1.PhraseSet getPhraseSets(int index); + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + int getPhraseSetsCount(); + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + java.util.List + getPhraseSetsOrBuilderList(); + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; + */ + com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetsOrBuilder( + int index); + + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return A list containing the phraseSetReferences. + */ + java.util.List + getPhraseSetReferencesList(); + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return The count of phraseSetReferences. + */ + int getPhraseSetReferencesCount(); + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index of the element to return. + * @return The phraseSetReferences at the given index. + */ + java.lang.String getPhraseSetReferences(int index); + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index of the value to return. + * @return The bytes of the phraseSetReferences at the given index. + */ + com.google.protobuf.ByteString + getPhraseSetReferencesBytes(int index); + + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + java.util.List + getCustomClassesList(); + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + com.google.cloud.speech.v1.CustomClass getCustomClasses(int index); + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + int getCustomClassesCount(); + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + java.util.List + getCustomClassesOrBuilderList(); + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; + */ + com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationProto.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationProto.java new file mode 100644 index 000000000000..314543722847 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationProto.java @@ -0,0 +1,285 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public final class SpeechAdaptationProto { + private SpeechAdaptationProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_GetPhraseSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_GetPhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_ListPhraseSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_ListPhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_ListPhraseSetResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_ListPhraseSetResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_CreateCustomClassRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_CreateCustomClassRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_GetCustomClassRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_GetCustomClassRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_ListCustomClassesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_ListCustomClassesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_ListCustomClassesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_ListCustomClassesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/speech/v1/cloud_speech_ad" + + "aptation.proto\022\026google.cloud.speech.v1\032\034" + + "google/api/annotations.proto\032\027google/api" + + "/client.proto\032\037google/api/field_behavior" + + ".proto\032\031google/api/resource.proto\032%googl" + + "e/cloud/speech/v1/resource.proto\032\033google" + + "/protobuf/empty.proto\032 google/protobuf/f" + + "ield_mask.proto\"\251\001\n\026CreatePhraseSetReque" + + "st\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037speech.googl" + + "eapis.com/PhraseSet\022\032\n\rphrase_set_id\030\002 \001" + + "(\tB\003\340A\002\022:\n\nphrase_set\030\003 \001(\0132!.google.clo" + + "ud.speech.v1.PhraseSetB\003\340A\002\"\205\001\n\026UpdatePh" + + "raseSetRequest\022:\n\nphrase_set\030\001 \001(\0132!.goo" + + "gle.cloud.speech.v1.PhraseSetB\003\340A\002\022/\n\013up" + + "date_mask\030\002 \001(\0132\032.google.protobuf.FieldM" + + "ask\"L\n\023GetPhraseSetRequest\0225\n\004name\030\001 \001(\t" + + "B\'\340A\002\372A!\n\037speech.googleapis.com/PhraseSe" + + "t\"v\n\024ListPhraseSetRequest\0227\n\006parent\030\001 \001(" + + "\tB\'\340A\002\372A!\022\037speech.googleapis.com/PhraseS" + + "et\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(" + + "\t\"h\n\025ListPhraseSetResponse\0226\n\013phrase_set" + + "s\030\001 \003(\0132!.google.cloud.speech.v1.PhraseS" + + "et\022\027\n\017next_page_token\030\002 \001(\t\"O\n\026DeletePhr" + + "aseSetRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037spe" + + "ech.googleapis.com/PhraseSet\"\263\001\n\030CreateC" + + "ustomClassRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A" + + "#\022!speech.googleapis.com/CustomClass\022\034\n\017" + + "custom_class_id\030\002 \001(\tB\003\340A\002\022>\n\014custom_cla" + + "ss\030\003 \001(\0132#.google.cloud.speech.v1.Custom" + + "ClassB\003\340A\002\"\213\001\n\030UpdateCustomClassRequest\022" + + ">\n\014custom_class\030\001 \001(\0132#.google.cloud.spe" + + "ech.v1.CustomClassB\003\340A\002\022/\n\013update_mask\030\002" + + " \001(\0132\032.google.protobuf.FieldMask\"P\n\025GetC" + + "ustomClassRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n" + + "!speech.googleapis.com/CustomClass\"|\n\030Li" + + "stCustomClassesRequest\0229\n\006parent\030\001 \001(\tB)" + + "\340A\002\372A#\022!speech.googleapis.com/CustomClas" + + "s\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t" + + "\"q\n\031ListCustomClassesResponse\022;\n\016custom_" + + "classes\030\001 \003(\0132#.google.cloud.speech.v1.C" + + "ustomClass\022\027\n\017next_page_token\030\002 \001(\t\"S\n\030D" + + "eleteCustomClassRequest\0227\n\004name\030\001 \001(\tB)\340" + + "A\002\372A#\n!speech.googleapis.com/CustomClass" + + "2\216\017\n\nAdaptation\022\301\001\n\017CreatePhraseSet\022..go" + + "ogle.cloud.speech.v1.CreatePhraseSetRequ" + + "est\032!.google.cloud.speech.v1.PhraseSet\"[" + + "\202\323\344\223\0023\"./v1/{parent=projects/*/locations" + + "/*}/phraseSets:\001*\332A\037parent,phrase_set,ph" + + "rase_set_id\022\235\001\n\014GetPhraseSet\022+.google.cl" + + "oud.speech.v1.GetPhraseSetRequest\032!.goog" + + "le.cloud.speech.v1.PhraseSet\"=\202\323\344\223\0020\022./v" + + "1/{name=projects/*/locations/*/phraseSet" + + "s/*}\332A\004name\022\255\001\n\rListPhraseSet\022,.google.c" + + "loud.speech.v1.ListPhraseSetRequest\032-.go" + + "ogle.cloud.speech.v1.ListPhraseSetRespon" + + "se\"?\202\323\344\223\0020\022./v1/{parent=projects/*/locat" + + "ions/*}/phraseSets\332A\006parent\022\314\001\n\017UpdatePh" + + "raseSet\022..google.cloud.speech.v1.UpdateP" + + "hraseSetRequest\032!.google.cloud.speech.v1" + + ".PhraseSet\"f\202\323\344\223\002G29/v1/{phrase_set.name" + + "=projects/*/locations/*/phraseSets/*}:\np" + + "hrase_set\332A\026phrase_set,update_mask\022\230\001\n\017D" + + "eletePhraseSet\022..google.cloud.speech.v1." + + "DeletePhraseSetRequest\032\026.google.protobuf" + + ".Empty\"=\202\323\344\223\0020*./v1/{name=projects/*/loc" + + "ations/*/phraseSets/*}\332A\004name\022\316\001\n\021Create" + + "CustomClass\0220.google.cloud.speech.v1.Cre" + + "ateCustomClassRequest\032#.google.cloud.spe" + + "ech.v1.CustomClass\"b\202\323\344\223\0026\"1/v1/{parent=" + + "projects/*/locations/*}/customClasses:\001*" + + "\332A#parent,custom_class,custom_class_id\022\246" + + "\001\n\016GetCustomClass\022-.google.cloud.speech." + + "v1.GetCustomClassRequest\032#.google.cloud." + + "speech.v1.CustomClass\"@\202\323\344\223\0023\0221/v1/{name" + + "=projects/*/locations/*/customClasses/*}" + + "\332A\004name\022\274\001\n\021ListCustomClasses\0220.google.c" + + "loud.speech.v1.ListCustomClassesRequest\032" + + "1.google.cloud.speech.v1.ListCustomClass" + + "esResponse\"B\202\323\344\223\0023\0221/v1/{parent=projects" + + "/*/locations/*}/customClasses\332A\006parent\022\333" + + "\001\n\021UpdateCustomClass\0220.google.cloud.spee" + + "ch.v1.UpdateCustomClassRequest\032#.google." + + "cloud.speech.v1.CustomClass\"o\202\323\344\223\002N2>/v1" + + "/{custom_class.name=projects/*/locations" + + "/*/customClasses/*}:\014custom_class\332A\030cust" + + "om_class,update_mask\022\237\001\n\021DeleteCustomCla" + + "ss\0220.google.cloud.speech.v1.DeleteCustom" + + "ClassRequest\032\026.google.protobuf.Empty\"@\202\323" + + "\344\223\0023*1/v1/{name=projects/*/locations/*/c" + + "ustomClasses/*}\332A\004name\032I\312A\025speech.google" + + "apis.com\322A.https://www.googleapis.com/au" + + "th/cloud-platformB|\n\032com.google.cloud.sp" + + "eech.v1B\025SpeechAdaptationProtoP\001Z + * Provides "hints" to the speech recognizer to favor specific words and phrases + * in the results. + * + * + * Protobuf type {@code google.cloud.speech.v1.SpeechContext} + */ +public final class SpeechContext extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechContext) + SpeechContextOrBuilder { +private static final long serialVersionUID = 0L; + // Use SpeechContext.newBuilder() to construct. + private SpeechContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SpeechContext() { + phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SpeechContext(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SpeechContext( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + phrases_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + phrases_.add(s); + break; + } + case 37: { + + boost_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + phrases_ = phrases_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.SpeechContext.class, com.google.cloud.speech.v1.SpeechContext.Builder.class); + } + + public static final int PHRASES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList phrases_; + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @return A list containing the phrases. + */ + public com.google.protobuf.ProtocolStringList + getPhrasesList() { + return phrases_; + } + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @return The count of phrases. + */ + public int getPhrasesCount() { + return phrases_.size(); + } + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @param index The index of the element to return. + * @return The phrases at the given index. + */ + public java.lang.String getPhrases(int index) { + return phrases_.get(index); + } + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @param index The index of the value to return. + * @return The bytes of the phrases at the given index. + */ + public com.google.protobuf.ByteString + getPhrasesBytes(int index) { + return phrases_.getByteString(index); + } + + public static final int BOOST_FIELD_NUMBER = 4; + private float boost_; + /** + *
+   * Hint Boost. Positive value will increase the probability that a specific
+   * phrase will be recognized over other similar sounding phrases. The higher
+   * the boost, the higher the chance of false positive recognition as well.
+   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+   * enabled, so negative boost will simply be ignored. Though `boost` can
+   * accept a wide range of positive values, most use cases are best served with
+   * values between 0 and 20. We recommend using a binary search approach to
+   * finding the optimal value for your use case.
+   * 
+ * + * float boost = 4; + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < phrases_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, phrases_.getRaw(i)); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + output.writeFloat(4, boost_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < phrases_.size(); i++) { + dataSize += computeStringSizeNoTag(phrases_.getRaw(i)); + } + size += dataSize; + size += 1 * getPhrasesList().size(); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, boost_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.SpeechContext)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.SpeechContext other = (com.google.cloud.speech.v1.SpeechContext) obj; + + if (!getPhrasesList() + .equals(other.getPhrasesList())) return false; + if (java.lang.Float.floatToIntBits(getBoost()) + != java.lang.Float.floatToIntBits( + other.getBoost())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPhrasesCount() > 0) { + hash = (37 * hash) + PHRASES_FIELD_NUMBER; + hash = (53 * hash) + getPhrasesList().hashCode(); + } + hash = (37 * hash) + BOOST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getBoost()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.SpeechContext parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeechContext parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeechContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeechContext parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeechContext parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeechContext parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechContext parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeechContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.SpeechContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Provides "hints" to the speech recognizer to favor specific words and phrases
+   * in the results.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.SpeechContext} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechContext) + com.google.cloud.speech.v1.SpeechContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.SpeechContext.class, com.google.cloud.speech.v1.SpeechContext.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.SpeechContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + boost_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechContext getDefaultInstanceForType() { + return com.google.cloud.speech.v1.SpeechContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechContext build() { + com.google.cloud.speech.v1.SpeechContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechContext buildPartial() { + com.google.cloud.speech.v1.SpeechContext result = new com.google.cloud.speech.v1.SpeechContext(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + phrases_ = phrases_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.phrases_ = phrases_; + result.boost_ = boost_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.SpeechContext) { + return mergeFrom((com.google.cloud.speech.v1.SpeechContext)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.SpeechContext other) { + if (other == com.google.cloud.speech.v1.SpeechContext.getDefaultInstance()) return this; + if (!other.phrases_.isEmpty()) { + if (phrases_.isEmpty()) { + phrases_ = other.phrases_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePhrasesIsMutable(); + phrases_.addAll(other.phrases_); + } + onChanged(); + } + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.SpeechContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.SpeechContext) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensurePhrasesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + phrases_ = new com.google.protobuf.LazyStringArrayList(phrases_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @return A list containing the phrases. + */ + public com.google.protobuf.ProtocolStringList + getPhrasesList() { + return phrases_.getUnmodifiableView(); + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @return The count of phrases. + */ + public int getPhrasesCount() { + return phrases_.size(); + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @param index The index of the element to return. + * @return The phrases at the given index. + */ + public java.lang.String getPhrases(int index) { + return phrases_.get(index); + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @param index The index of the value to return. + * @return The bytes of the phrases at the given index. + */ + public com.google.protobuf.ByteString + getPhrasesBytes(int index) { + return phrases_.getByteString(index); + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @param index The index to set the value at. + * @param value The phrases to set. + * @return This builder for chaining. + */ + public Builder setPhrases( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhrasesIsMutable(); + phrases_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @param value The phrases to add. + * @return This builder for chaining. + */ + public Builder addPhrases( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhrasesIsMutable(); + phrases_.add(value); + onChanged(); + return this; + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @param values The phrases to add. + * @return This builder for chaining. + */ + public Builder addAllPhrases( + java.lang.Iterable values) { + ensurePhrasesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, phrases_); + onChanged(); + return this; + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @return This builder for chaining. + */ + public Builder clearPhrases() { + phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @param value The bytes of the phrases to add. + * @return This builder for chaining. + */ + public Builder addPhrasesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePhrasesIsMutable(); + phrases_.add(value); + onChanged(); + return this; + } + + private float boost_ ; + /** + *
+     * Hint Boost. Positive value will increase the probability that a specific
+     * phrase will be recognized over other similar sounding phrases. The higher
+     * the boost, the higher the chance of false positive recognition as well.
+     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+     * enabled, so negative boost will simply be ignored. Though `boost` can
+     * accept a wide range of positive values, most use cases are best served with
+     * values between 0 and 20. We recommend using a binary search approach to
+     * finding the optimal value for your use case.
+     * 
+ * + * float boost = 4; + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + /** + *
+     * Hint Boost. Positive value will increase the probability that a specific
+     * phrase will be recognized over other similar sounding phrases. The higher
+     * the boost, the higher the chance of false positive recognition as well.
+     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+     * enabled, so negative boost will simply be ignored. Though `boost` can
+     * accept a wide range of positive values, most use cases are best served with
+     * values between 0 and 20. We recommend using a binary search approach to
+     * finding the optimal value for your use case.
+     * 
+ * + * float boost = 4; + * @param value The boost to set. + * @return This builder for chaining. + */ + public Builder setBoost(float value) { + + boost_ = value; + onChanged(); + return this; + } + /** + *
+     * Hint Boost. Positive value will increase the probability that a specific
+     * phrase will be recognized over other similar sounding phrases. The higher
+     * the boost, the higher the chance of false positive recognition as well.
+     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+     * enabled, so negative boost will simply be ignored. Though `boost` can
+     * accept a wide range of positive values, most use cases are best served with
+     * values between 0 and 20. We recommend using a binary search approach to
+     * finding the optimal value for your use case.
+     * 
+ * + * float boost = 4; + * @return This builder for chaining. + */ + public Builder clearBoost() { + + boost_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeechContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechContext) + private static final com.google.cloud.speech.v1.SpeechContext DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechContext(); + } + + public static com.google.cloud.speech.v1.SpeechContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeechContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SpeechContext(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContextOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContextOrBuilder.java new file mode 100644 index 000000000000..97fbd87c39aa --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContextOrBuilder.java @@ -0,0 +1,107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface SpeechContextOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeechContext) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @return A list containing the phrases. + */ + java.util.List + getPhrasesList(); + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @return The count of phrases. + */ + int getPhrasesCount(); + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @param index The index of the element to return. + * @return The phrases at the given index. + */ + java.lang.String getPhrases(int index); + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @param index The index of the value to return. + * @return The bytes of the phrases at the given index. + */ + com.google.protobuf.ByteString + getPhrasesBytes(int index); + + /** + *
+   * Hint Boost. Positive value will increase the probability that a specific
+   * phrase will be recognized over other similar sounding phrases. The higher
+   * the boost, the higher the chance of false positive recognition as well.
+   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+   * enabled, so negative boost will simply be ignored. Though `boost` can
+   * accept a wide range of positive values, most use cases are best served with
+   * values between 0 and 20. We recommend using a binary search approach to
+   * finding the optimal value for your use case.
+   * 
+ * + * float boost = 4; + * @return The boost. + */ + float getBoost(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java new file mode 100644 index 000000000000..774dc9363ac9 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java @@ -0,0 +1,406 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public final class SpeechProto { + private SpeechProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_RecognizeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_RecognizeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_TranscriptOutputConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_TranscriptOutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_RecognitionConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_RecognitionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_RecognitionMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_RecognitionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_SpeechContext_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_SpeechContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_RecognitionAudio_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_RecognitionAudio_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_RecognizeResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_RecognizeResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_StreamingRecognitionResult_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_StreamingRecognitionResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_SpeechRecognitionResult_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_SpeechRecognitionResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_WordInfo_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_WordInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n)google/cloud/speech/v1/cloud_speech.pr" + + "oto\022\026google.cloud.speech.v1\032\034google/api/" + + "annotations.proto\032\027google/api/client.pro" + + "to\032\037google/api/field_behavior.proto\032%goo" + + "gle/cloud/speech/v1/resource.proto\032#goog" + + "le/longrunning/operations.proto\032\036google/" + + "protobuf/duration.proto\032\037google/protobuf" + + "/timestamp.proto\032\036google/protobuf/wrappe" + + "rs.proto\032\027google/rpc/status.proto\"\220\001\n\020Re" + + "cognizeRequest\022>\n\006config\030\001 \001(\0132).google." + + "cloud.speech.v1.RecognitionConfigB\003\340A\002\022<" + + "\n\005audio\030\002 \001(\0132(.google.cloud.speech.v1.R" + + "ecognitionAudioB\003\340A\002\"\347\001\n\033LongRunningReco" + + "gnizeRequest\022>\n\006config\030\001 \001(\0132).google.cl" + + "oud.speech.v1.RecognitionConfigB\003\340A\002\022<\n\005" + + "audio\030\002 \001(\0132(.google.cloud.speech.v1.Rec" + + "ognitionAudioB\003\340A\002\022J\n\routput_config\030\004 \001(" + + "\0132..google.cloud.speech.v1.TranscriptOut" + + "putConfigB\003\340A\001\":\n\026TranscriptOutputConfig" + + "\022\021\n\007gcs_uri\030\001 \001(\tH\000B\r\n\013output_type\"\231\001\n\031S" + + "treamingRecognizeRequest\022N\n\020streaming_co" + + "nfig\030\001 \001(\01322.google.cloud.speech.v1.Stre" + + "amingRecognitionConfigH\000\022\027\n\raudio_conten" + + "t\030\002 \001(\014H\000B\023\n\021streaming_request\"\217\001\n\032Strea" + + "mingRecognitionConfig\022>\n\006config\030\001 \001(\0132)." + + "google.cloud.speech.v1.RecognitionConfig" + + "B\003\340A\002\022\030\n\020single_utterance\030\002 \001(\010\022\027\n\017inter" + + "im_results\030\003 \001(\010\"\351\007\n\021RecognitionConfig\022I" + + "\n\010encoding\030\001 \001(\01627.google.cloud.speech.v" + + "1.RecognitionConfig.AudioEncoding\022\031\n\021sam" + + "ple_rate_hertz\030\002 \001(\005\022\033\n\023audio_channel_co" + + "unt\030\007 \001(\005\022/\n\'enable_separate_recognition" + + "_per_channel\030\014 \001(\010\022\032\n\rlanguage_code\030\003 \001(" + + "\tB\003\340A\002\022\"\n\032alternative_language_codes\030\022 \003" + + "(\t\022\030\n\020max_alternatives\030\004 \001(\005\022\030\n\020profanit" + + "y_filter\030\005 \001(\010\022<\n\nadaptation\030\024 \001(\0132(.goo" + + "gle.cloud.speech.v1.SpeechAdaptation\022>\n\017" + + "speech_contexts\030\006 \003(\0132%.google.cloud.spe" + + "ech.v1.SpeechContext\022 \n\030enable_word_time" + + "_offsets\030\010 \001(\010\022\036\n\026enable_word_confidence" + + "\030\017 \001(\010\022$\n\034enable_automatic_punctuation\030\013" + + " \001(\010\022=\n\031enable_spoken_punctuation\030\026 \001(\0132" + + "\032.google.protobuf.BoolValue\0228\n\024enable_sp" + + "oken_emojis\030\027 \001(\0132\032.google.protobuf.Bool" + + "Value\022L\n\022diarization_config\030\023 \001(\01320.goog" + + "le.cloud.speech.v1.SpeakerDiarizationCon" + + "fig\022=\n\010metadata\030\t \001(\0132+.google.cloud.spe" + + "ech.v1.RecognitionMetadata\022\r\n\005model\030\r \001(" + + "\t\022\024\n\014use_enhanced\030\016 \001(\010\"\232\001\n\rAudioEncodin" + + "g\022\030\n\024ENCODING_UNSPECIFIED\020\000\022\014\n\010LINEAR16\020" + + "\001\022\010\n\004FLAC\020\002\022\t\n\005MULAW\020\003\022\007\n\003AMR\020\004\022\n\n\006AMR_W" + + "B\020\005\022\014\n\010OGG_OPUS\020\006\022\032\n\026SPEEX_WITH_HEADER_B" + + "YTE\020\007\022\r\n\tWEBM_OPUS\020\t\"\220\001\n\030SpeakerDiarizat" + + "ionConfig\022\"\n\032enable_speaker_diarization\030" + + "\001 \001(\010\022\031\n\021min_speaker_count\030\002 \001(\005\022\031\n\021max_" + + "speaker_count\030\003 \001(\005\022\032\n\013speaker_tag\030\005 \001(\005" + + "B\005\030\001\340A\003\"\244\010\n\023RecognitionMetadata\022U\n\020inter" + + "action_type\030\001 \001(\0162;.google.cloud.speech." + + "v1.RecognitionMetadata.InteractionType\022$" + + "\n\034industry_naics_code_of_audio\030\003 \001(\r\022[\n\023" + + "microphone_distance\030\004 \001(\0162>.google.cloud" + + ".speech.v1.RecognitionMetadata.Microphon" + + "eDistance\022Z\n\023original_media_type\030\005 \001(\0162=" + + ".google.cloud.speech.v1.RecognitionMetad" + + "ata.OriginalMediaType\022^\n\025recording_devic" + + "e_type\030\006 \001(\0162?.google.cloud.speech.v1.Re" + + "cognitionMetadata.RecordingDeviceType\022\035\n" + + "\025recording_device_name\030\007 \001(\t\022\032\n\022original" + + "_mime_type\030\010 \001(\t\022\023\n\013audio_topic\030\n \001(\t\"\305\001" + + "\n\017InteractionType\022 \n\034INTERACTION_TYPE_UN" + + "SPECIFIED\020\000\022\016\n\nDISCUSSION\020\001\022\020\n\014PRESENTAT" + + "ION\020\002\022\016\n\nPHONE_CALL\020\003\022\r\n\tVOICEMAIL\020\004\022\033\n\027" + + "PROFESSIONALLY_PRODUCED\020\005\022\020\n\014VOICE_SEARC" + + "H\020\006\022\021\n\rVOICE_COMMAND\020\007\022\r\n\tDICTATION\020\010\"d\n" + + "\022MicrophoneDistance\022#\n\037MICROPHONE_DISTAN" + + "CE_UNSPECIFIED\020\000\022\r\n\tNEARFIELD\020\001\022\014\n\010MIDFI" + + "ELD\020\002\022\014\n\010FARFIELD\020\003\"N\n\021OriginalMediaType" + + "\022#\n\037ORIGINAL_MEDIA_TYPE_UNSPECIFIED\020\000\022\t\n" + + "\005AUDIO\020\001\022\t\n\005VIDEO\020\002\"\244\001\n\023RecordingDeviceT" + + "ype\022%\n!RECORDING_DEVICE_TYPE_UNSPECIFIED" + + "\020\000\022\016\n\nSMARTPHONE\020\001\022\006\n\002PC\020\002\022\016\n\nPHONE_LINE" + + "\020\003\022\013\n\007VEHICLE\020\004\022\030\n\024OTHER_OUTDOOR_DEVICE\020" + + "\005\022\027\n\023OTHER_INDOOR_DEVICE\020\006:\002\030\001\"/\n\rSpeech" + + "Context\022\017\n\007phrases\030\001 \003(\t\022\r\n\005boost\030\004 \001(\002\"" + + "D\n\020RecognitionAudio\022\021\n\007content\030\001 \001(\014H\000\022\r" + + "\n\003uri\030\002 \001(\tH\000B\016\n\014audio_source\"\213\001\n\021Recogn" + + "izeResponse\022@\n\007results\030\002 \003(\0132/.google.cl" + + "oud.speech.v1.SpeechRecognitionResult\0224\n" + + "\021total_billed_time\030\003 \001(\0132\031.google.protob" + + "uf.Duration\"\207\002\n\034LongRunningRecognizeResp" + + "onse\022@\n\007results\030\002 \003(\0132/.google.cloud.spe" + + "ech.v1.SpeechRecognitionResult\0224\n\021total_" + + "billed_time\030\003 \001(\0132\031.google.protobuf.Dura" + + "tion\022E\n\routput_config\030\006 \001(\0132..google.clo" + + "ud.speech.v1.TranscriptOutputConfig\022(\n\014o" + + "utput_error\030\007 \001(\0132\022.google.rpc.Status\"\260\001" + + "\n\034LongRunningRecognizeMetadata\022\030\n\020progre" + + "ss_percent\030\001 \001(\005\022.\n\nstart_time\030\002 \001(\0132\032.g" + + "oogle.protobuf.Timestamp\0224\n\020last_update_" + + "time\030\003 \001(\0132\032.google.protobuf.Timestamp\022\020" + + "\n\003uri\030\004 \001(\tB\003\340A\003\"\347\002\n\032StreamingRecognizeR" + + "esponse\022!\n\005error\030\001 \001(\0132\022.google.rpc.Stat" + + "us\022C\n\007results\030\002 \003(\01322.google.cloud.speec" + + "h.v1.StreamingRecognitionResult\022]\n\021speec" + + "h_event_type\030\004 \001(\0162B.google.cloud.speech" + + ".v1.StreamingRecognizeResponse.SpeechEve" + + "ntType\0224\n\021total_billed_time\030\005 \001(\0132\031.goog" + + "le.protobuf.Duration\"L\n\017SpeechEventType\022" + + "\034\n\030SPEECH_EVENT_UNSPECIFIED\020\000\022\033\n\027END_OF_" + + "SINGLE_UTTERANCE\020\001\"\362\001\n\032StreamingRecognit" + + "ionResult\022J\n\014alternatives\030\001 \003(\01324.google" + + ".cloud.speech.v1.SpeechRecognitionAltern" + + "ative\022\020\n\010is_final\030\002 \001(\010\022\021\n\tstability\030\003 \001" + + "(\002\0222\n\017result_end_time\030\004 \001(\0132\031.google.pro" + + "tobuf.Duration\022\023\n\013channel_tag\030\005 \001(\005\022\032\n\rl" + + "anguage_code\030\006 \001(\tB\003\340A\003\"\312\001\n\027SpeechRecogn" + + "itionResult\022J\n\014alternatives\030\001 \003(\01324.goog" + + "le.cloud.speech.v1.SpeechRecognitionAlte" + + "rnative\022\023\n\013channel_tag\030\002 \001(\005\0222\n\017result_e" + + "nd_time\030\004 \001(\0132\031.google.protobuf.Duration" + + "\022\032\n\rlanguage_code\030\005 \001(\tB\003\340A\003\"w\n\034SpeechRe" + + "cognitionAlternative\022\022\n\ntranscript\030\001 \001(\t" + + "\022\022\n\nconfidence\030\002 \001(\002\022/\n\005words\030\003 \003(\0132 .go" + + "ogle.cloud.speech.v1.WordInfo\"\242\001\n\010WordIn" + + "fo\022-\n\nstart_time\030\001 \001(\0132\031.google.protobuf" + + ".Duration\022+\n\010end_time\030\002 \001(\0132\031.google.pro" + + "tobuf.Duration\022\014\n\004word\030\003 \001(\t\022\022\n\nconfiden" + + "ce\030\004 \001(\002\022\030\n\013speaker_tag\030\005 \001(\005B\003\340A\0032\321\004\n\006S" + + "peech\022\220\001\n\tRecognize\022(.google.cloud.speec" + + "h.v1.RecognizeRequest\032).google.cloud.spe" + + "ech.v1.RecognizeResponse\".\202\323\344\223\002\031\"\024/v1/sp" + + "eech:recognize:\001*\332A\014config,audio\022\344\001\n\024Lon" + + "gRunningRecognize\0223.google.cloud.speech." + + "v1.LongRunningRecognizeRequest\032\035.google." + + "longrunning.Operation\"x\202\323\344\223\002$\"\037/v1/speec" + + "h:longrunningrecognize:\001*\332A\014config,audio" + + "\312A<\n\034LongRunningRecognizeResponse\022\034LongR" + + "unningRecognizeMetadata\022\201\001\n\022StreamingRec" + + "ognize\0221.google.cloud.speech.v1.Streamin" + + "gRecognizeRequest\0322.google.cloud.speech." + + "v1.StreamingRecognizeResponse\"\000(\0010\001\032I\312A\025" + + "speech.googleapis.com\322A.https://www.goog" + + "leapis.com/auth/cloud-platformBr\n\032com.go" + + "ogle.cloud.speech.v1B\013SpeechProtoP\001Z + * Alternative hypotheses (a.k.a. n-best list). + * + * + * Protobuf type {@code google.cloud.speech.v1.SpeechRecognitionAlternative} + */ +public final class SpeechRecognitionAlternative extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechRecognitionAlternative) + SpeechRecognitionAlternativeOrBuilder { +private static final long serialVersionUID = 0L; + // Use SpeechRecognitionAlternative.newBuilder() to construct. + private SpeechRecognitionAlternative(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SpeechRecognitionAlternative() { + transcript_ = ""; + words_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SpeechRecognitionAlternative(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SpeechRecognitionAlternative( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + transcript_ = s; + break; + } + case 21: { + + confidence_ = input.readFloat(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + words_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + words_.add( + input.readMessage(com.google.cloud.speech.v1.WordInfo.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + words_ = java.util.Collections.unmodifiableList(words_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.SpeechRecognitionAlternative.class, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder.class); + } + + public static final int TRANSCRIPT_FIELD_NUMBER = 1; + private volatile java.lang.Object transcript_; + /** + *
+   * Transcript text representing the words that the user spoke.
+   * In languages that use spaces to separate words, the transcript might have a
+   * leading space if it isn't the first result. You can concatenate each result
+   * to obtain the full transcript without using a separator.
+   * 
+ * + * string transcript = 1; + * @return The transcript. + */ + @java.lang.Override + public java.lang.String getTranscript() { + java.lang.Object ref = transcript_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + transcript_ = s; + return s; + } + } + /** + *
+   * Transcript text representing the words that the user spoke.
+   * In languages that use spaces to separate words, the transcript might have a
+   * leading space if it isn't the first result. You can concatenate each result
+   * to obtain the full transcript without using a separator.
+   * 
+ * + * string transcript = 1; + * @return The bytes for transcript. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTranscriptBytes() { + java.lang.Object ref = transcript_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + transcript_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIDENCE_FIELD_NUMBER = 2; + private float confidence_; + /** + *
+   * The confidence estimate between 0.0 and 1.0. A higher number
+   * indicates an estimated greater likelihood that the recognized words are
+   * correct. This field is set only for the top alternative of a non-streaming
+   * result or, of a streaming result where `is_final=true`.
+   * This field is not guaranteed to be accurate and users should not rely on it
+   * to be always provided.
+   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+   * 
+ * + * float confidence = 2; + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + + public static final int WORDS_FIELD_NUMBER = 3; + private java.util.List words_; + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + @java.lang.Override + public java.util.List getWordsList() { + return words_; + } + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + @java.lang.Override + public java.util.List + getWordsOrBuilderList() { + return words_; + } + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + @java.lang.Override + public int getWordsCount() { + return words_.size(); + } + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + @java.lang.Override + public com.google.cloud.speech.v1.WordInfo getWords(int index) { + return words_.get(index); + } + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + @java.lang.Override + public com.google.cloud.speech.v1.WordInfoOrBuilder getWordsOrBuilder( + int index) { + return words_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(transcript_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, transcript_); + } + if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { + output.writeFloat(2, confidence_); + } + for (int i = 0; i < words_.size(); i++) { + output.writeMessage(3, words_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(transcript_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, transcript_); + } + if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, confidence_); + } + for (int i = 0; i < words_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, words_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.SpeechRecognitionAlternative)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.SpeechRecognitionAlternative other = (com.google.cloud.speech.v1.SpeechRecognitionAlternative) obj; + + if (!getTranscript() + .equals(other.getTranscript())) return false; + if (java.lang.Float.floatToIntBits(getConfidence()) + != java.lang.Float.floatToIntBits( + other.getConfidence())) return false; + if (!getWordsList() + .equals(other.getWordsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TRANSCRIPT_FIELD_NUMBER; + hash = (53 * hash) + getTranscript().hashCode(); + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + if (getWordsCount() > 0) { + hash = (37 * hash) + WORDS_FIELD_NUMBER; + hash = (53 * hash) + getWordsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.SpeechRecognitionAlternative prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Alternative hypotheses (a.k.a. n-best list).
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.SpeechRecognitionAlternative} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechRecognitionAlternative) + com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.SpeechRecognitionAlternative.class, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.SpeechRecognitionAlternative.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getWordsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + transcript_ = ""; + + confidence_ = 0F; + + if (wordsBuilder_ == null) { + words_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + wordsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionAlternative getDefaultInstanceForType() { + return com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionAlternative build() { + com.google.cloud.speech.v1.SpeechRecognitionAlternative result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionAlternative buildPartial() { + com.google.cloud.speech.v1.SpeechRecognitionAlternative result = new com.google.cloud.speech.v1.SpeechRecognitionAlternative(this); + int from_bitField0_ = bitField0_; + result.transcript_ = transcript_; + result.confidence_ = confidence_; + if (wordsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + words_ = java.util.Collections.unmodifiableList(words_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.words_ = words_; + } else { + result.words_ = wordsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.SpeechRecognitionAlternative) { + return mergeFrom((com.google.cloud.speech.v1.SpeechRecognitionAlternative)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.SpeechRecognitionAlternative other) { + if (other == com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()) return this; + if (!other.getTranscript().isEmpty()) { + transcript_ = other.transcript_; + onChanged(); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + if (wordsBuilder_ == null) { + if (!other.words_.isEmpty()) { + if (words_.isEmpty()) { + words_ = other.words_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWordsIsMutable(); + words_.addAll(other.words_); + } + onChanged(); + } + } else { + if (!other.words_.isEmpty()) { + if (wordsBuilder_.isEmpty()) { + wordsBuilder_.dispose(); + wordsBuilder_ = null; + words_ = other.words_; + bitField0_ = (bitField0_ & ~0x00000001); + wordsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getWordsFieldBuilder() : null; + } else { + wordsBuilder_.addAllMessages(other.words_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.SpeechRecognitionAlternative parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.SpeechRecognitionAlternative) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object transcript_ = ""; + /** + *
+     * Transcript text representing the words that the user spoke.
+     * In languages that use spaces to separate words, the transcript might have a
+     * leading space if it isn't the first result. You can concatenate each result
+     * to obtain the full transcript without using a separator.
+     * 
+ * + * string transcript = 1; + * @return The transcript. + */ + public java.lang.String getTranscript() { + java.lang.Object ref = transcript_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + transcript_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Transcript text representing the words that the user spoke.
+     * In languages that use spaces to separate words, the transcript might have a
+     * leading space if it isn't the first result. You can concatenate each result
+     * to obtain the full transcript without using a separator.
+     * 
+ * + * string transcript = 1; + * @return The bytes for transcript. + */ + public com.google.protobuf.ByteString + getTranscriptBytes() { + java.lang.Object ref = transcript_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + transcript_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Transcript text representing the words that the user spoke.
+     * In languages that use spaces to separate words, the transcript might have a
+     * leading space if it isn't the first result. You can concatenate each result
+     * to obtain the full transcript without using a separator.
+     * 
+ * + * string transcript = 1; + * @param value The transcript to set. + * @return This builder for chaining. + */ + public Builder setTranscript( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + transcript_ = value; + onChanged(); + return this; + } + /** + *
+     * Transcript text representing the words that the user spoke.
+     * In languages that use spaces to separate words, the transcript might have a
+     * leading space if it isn't the first result. You can concatenate each result
+     * to obtain the full transcript without using a separator.
+     * 
+ * + * string transcript = 1; + * @return This builder for chaining. + */ + public Builder clearTranscript() { + + transcript_ = getDefaultInstance().getTranscript(); + onChanged(); + return this; + } + /** + *
+     * Transcript text representing the words that the user spoke.
+     * In languages that use spaces to separate words, the transcript might have a
+     * leading space if it isn't the first result. You can concatenate each result
+     * to obtain the full transcript without using a separator.
+     * 
+ * + * string transcript = 1; + * @param value The bytes for transcript to set. + * @return This builder for chaining. + */ + public Builder setTranscriptBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + transcript_ = value; + onChanged(); + return this; + } + + private float confidence_ ; + /** + *
+     * The confidence estimate between 0.0 and 1.0. A higher number
+     * indicates an estimated greater likelihood that the recognized words are
+     * correct. This field is set only for the top alternative of a non-streaming
+     * result or, of a streaming result where `is_final=true`.
+     * This field is not guaranteed to be accurate and users should not rely on it
+     * to be always provided.
+     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+     * 
+ * + * float confidence = 2; + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + /** + *
+     * The confidence estimate between 0.0 and 1.0. A higher number
+     * indicates an estimated greater likelihood that the recognized words are
+     * correct. This field is set only for the top alternative of a non-streaming
+     * result or, of a streaming result where `is_final=true`.
+     * This field is not guaranteed to be accurate and users should not rely on it
+     * to be always provided.
+     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+     * 
+ * + * float confidence = 2; + * @param value The confidence to set. + * @return This builder for chaining. + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * The confidence estimate between 0.0 and 1.0. A higher number
+     * indicates an estimated greater likelihood that the recognized words are
+     * correct. This field is set only for the top alternative of a non-streaming
+     * result or, of a streaming result where `is_final=true`.
+     * This field is not guaranteed to be accurate and users should not rely on it
+     * to be always provided.
+     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+     * 
+ * + * float confidence = 2; + * @return This builder for chaining. + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + + private java.util.List words_ = + java.util.Collections.emptyList(); + private void ensureWordsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + words_ = new java.util.ArrayList(words_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.WordInfo, com.google.cloud.speech.v1.WordInfo.Builder, com.google.cloud.speech.v1.WordInfoOrBuilder> wordsBuilder_; + + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public java.util.List getWordsList() { + if (wordsBuilder_ == null) { + return java.util.Collections.unmodifiableList(words_); + } else { + return wordsBuilder_.getMessageList(); + } + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public int getWordsCount() { + if (wordsBuilder_ == null) { + return words_.size(); + } else { + return wordsBuilder_.getCount(); + } + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public com.google.cloud.speech.v1.WordInfo getWords(int index) { + if (wordsBuilder_ == null) { + return words_.get(index); + } else { + return wordsBuilder_.getMessage(index); + } + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public Builder setWords( + int index, com.google.cloud.speech.v1.WordInfo value) { + if (wordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.set(index, value); + onChanged(); + } else { + wordsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public Builder setWords( + int index, com.google.cloud.speech.v1.WordInfo.Builder builderForValue) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + words_.set(index, builderForValue.build()); + onChanged(); + } else { + wordsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public Builder addWords(com.google.cloud.speech.v1.WordInfo value) { + if (wordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.add(value); + onChanged(); + } else { + wordsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public Builder addWords( + int index, com.google.cloud.speech.v1.WordInfo value) { + if (wordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.add(index, value); + onChanged(); + } else { + wordsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public Builder addWords( + com.google.cloud.speech.v1.WordInfo.Builder builderForValue) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + words_.add(builderForValue.build()); + onChanged(); + } else { + wordsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public Builder addWords( + int index, com.google.cloud.speech.v1.WordInfo.Builder builderForValue) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + words_.add(index, builderForValue.build()); + onChanged(); + } else { + wordsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public Builder addAllWords( + java.lang.Iterable values) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, words_); + onChanged(); + } else { + wordsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public Builder clearWords() { + if (wordsBuilder_ == null) { + words_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + wordsBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public Builder removeWords(int index) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + words_.remove(index); + onChanged(); + } else { + wordsBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public com.google.cloud.speech.v1.WordInfo.Builder getWordsBuilder( + int index) { + return getWordsFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public com.google.cloud.speech.v1.WordInfoOrBuilder getWordsOrBuilder( + int index) { + if (wordsBuilder_ == null) { + return words_.get(index); } else { + return wordsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public java.util.List + getWordsOrBuilderList() { + if (wordsBuilder_ != null) { + return wordsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(words_); + } + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public com.google.cloud.speech.v1.WordInfo.Builder addWordsBuilder() { + return getWordsFieldBuilder().addBuilder( + com.google.cloud.speech.v1.WordInfo.getDefaultInstance()); + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public com.google.cloud.speech.v1.WordInfo.Builder addWordsBuilder( + int index) { + return getWordsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.WordInfo.getDefaultInstance()); + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + public java.util.List + getWordsBuilderList() { + return getWordsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.WordInfo, com.google.cloud.speech.v1.WordInfo.Builder, com.google.cloud.speech.v1.WordInfoOrBuilder> + getWordsFieldBuilder() { + if (wordsBuilder_ == null) { + wordsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.WordInfo, com.google.cloud.speech.v1.WordInfo.Builder, com.google.cloud.speech.v1.WordInfoOrBuilder>( + words_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + words_ = null; + } + return wordsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeechRecognitionAlternative) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechRecognitionAlternative) + private static final com.google.cloud.speech.v1.SpeechRecognitionAlternative DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechRecognitionAlternative(); + } + + public static com.google.cloud.speech.v1.SpeechRecognitionAlternative getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeechRecognitionAlternative parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SpeechRecognitionAlternative(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionAlternative getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternativeOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternativeOrBuilder.java new file mode 100644 index 000000000000..90fecb6d97c4 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternativeOrBuilder.java @@ -0,0 +1,105 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface SpeechRecognitionAlternativeOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeechRecognitionAlternative) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Transcript text representing the words that the user spoke.
+   * In languages that use spaces to separate words, the transcript might have a
+   * leading space if it isn't the first result. You can concatenate each result
+   * to obtain the full transcript without using a separator.
+   * 
+ * + * string transcript = 1; + * @return The transcript. + */ + java.lang.String getTranscript(); + /** + *
+   * Transcript text representing the words that the user spoke.
+   * In languages that use spaces to separate words, the transcript might have a
+   * leading space if it isn't the first result. You can concatenate each result
+   * to obtain the full transcript without using a separator.
+   * 
+ * + * string transcript = 1; + * @return The bytes for transcript. + */ + com.google.protobuf.ByteString + getTranscriptBytes(); + + /** + *
+   * The confidence estimate between 0.0 and 1.0. A higher number
+   * indicates an estimated greater likelihood that the recognized words are
+   * correct. This field is set only for the top alternative of a non-streaming
+   * result or, of a streaming result where `is_final=true`.
+   * This field is not guaranteed to be accurate and users should not rely on it
+   * to be always provided.
+   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+   * 
+ * + * float confidence = 2; + * @return The confidence. + */ + float getConfidence(); + + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + java.util.List + getWordsList(); + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + com.google.cloud.speech.v1.WordInfo getWords(int index); + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + int getWordsCount(); + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + java.util.List + getWordsOrBuilderList(); + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1.WordInfo words = 3; + */ + com.google.cloud.speech.v1.WordInfoOrBuilder getWordsOrBuilder( + int index); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResult.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResult.java new file mode 100644 index 000000000000..5ae5d7147cc3 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResult.java @@ -0,0 +1,1457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * A speech recognition result corresponding to a portion of the audio.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.SpeechRecognitionResult} + */ +public final class SpeechRecognitionResult extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechRecognitionResult) + SpeechRecognitionResultOrBuilder { +private static final long serialVersionUID = 0L; + // Use SpeechRecognitionResult.newBuilder() to construct. + private SpeechRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SpeechRecognitionResult() { + alternatives_ = java.util.Collections.emptyList(); + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SpeechRecognitionResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SpeechRecognitionResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + alternatives_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + alternatives_.add( + input.readMessage(com.google.cloud.speech.v1.SpeechRecognitionAlternative.parser(), extensionRegistry)); + break; + } + case 16: { + + channelTag_ = input.readInt32(); + break; + } + case 34: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (resultEndTime_ != null) { + subBuilder = resultEndTime_.toBuilder(); + } + resultEndTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resultEndTime_); + resultEndTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + alternatives_ = java.util.Collections.unmodifiableList(alternatives_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.SpeechRecognitionResult.class, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder.class); + } + + public static final int ALTERNATIVES_FIELD_NUMBER = 1; + private java.util.List alternatives_; + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public java.util.List getAlternativesList() { + return alternatives_; + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public java.util.List + getAlternativesOrBuilderList() { + return alternatives_; + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public int getAlternativesCount() { + return alternatives_.size(); + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index) { + return alternatives_.get(index); + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( + int index) { + return alternatives_.get(index); + } + + public static final int CHANNEL_TAG_FIELD_NUMBER = 2; + private int channelTag_; + /** + *
+   * For multi-channel audio, this is the channel number corresponding to the
+   * recognized result for the audio from that channel.
+   * For audio_channel_count = N, its output values can range from '1' to 'N'.
+   * 
+ * + * int32 channel_tag = 2; + * @return The channelTag. + */ + @java.lang.Override + public int getChannelTag() { + return channelTag_; + } + + public static final int RESULT_END_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Duration resultEndTime_; + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return Whether the resultEndTime field is set. + */ + @java.lang.Override + public boolean hasResultEndTime() { + return resultEndTime_ != null; + } + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return The resultEndTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getResultEndTime() { + return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; + } + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { + return getResultEndTime(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 5; + private volatile java.lang.Object languageCode_; + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < alternatives_.size(); i++) { + output.writeMessage(1, alternatives_.get(i)); + } + if (channelTag_ != 0) { + output.writeInt32(2, channelTag_); + } + if (resultEndTime_ != null) { + output.writeMessage(4, getResultEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, languageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < alternatives_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, alternatives_.get(i)); + } + if (channelTag_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, channelTag_); + } + if (resultEndTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getResultEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.SpeechRecognitionResult)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.SpeechRecognitionResult other = (com.google.cloud.speech.v1.SpeechRecognitionResult) obj; + + if (!getAlternativesList() + .equals(other.getAlternativesList())) return false; + if (getChannelTag() + != other.getChannelTag()) return false; + if (hasResultEndTime() != other.hasResultEndTime()) return false; + if (hasResultEndTime()) { + if (!getResultEndTime() + .equals(other.getResultEndTime())) return false; + } + if (!getLanguageCode() + .equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAlternativesCount() > 0) { + hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; + hash = (53 * hash) + getAlternativesList().hashCode(); + } + hash = (37 * hash) + CHANNEL_TAG_FIELD_NUMBER; + hash = (53 * hash) + getChannelTag(); + if (hasResultEndTime()) { + hash = (37 * hash) + RESULT_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResultEndTime().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechRecognitionResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeechRecognitionResult parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.SpeechRecognitionResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A speech recognition result corresponding to a portion of the audio.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.SpeechRecognitionResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechRecognitionResult) + com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.SpeechRecognitionResult.class, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.SpeechRecognitionResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAlternativesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (alternativesBuilder_ == null) { + alternatives_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + alternativesBuilder_.clear(); + } + channelTag_ = 0; + + if (resultEndTimeBuilder_ == null) { + resultEndTime_ = null; + } else { + resultEndTime_ = null; + resultEndTimeBuilder_ = null; + } + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionResult getDefaultInstanceForType() { + return com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionResult build() { + com.google.cloud.speech.v1.SpeechRecognitionResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionResult buildPartial() { + com.google.cloud.speech.v1.SpeechRecognitionResult result = new com.google.cloud.speech.v1.SpeechRecognitionResult(this); + int from_bitField0_ = bitField0_; + if (alternativesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + alternatives_ = java.util.Collections.unmodifiableList(alternatives_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.alternatives_ = alternatives_; + } else { + result.alternatives_ = alternativesBuilder_.build(); + } + result.channelTag_ = channelTag_; + if (resultEndTimeBuilder_ == null) { + result.resultEndTime_ = resultEndTime_; + } else { + result.resultEndTime_ = resultEndTimeBuilder_.build(); + } + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.SpeechRecognitionResult) { + return mergeFrom((com.google.cloud.speech.v1.SpeechRecognitionResult)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.SpeechRecognitionResult other) { + if (other == com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()) return this; + if (alternativesBuilder_ == null) { + if (!other.alternatives_.isEmpty()) { + if (alternatives_.isEmpty()) { + alternatives_ = other.alternatives_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAlternativesIsMutable(); + alternatives_.addAll(other.alternatives_); + } + onChanged(); + } + } else { + if (!other.alternatives_.isEmpty()) { + if (alternativesBuilder_.isEmpty()) { + alternativesBuilder_.dispose(); + alternativesBuilder_ = null; + alternatives_ = other.alternatives_; + bitField0_ = (bitField0_ & ~0x00000001); + alternativesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAlternativesFieldBuilder() : null; + } else { + alternativesBuilder_.addAllMessages(other.alternatives_); + } + } + } + if (other.getChannelTag() != 0) { + setChannelTag(other.getChannelTag()); + } + if (other.hasResultEndTime()) { + mergeResultEndTime(other.getResultEndTime()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.SpeechRecognitionResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.SpeechRecognitionResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List alternatives_ = + java.util.Collections.emptyList(); + private void ensureAlternativesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + alternatives_ = new java.util.ArrayList(alternatives_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechRecognitionAlternative, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> alternativesBuilder_; + + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public java.util.List getAlternativesList() { + if (alternativesBuilder_ == null) { + return java.util.Collections.unmodifiableList(alternatives_); + } else { + return alternativesBuilder_.getMessageList(); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public int getAlternativesCount() { + if (alternativesBuilder_ == null) { + return alternatives_.size(); + } else { + return alternativesBuilder_.getCount(); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index) { + if (alternativesBuilder_ == null) { + return alternatives_.get(index); + } else { + return alternativesBuilder_.getMessage(index); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder setAlternatives( + int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { + if (alternativesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativesIsMutable(); + alternatives_.set(index, value); + onChanged(); + } else { + alternativesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder setAlternatives( + int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.set(index, builderForValue.build()); + onChanged(); + } else { + alternativesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives(com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { + if (alternativesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativesIsMutable(); + alternatives_.add(value); + onChanged(); + } else { + alternativesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives( + int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { + if (alternativesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativesIsMutable(); + alternatives_.add(index, value); + onChanged(); + } else { + alternativesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives( + com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.add(builderForValue.build()); + onChanged(); + } else { + alternativesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives( + int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.add(index, builderForValue.build()); + onChanged(); + } else { + alternativesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAllAlternatives( + java.lang.Iterable values) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, alternatives_); + onChanged(); + } else { + alternativesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder clearAlternatives() { + if (alternativesBuilder_ == null) { + alternatives_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + alternativesBuilder_.clear(); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder removeAlternatives(int index) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.remove(index); + onChanged(); + } else { + alternativesBuilder_.remove(index); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder getAlternativesBuilder( + int index) { + return getAlternativesFieldBuilder().getBuilder(index); + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( + int index) { + if (alternativesBuilder_ == null) { + return alternatives_.get(index); } else { + return alternativesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public java.util.List + getAlternativesOrBuilderList() { + if (alternativesBuilder_ != null) { + return alternativesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(alternatives_); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder addAlternativesBuilder() { + return getAlternativesFieldBuilder().addBuilder( + com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()); + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder addAlternativesBuilder( + int index) { + return getAlternativesFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()); + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public java.util.List + getAlternativesBuilderList() { + return getAlternativesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechRecognitionAlternative, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> + getAlternativesFieldBuilder() { + if (alternativesBuilder_ == null) { + alternativesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechRecognitionAlternative, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder>( + alternatives_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + alternatives_ = null; + } + return alternativesBuilder_; + } + + private int channelTag_ ; + /** + *
+     * For multi-channel audio, this is the channel number corresponding to the
+     * recognized result for the audio from that channel.
+     * For audio_channel_count = N, its output values can range from '1' to 'N'.
+     * 
+ * + * int32 channel_tag = 2; + * @return The channelTag. + */ + @java.lang.Override + public int getChannelTag() { + return channelTag_; + } + /** + *
+     * For multi-channel audio, this is the channel number corresponding to the
+     * recognized result for the audio from that channel.
+     * For audio_channel_count = N, its output values can range from '1' to 'N'.
+     * 
+ * + * int32 channel_tag = 2; + * @param value The channelTag to set. + * @return This builder for chaining. + */ + public Builder setChannelTag(int value) { + + channelTag_ = value; + onChanged(); + return this; + } + /** + *
+     * For multi-channel audio, this is the channel number corresponding to the
+     * recognized result for the audio from that channel.
+     * For audio_channel_count = N, its output values can range from '1' to 'N'.
+     * 
+ * + * int32 channel_tag = 2; + * @return This builder for chaining. + */ + public Builder clearChannelTag() { + + channelTag_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration resultEndTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> resultEndTimeBuilder_; + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return Whether the resultEndTime field is set. + */ + public boolean hasResultEndTime() { + return resultEndTimeBuilder_ != null || resultEndTime_ != null; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return The resultEndTime. + */ + public com.google.protobuf.Duration getResultEndTime() { + if (resultEndTimeBuilder_ == null) { + return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; + } else { + return resultEndTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder setResultEndTime(com.google.protobuf.Duration value) { + if (resultEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resultEndTime_ = value; + onChanged(); + } else { + resultEndTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder setResultEndTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (resultEndTimeBuilder_ == null) { + resultEndTime_ = builderForValue.build(); + onChanged(); + } else { + resultEndTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder mergeResultEndTime(com.google.protobuf.Duration value) { + if (resultEndTimeBuilder_ == null) { + if (resultEndTime_ != null) { + resultEndTime_ = + com.google.protobuf.Duration.newBuilder(resultEndTime_).mergeFrom(value).buildPartial(); + } else { + resultEndTime_ = value; + } + onChanged(); + } else { + resultEndTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder clearResultEndTime() { + if (resultEndTimeBuilder_ == null) { + resultEndTime_ = null; + onChanged(); + } else { + resultEndTime_ = null; + resultEndTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public com.google.protobuf.Duration.Builder getResultEndTimeBuilder() { + + onChanged(); + return getResultEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { + if (resultEndTimeBuilder_ != null) { + return resultEndTimeBuilder_.getMessageOrBuilder(); + } else { + return resultEndTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; + } + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getResultEndTimeFieldBuilder() { + if (resultEndTimeBuilder_ == null) { + resultEndTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getResultEndTime(), + getParentForChildren(), + isClean()); + resultEndTime_ = null; + } + return resultEndTimeBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeechRecognitionResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechRecognitionResult) + private static final com.google.cloud.speech.v1.SpeechRecognitionResult DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechRecognitionResult(); + } + + public static com.google.cloud.speech.v1.SpeechRecognitionResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeechRecognitionResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SpeechRecognitionResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResultOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResultOrBuilder.java new file mode 100644 index 000000000000..aa2bef7b69e6 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResultOrBuilder.java @@ -0,0 +1,134 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface SpeechRecognitionResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeechRecognitionResult) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + java.util.List + getAlternativesList(); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + int getAlternativesCount(); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + java.util.List + getAlternativesOrBuilderList(); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( + int index); + + /** + *
+   * For multi-channel audio, this is the channel number corresponding to the
+   * recognized result for the audio from that channel.
+   * For audio_channel_count = N, its output values can range from '1' to 'N'.
+   * 
+ * + * int32 channel_tag = 2; + * @return The channelTag. + */ + int getChannelTag(); + + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return Whether the resultEndTime field is set. + */ + boolean hasResultEndTime(); + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return The resultEndTime. + */ + com.google.protobuf.Duration getResultEndTime(); + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder(); + + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString + getLanguageCodeBytes(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechResourceProto.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechResourceProto.java new file mode 100644 index 000000000000..c8d1551f7230 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechResourceProto.java @@ -0,0 +1,121 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/resource.proto + +package com.google.cloud.speech.v1; + +public final class SpeechResourceProto { + private SpeechResourceProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_CustomClass_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_CustomClass_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_CustomClass_ClassItem_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_CustomClass_ClassItem_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_PhraseSet_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_PhraseSet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_PhraseSet_Phrase_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_PhraseSet_Phrase_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1_SpeechAdaptation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1_SpeechAdaptation_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n%google/cloud/speech/v1/resource.proto\022" + + "\026google.cloud.speech.v1\032\031google/api/reso" + + "urce.proto\"\374\001\n\013CustomClass\022\014\n\004name\030\001 \001(\t" + + "\022\027\n\017custom_class_id\030\002 \001(\t\022<\n\005items\030\003 \003(\013" + + "2-.google.cloud.speech.v1.CustomClass.Cl" + + "assItem\032\032\n\tClassItem\022\r\n\005value\030\001 \001(\t:l\352Ai" + + "\n!speech.googleapis.com/CustomClass\022Dpro" + + "jects/{project}/locations/{location}/cus" + + "tomClasses/{custom_class}\"\362\001\n\tPhraseSet\022" + + "\014\n\004name\030\001 \001(\t\0229\n\007phrases\030\002 \003(\0132(.google." + + "cloud.speech.v1.PhraseSet.Phrase\022\r\n\005boos" + + "t\030\004 \001(\002\032&\n\006Phrase\022\r\n\005value\030\001 \001(\t\022\r\n\005boos" + + "t\030\002 \001(\002:e\352Ab\n\037speech.googleapis.com/Phra" + + "seSet\022?projects/{project}/locations/{loc" + + "ation}/phraseSets/{phrase_set}\"\314\001\n\020Speec" + + "hAdaptation\0226\n\013phrase_sets\030\001 \003(\0132!.googl" + + "e.cloud.speech.v1.PhraseSet\022C\n\025phrase_se" + + "t_references\030\002 \003(\tB$\372A!\n\037speech.googleap" + + "is.com/PhraseSet\022;\n\016custom_classes\030\003 \003(\013" + + "2#.google.cloud.speech.v1.CustomClassBz\n" + + "\032com.google.cloud.speech.v1B\023SpeechResou" + + "rceProtoP\001Z + * Provides information to the recognizer that specifies how to process the + * request. + * + * + * Protobuf type {@code google.cloud.speech.v1.StreamingRecognitionConfig} + */ +public final class StreamingRecognitionConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.StreamingRecognitionConfig) + StreamingRecognitionConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use StreamingRecognitionConfig.newBuilder() to construct. + private StreamingRecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StreamingRecognitionConfig() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StreamingRecognitionConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StreamingRecognitionConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.cloud.speech.v1.RecognitionConfig.Builder subBuilder = null; + if (config_ != null) { + subBuilder = config_.toBuilder(); + } + config_ = input.readMessage(com.google.cloud.speech.v1.RecognitionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(config_); + config_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + + singleUtterance_ = input.readBool(); + break; + } + case 24: { + + interimResults_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.StreamingRecognitionConfig.class, com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder.class); + } + + public static final int CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.speech.v1.RecognitionConfig config_; + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return config_ != null; + } + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionConfig getConfig() { + return config_ == null ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; + } + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { + return getConfig(); + } + + public static final int SINGLE_UTTERANCE_FIELD_NUMBER = 2; + private boolean singleUtterance_; + /** + *
+   * If `false` or omitted, the recognizer will perform continuous
+   * recognition (continuing to wait for and process audio even if the user
+   * pauses speaking) until the client closes the input stream (gRPC API) or
+   * until the maximum time limit has been reached. May return multiple
+   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
+   * If `true`, the recognizer will detect a single spoken utterance. When it
+   * detects that the user has paused or stopped speaking, it will return an
+   * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
+   * more than one `StreamingRecognitionResult` with the `is_final` flag set to
+   * `true`.
+   * The `single_utterance` field can only be used with specified models,
+   * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
+   * must be set to:
+   * * `command_and_search`
+   * * `phone_call` AND additional field `useEnhanced`=`true`
+   * * The `model` field is left undefined. In this case the API auto-selects
+   *   a model based on any other parameters that you set in
+   *   `RecognitionConfig`.
+   * 
+ * + * bool single_utterance = 2; + * @return The singleUtterance. + */ + @java.lang.Override + public boolean getSingleUtterance() { + return singleUtterance_; + } + + public static final int INTERIM_RESULTS_FIELD_NUMBER = 3; + private boolean interimResults_; + /** + *
+   * If `true`, interim results (tentative hypotheses) may be
+   * returned as they become available (these interim results are indicated with
+   * the `is_final=false` flag).
+   * If `false` or omitted, only `is_final=true` result(s) are returned.
+   * 
+ * + * bool interim_results = 3; + * @return The interimResults. + */ + @java.lang.Override + public boolean getInterimResults() { + return interimResults_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (config_ != null) { + output.writeMessage(1, getConfig()); + } + if (singleUtterance_ != false) { + output.writeBool(2, singleUtterance_); + } + if (interimResults_ != false) { + output.writeBool(3, interimResults_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (config_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getConfig()); + } + if (singleUtterance_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, singleUtterance_); + } + if (interimResults_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, interimResults_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.StreamingRecognitionConfig)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.StreamingRecognitionConfig other = (com.google.cloud.speech.v1.StreamingRecognitionConfig) obj; + + if (hasConfig() != other.hasConfig()) return false; + if (hasConfig()) { + if (!getConfig() + .equals(other.getConfig())) return false; + } + if (getSingleUtterance() + != other.getSingleUtterance()) return false; + if (getInterimResults() + != other.getInterimResults()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + hash = (37 * hash) + SINGLE_UTTERANCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSingleUtterance()); + hash = (37 * hash) + INTERIM_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getInterimResults()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.StreamingRecognitionConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.StreamingRecognitionConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.StreamingRecognitionConfig) + com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.StreamingRecognitionConfig.class, com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.StreamingRecognitionConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (configBuilder_ == null) { + config_ = null; + } else { + config_ = null; + configBuilder_ = null; + } + singleUtterance_ = false; + + interimResults_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionConfig getDefaultInstanceForType() { + return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionConfig build() { + com.google.cloud.speech.v1.StreamingRecognitionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionConfig buildPartial() { + com.google.cloud.speech.v1.StreamingRecognitionConfig result = new com.google.cloud.speech.v1.StreamingRecognitionConfig(this); + if (configBuilder_ == null) { + result.config_ = config_; + } else { + result.config_ = configBuilder_.build(); + } + result.singleUtterance_ = singleUtterance_; + result.interimResults_ = interimResults_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.StreamingRecognitionConfig) { + return mergeFrom((com.google.cloud.speech.v1.StreamingRecognitionConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognitionConfig other) { + if (other == com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance()) return this; + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + if (other.getSingleUtterance() != false) { + setSingleUtterance(other.getSingleUtterance()); + } + if (other.getInterimResults() != false) { + setInterimResults(other.getInterimResults()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.StreamingRecognitionConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.StreamingRecognitionConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.speech.v1.RecognitionConfig config_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder> configBuilder_; + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + public boolean hasConfig() { + return configBuilder_ != null || config_ != null; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + public com.google.cloud.speech.v1.RecognitionConfig getConfig() { + if (configBuilder_ == null) { + return config_ == null ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig(com.google.cloud.speech.v1.RecognitionConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig( + com.google.cloud.speech.v1.RecognitionConfig.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeConfig(com.google.cloud.speech.v1.RecognitionConfig value) { + if (configBuilder_ == null) { + if (config_ != null) { + config_ = + com.google.cloud.speech.v1.RecognitionConfig.newBuilder(config_).mergeFrom(value).buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + configBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + config_ = null; + onChanged(); + } else { + config_ = null; + configBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.RecognitionConfig.Builder getConfigBuilder() { + + onChanged(); + return getConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null ? + com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; + } + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder>( + getConfig(), + getParentForChildren(), + isClean()); + config_ = null; + } + return configBuilder_; + } + + private boolean singleUtterance_ ; + /** + *
+     * If `false` or omitted, the recognizer will perform continuous
+     * recognition (continuing to wait for and process audio even if the user
+     * pauses speaking) until the client closes the input stream (gRPC API) or
+     * until the maximum time limit has been reached. May return multiple
+     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
+     * If `true`, the recognizer will detect a single spoken utterance. When it
+     * detects that the user has paused or stopped speaking, it will return an
+     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
+     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
+     * `true`.
+     * The `single_utterance` field can only be used with specified models,
+     * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
+     * must be set to:
+     * * `command_and_search`
+     * * `phone_call` AND additional field `useEnhanced`=`true`
+     * * The `model` field is left undefined. In this case the API auto-selects
+     *   a model based on any other parameters that you set in
+     *   `RecognitionConfig`.
+     * 
+ * + * bool single_utterance = 2; + * @return The singleUtterance. + */ + @java.lang.Override + public boolean getSingleUtterance() { + return singleUtterance_; + } + /** + *
+     * If `false` or omitted, the recognizer will perform continuous
+     * recognition (continuing to wait for and process audio even if the user
+     * pauses speaking) until the client closes the input stream (gRPC API) or
+     * until the maximum time limit has been reached. May return multiple
+     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
+     * If `true`, the recognizer will detect a single spoken utterance. When it
+     * detects that the user has paused or stopped speaking, it will return an
+     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
+     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
+     * `true`.
+     * The `single_utterance` field can only be used with specified models,
+     * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
+     * must be set to:
+     * * `command_and_search`
+     * * `phone_call` AND additional field `useEnhanced`=`true`
+     * * The `model` field is left undefined. In this case the API auto-selects
+     *   a model based on any other parameters that you set in
+     *   `RecognitionConfig`.
+     * 
+ * + * bool single_utterance = 2; + * @param value The singleUtterance to set. + * @return This builder for chaining. + */ + public Builder setSingleUtterance(boolean value) { + + singleUtterance_ = value; + onChanged(); + return this; + } + /** + *
+     * If `false` or omitted, the recognizer will perform continuous
+     * recognition (continuing to wait for and process audio even if the user
+     * pauses speaking) until the client closes the input stream (gRPC API) or
+     * until the maximum time limit has been reached. May return multiple
+     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
+     * If `true`, the recognizer will detect a single spoken utterance. When it
+     * detects that the user has paused or stopped speaking, it will return an
+     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
+     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
+     * `true`.
+     * The `single_utterance` field can only be used with specified models,
+     * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
+     * must be set to:
+     * * `command_and_search`
+     * * `phone_call` AND additional field `useEnhanced`=`true`
+     * * The `model` field is left undefined. In this case the API auto-selects
+     *   a model based on any other parameters that you set in
+     *   `RecognitionConfig`.
+     * 
+ * + * bool single_utterance = 2; + * @return This builder for chaining. + */ + public Builder clearSingleUtterance() { + + singleUtterance_ = false; + onChanged(); + return this; + } + + private boolean interimResults_ ; + /** + *
+     * If `true`, interim results (tentative hypotheses) may be
+     * returned as they become available (these interim results are indicated with
+     * the `is_final=false` flag).
+     * If `false` or omitted, only `is_final=true` result(s) are returned.
+     * 
+ * + * bool interim_results = 3; + * @return The interimResults. + */ + @java.lang.Override + public boolean getInterimResults() { + return interimResults_; + } + /** + *
+     * If `true`, interim results (tentative hypotheses) may be
+     * returned as they become available (these interim results are indicated with
+     * the `is_final=false` flag).
+     * If `false` or omitted, only `is_final=true` result(s) are returned.
+     * 
+ * + * bool interim_results = 3; + * @param value The interimResults to set. + * @return This builder for chaining. + */ + public Builder setInterimResults(boolean value) { + + interimResults_ = value; + onChanged(); + return this; + } + /** + *
+     * If `true`, interim results (tentative hypotheses) may be
+     * returned as they become available (these interim results are indicated with
+     * the `is_final=false` flag).
+     * If `false` or omitted, only `is_final=true` result(s) are returned.
+     * 
+ * + * bool interim_results = 3; + * @return This builder for chaining. + */ + public Builder clearInterimResults() { + + interimResults_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.StreamingRecognitionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognitionConfig) + private static final com.google.cloud.speech.v1.StreamingRecognitionConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.StreamingRecognitionConfig(); + } + + public static com.google.cloud.speech.v1.StreamingRecognitionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingRecognitionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingRecognitionConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfigOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfigOrBuilder.java new file mode 100644 index 000000000000..8c5cfecdc1c5 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfigOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface StreamingRecognitionConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.StreamingRecognitionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + boolean hasConfig(); + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + com.google.cloud.speech.v1.RecognitionConfig getConfig(); + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder(); + + /** + *
+   * If `false` or omitted, the recognizer will perform continuous
+   * recognition (continuing to wait for and process audio even if the user
+   * pauses speaking) until the client closes the input stream (gRPC API) or
+   * until the maximum time limit has been reached. May return multiple
+   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
+   * If `true`, the recognizer will detect a single spoken utterance. When it
+   * detects that the user has paused or stopped speaking, it will return an
+   * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
+   * more than one `StreamingRecognitionResult` with the `is_final` flag set to
+   * `true`.
+   * The `single_utterance` field can only be used with specified models,
+   * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
+   * must be set to:
+   * * `command_and_search`
+   * * `phone_call` AND additional field `useEnhanced`=`true`
+   * * The `model` field is left undefined. In this case the API auto-selects
+   *   a model based on any other parameters that you set in
+   *   `RecognitionConfig`.
+   * 
+ * + * bool single_utterance = 2; + * @return The singleUtterance. + */ + boolean getSingleUtterance(); + + /** + *
+   * If `true`, interim results (tentative hypotheses) may be
+   * returned as they become available (these interim results are indicated with
+   * the `is_final=false` flag).
+   * If `false` or omitted, only `is_final=true` result(s) are returned.
+   * 
+ * + * bool interim_results = 3; + * @return The interimResults. + */ + boolean getInterimResults(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResult.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResult.java new file mode 100644 index 000000000000..91bf80323ea6 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResult.java @@ -0,0 +1,1654 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * A streaming speech recognition result corresponding to a portion of the audio
+ * that is currently being processed.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.StreamingRecognitionResult} + */ +public final class StreamingRecognitionResult extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.StreamingRecognitionResult) + StreamingRecognitionResultOrBuilder { +private static final long serialVersionUID = 0L; + // Use StreamingRecognitionResult.newBuilder() to construct. + private StreamingRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StreamingRecognitionResult() { + alternatives_ = java.util.Collections.emptyList(); + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StreamingRecognitionResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StreamingRecognitionResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + alternatives_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + alternatives_.add( + input.readMessage(com.google.cloud.speech.v1.SpeechRecognitionAlternative.parser(), extensionRegistry)); + break; + } + case 16: { + + isFinal_ = input.readBool(); + break; + } + case 29: { + + stability_ = input.readFloat(); + break; + } + case 34: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (resultEndTime_ != null) { + subBuilder = resultEndTime_.toBuilder(); + } + resultEndTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resultEndTime_); + resultEndTime_ = subBuilder.buildPartial(); + } + + break; + } + case 40: { + + channelTag_ = input.readInt32(); + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + alternatives_ = java.util.Collections.unmodifiableList(alternatives_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.StreamingRecognitionResult.class, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder.class); + } + + public static final int ALTERNATIVES_FIELD_NUMBER = 1; + private java.util.List alternatives_; + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public java.util.List getAlternativesList() { + return alternatives_; + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public java.util.List + getAlternativesOrBuilderList() { + return alternatives_; + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public int getAlternativesCount() { + return alternatives_.size(); + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index) { + return alternatives_.get(index); + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( + int index) { + return alternatives_.get(index); + } + + public static final int IS_FINAL_FIELD_NUMBER = 2; + private boolean isFinal_; + /** + *
+   * If `false`, this `StreamingRecognitionResult` represents an
+   * interim result that may change. If `true`, this is the final time the
+   * speech service will return this particular `StreamingRecognitionResult`,
+   * the recognizer will not return any further hypotheses for this portion of
+   * the transcript and corresponding audio.
+   * 
+ * + * bool is_final = 2; + * @return The isFinal. + */ + @java.lang.Override + public boolean getIsFinal() { + return isFinal_; + } + + public static final int STABILITY_FIELD_NUMBER = 3; + private float stability_; + /** + *
+   * An estimate of the likelihood that the recognizer will not
+   * change its guess about this interim result. Values range from 0.0
+   * (completely unstable) to 1.0 (completely stable).
+   * This field is only provided for interim results (`is_final=false`).
+   * The default of 0.0 is a sentinel value indicating `stability` was not set.
+   * 
+ * + * float stability = 3; + * @return The stability. + */ + @java.lang.Override + public float getStability() { + return stability_; + } + + public static final int RESULT_END_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Duration resultEndTime_; + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return Whether the resultEndTime field is set. + */ + @java.lang.Override + public boolean hasResultEndTime() { + return resultEndTime_ != null; + } + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return The resultEndTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getResultEndTime() { + return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; + } + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { + return getResultEndTime(); + } + + public static final int CHANNEL_TAG_FIELD_NUMBER = 5; + private int channelTag_; + /** + *
+   * For multi-channel audio, this is the channel number corresponding to the
+   * recognized result for the audio from that channel.
+   * For audio_channel_count = N, its output values can range from '1' to 'N'.
+   * 
+ * + * int32 channel_tag = 5; + * @return The channelTag. + */ + @java.lang.Override + public int getChannelTag() { + return channelTag_; + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 6; + private volatile java.lang.Object languageCode_; + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < alternatives_.size(); i++) { + output.writeMessage(1, alternatives_.get(i)); + } + if (isFinal_ != false) { + output.writeBool(2, isFinal_); + } + if (java.lang.Float.floatToRawIntBits(stability_) != 0) { + output.writeFloat(3, stability_); + } + if (resultEndTime_ != null) { + output.writeMessage(4, getResultEndTime()); + } + if (channelTag_ != 0) { + output.writeInt32(5, channelTag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, languageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < alternatives_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, alternatives_.get(i)); + } + if (isFinal_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, isFinal_); + } + if (java.lang.Float.floatToRawIntBits(stability_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, stability_); + } + if (resultEndTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getResultEndTime()); + } + if (channelTag_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, channelTag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.StreamingRecognitionResult)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.StreamingRecognitionResult other = (com.google.cloud.speech.v1.StreamingRecognitionResult) obj; + + if (!getAlternativesList() + .equals(other.getAlternativesList())) return false; + if (getIsFinal() + != other.getIsFinal()) return false; + if (java.lang.Float.floatToIntBits(getStability()) + != java.lang.Float.floatToIntBits( + other.getStability())) return false; + if (hasResultEndTime() != other.hasResultEndTime()) return false; + if (hasResultEndTime()) { + if (!getResultEndTime() + .equals(other.getResultEndTime())) return false; + } + if (getChannelTag() + != other.getChannelTag()) return false; + if (!getLanguageCode() + .equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAlternativesCount() > 0) { + hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; + hash = (53 * hash) + getAlternativesList().hashCode(); + } + hash = (37 * hash) + IS_FINAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsFinal()); + hash = (37 * hash) + STABILITY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getStability()); + if (hasResultEndTime()) { + hash = (37 * hash) + RESULT_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResultEndTime().hashCode(); + } + hash = (37 * hash) + CHANNEL_TAG_FIELD_NUMBER; + hash = (53 * hash) + getChannelTag(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognitionResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.StreamingRecognitionResult parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.StreamingRecognitionResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A streaming speech recognition result corresponding to a portion of the audio
+   * that is currently being processed.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.StreamingRecognitionResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.StreamingRecognitionResult) + com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.StreamingRecognitionResult.class, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.StreamingRecognitionResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAlternativesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (alternativesBuilder_ == null) { + alternatives_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + alternativesBuilder_.clear(); + } + isFinal_ = false; + + stability_ = 0F; + + if (resultEndTimeBuilder_ == null) { + resultEndTime_ = null; + } else { + resultEndTime_ = null; + resultEndTimeBuilder_ = null; + } + channelTag_ = 0; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionResult getDefaultInstanceForType() { + return com.google.cloud.speech.v1.StreamingRecognitionResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionResult build() { + com.google.cloud.speech.v1.StreamingRecognitionResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionResult buildPartial() { + com.google.cloud.speech.v1.StreamingRecognitionResult result = new com.google.cloud.speech.v1.StreamingRecognitionResult(this); + int from_bitField0_ = bitField0_; + if (alternativesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + alternatives_ = java.util.Collections.unmodifiableList(alternatives_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.alternatives_ = alternatives_; + } else { + result.alternatives_ = alternativesBuilder_.build(); + } + result.isFinal_ = isFinal_; + result.stability_ = stability_; + if (resultEndTimeBuilder_ == null) { + result.resultEndTime_ = resultEndTime_; + } else { + result.resultEndTime_ = resultEndTimeBuilder_.build(); + } + result.channelTag_ = channelTag_; + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.StreamingRecognitionResult) { + return mergeFrom((com.google.cloud.speech.v1.StreamingRecognitionResult)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognitionResult other) { + if (other == com.google.cloud.speech.v1.StreamingRecognitionResult.getDefaultInstance()) return this; + if (alternativesBuilder_ == null) { + if (!other.alternatives_.isEmpty()) { + if (alternatives_.isEmpty()) { + alternatives_ = other.alternatives_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAlternativesIsMutable(); + alternatives_.addAll(other.alternatives_); + } + onChanged(); + } + } else { + if (!other.alternatives_.isEmpty()) { + if (alternativesBuilder_.isEmpty()) { + alternativesBuilder_.dispose(); + alternativesBuilder_ = null; + alternatives_ = other.alternatives_; + bitField0_ = (bitField0_ & ~0x00000001); + alternativesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAlternativesFieldBuilder() : null; + } else { + alternativesBuilder_.addAllMessages(other.alternatives_); + } + } + } + if (other.getIsFinal() != false) { + setIsFinal(other.getIsFinal()); + } + if (other.getStability() != 0F) { + setStability(other.getStability()); + } + if (other.hasResultEndTime()) { + mergeResultEndTime(other.getResultEndTime()); + } + if (other.getChannelTag() != 0) { + setChannelTag(other.getChannelTag()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.StreamingRecognitionResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.StreamingRecognitionResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List alternatives_ = + java.util.Collections.emptyList(); + private void ensureAlternativesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + alternatives_ = new java.util.ArrayList(alternatives_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechRecognitionAlternative, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> alternativesBuilder_; + + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public java.util.List getAlternativesList() { + if (alternativesBuilder_ == null) { + return java.util.Collections.unmodifiableList(alternatives_); + } else { + return alternativesBuilder_.getMessageList(); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public int getAlternativesCount() { + if (alternativesBuilder_ == null) { + return alternatives_.size(); + } else { + return alternativesBuilder_.getCount(); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index) { + if (alternativesBuilder_ == null) { + return alternatives_.get(index); + } else { + return alternativesBuilder_.getMessage(index); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder setAlternatives( + int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { + if (alternativesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativesIsMutable(); + alternatives_.set(index, value); + onChanged(); + } else { + alternativesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder setAlternatives( + int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.set(index, builderForValue.build()); + onChanged(); + } else { + alternativesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives(com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { + if (alternativesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativesIsMutable(); + alternatives_.add(value); + onChanged(); + } else { + alternativesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives( + int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { + if (alternativesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativesIsMutable(); + alternatives_.add(index, value); + onChanged(); + } else { + alternativesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives( + com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.add(builderForValue.build()); + onChanged(); + } else { + alternativesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives( + int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.add(index, builderForValue.build()); + onChanged(); + } else { + alternativesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAllAlternatives( + java.lang.Iterable values) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, alternatives_); + onChanged(); + } else { + alternativesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder clearAlternatives() { + if (alternativesBuilder_ == null) { + alternatives_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + alternativesBuilder_.clear(); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder removeAlternatives(int index) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.remove(index); + onChanged(); + } else { + alternativesBuilder_.remove(index); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder getAlternativesBuilder( + int index) { + return getAlternativesFieldBuilder().getBuilder(index); + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( + int index) { + if (alternativesBuilder_ == null) { + return alternatives_.get(index); } else { + return alternativesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public java.util.List + getAlternativesOrBuilderList() { + if (alternativesBuilder_ != null) { + return alternativesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(alternatives_); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder addAlternativesBuilder() { + return getAlternativesFieldBuilder().addBuilder( + com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()); + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder addAlternativesBuilder( + int index) { + return getAlternativesFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()); + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + public java.util.List + getAlternativesBuilderList() { + return getAlternativesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechRecognitionAlternative, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> + getAlternativesFieldBuilder() { + if (alternativesBuilder_ == null) { + alternativesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.SpeechRecognitionAlternative, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder>( + alternatives_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + alternatives_ = null; + } + return alternativesBuilder_; + } + + private boolean isFinal_ ; + /** + *
+     * If `false`, this `StreamingRecognitionResult` represents an
+     * interim result that may change. If `true`, this is the final time the
+     * speech service will return this particular `StreamingRecognitionResult`,
+     * the recognizer will not return any further hypotheses for this portion of
+     * the transcript and corresponding audio.
+     * 
+ * + * bool is_final = 2; + * @return The isFinal. + */ + @java.lang.Override + public boolean getIsFinal() { + return isFinal_; + } + /** + *
+     * If `false`, this `StreamingRecognitionResult` represents an
+     * interim result that may change. If `true`, this is the final time the
+     * speech service will return this particular `StreamingRecognitionResult`,
+     * the recognizer will not return any further hypotheses for this portion of
+     * the transcript and corresponding audio.
+     * 
+ * + * bool is_final = 2; + * @param value The isFinal to set. + * @return This builder for chaining. + */ + public Builder setIsFinal(boolean value) { + + isFinal_ = value; + onChanged(); + return this; + } + /** + *
+     * If `false`, this `StreamingRecognitionResult` represents an
+     * interim result that may change. If `true`, this is the final time the
+     * speech service will return this particular `StreamingRecognitionResult`,
+     * the recognizer will not return any further hypotheses for this portion of
+     * the transcript and corresponding audio.
+     * 
+ * + * bool is_final = 2; + * @return This builder for chaining. + */ + public Builder clearIsFinal() { + + isFinal_ = false; + onChanged(); + return this; + } + + private float stability_ ; + /** + *
+     * An estimate of the likelihood that the recognizer will not
+     * change its guess about this interim result. Values range from 0.0
+     * (completely unstable) to 1.0 (completely stable).
+     * This field is only provided for interim results (`is_final=false`).
+     * The default of 0.0 is a sentinel value indicating `stability` was not set.
+     * 
+ * + * float stability = 3; + * @return The stability. + */ + @java.lang.Override + public float getStability() { + return stability_; + } + /** + *
+     * An estimate of the likelihood that the recognizer will not
+     * change its guess about this interim result. Values range from 0.0
+     * (completely unstable) to 1.0 (completely stable).
+     * This field is only provided for interim results (`is_final=false`).
+     * The default of 0.0 is a sentinel value indicating `stability` was not set.
+     * 
+ * + * float stability = 3; + * @param value The stability to set. + * @return This builder for chaining. + */ + public Builder setStability(float value) { + + stability_ = value; + onChanged(); + return this; + } + /** + *
+     * An estimate of the likelihood that the recognizer will not
+     * change its guess about this interim result. Values range from 0.0
+     * (completely unstable) to 1.0 (completely stable).
+     * This field is only provided for interim results (`is_final=false`).
+     * The default of 0.0 is a sentinel value indicating `stability` was not set.
+     * 
+ * + * float stability = 3; + * @return This builder for chaining. + */ + public Builder clearStability() { + + stability_ = 0F; + onChanged(); + return this; + } + + private com.google.protobuf.Duration resultEndTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> resultEndTimeBuilder_; + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return Whether the resultEndTime field is set. + */ + public boolean hasResultEndTime() { + return resultEndTimeBuilder_ != null || resultEndTime_ != null; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return The resultEndTime. + */ + public com.google.protobuf.Duration getResultEndTime() { + if (resultEndTimeBuilder_ == null) { + return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; + } else { + return resultEndTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder setResultEndTime(com.google.protobuf.Duration value) { + if (resultEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resultEndTime_ = value; + onChanged(); + } else { + resultEndTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder setResultEndTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (resultEndTimeBuilder_ == null) { + resultEndTime_ = builderForValue.build(); + onChanged(); + } else { + resultEndTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder mergeResultEndTime(com.google.protobuf.Duration value) { + if (resultEndTimeBuilder_ == null) { + if (resultEndTime_ != null) { + resultEndTime_ = + com.google.protobuf.Duration.newBuilder(resultEndTime_).mergeFrom(value).buildPartial(); + } else { + resultEndTime_ = value; + } + onChanged(); + } else { + resultEndTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder clearResultEndTime() { + if (resultEndTimeBuilder_ == null) { + resultEndTime_ = null; + onChanged(); + } else { + resultEndTime_ = null; + resultEndTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public com.google.protobuf.Duration.Builder getResultEndTimeBuilder() { + + onChanged(); + return getResultEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { + if (resultEndTimeBuilder_ != null) { + return resultEndTimeBuilder_.getMessageOrBuilder(); + } else { + return resultEndTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; + } + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getResultEndTimeFieldBuilder() { + if (resultEndTimeBuilder_ == null) { + resultEndTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getResultEndTime(), + getParentForChildren(), + isClean()); + resultEndTime_ = null; + } + return resultEndTimeBuilder_; + } + + private int channelTag_ ; + /** + *
+     * For multi-channel audio, this is the channel number corresponding to the
+     * recognized result for the audio from that channel.
+     * For audio_channel_count = N, its output values can range from '1' to 'N'.
+     * 
+ * + * int32 channel_tag = 5; + * @return The channelTag. + */ + @java.lang.Override + public int getChannelTag() { + return channelTag_; + } + /** + *
+     * For multi-channel audio, this is the channel number corresponding to the
+     * recognized result for the audio from that channel.
+     * For audio_channel_count = N, its output values can range from '1' to 'N'.
+     * 
+ * + * int32 channel_tag = 5; + * @param value The channelTag to set. + * @return This builder for chaining. + */ + public Builder setChannelTag(int value) { + + channelTag_ = value; + onChanged(); + return this; + } + /** + *
+     * For multi-channel audio, this is the channel number corresponding to the
+     * recognized result for the audio from that channel.
+     * For audio_channel_count = N, its output values can range from '1' to 'N'.
+     * 
+ * + * int32 channel_tag = 5; + * @return This builder for chaining. + */ + public Builder clearChannelTag() { + + channelTag_ = 0; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.StreamingRecognitionResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognitionResult) + private static final com.google.cloud.speech.v1.StreamingRecognitionResult DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.StreamingRecognitionResult(); + } + + public static com.google.cloud.speech.v1.StreamingRecognitionResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingRecognitionResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingRecognitionResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResultOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResultOrBuilder.java new file mode 100644 index 000000000000..c44aa1077a0d --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResultOrBuilder.java @@ -0,0 +1,162 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface StreamingRecognitionResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.StreamingRecognitionResult) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + java.util.List + getAlternativesList(); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + int getAlternativesCount(); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + java.util.List + getAlternativesOrBuilderList(); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; + */ + com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( + int index); + + /** + *
+   * If `false`, this `StreamingRecognitionResult` represents an
+   * interim result that may change. If `true`, this is the final time the
+   * speech service will return this particular `StreamingRecognitionResult`,
+   * the recognizer will not return any further hypotheses for this portion of
+   * the transcript and corresponding audio.
+   * 
+ * + * bool is_final = 2; + * @return The isFinal. + */ + boolean getIsFinal(); + + /** + *
+   * An estimate of the likelihood that the recognizer will not
+   * change its guess about this interim result. Values range from 0.0
+   * (completely unstable) to 1.0 (completely stable).
+   * This field is only provided for interim results (`is_final=false`).
+   * The default of 0.0 is a sentinel value indicating `stability` was not set.
+   * 
+ * + * float stability = 3; + * @return The stability. + */ + float getStability(); + + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return Whether the resultEndTime field is set. + */ + boolean hasResultEndTime(); + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return The resultEndTime. + */ + com.google.protobuf.Duration getResultEndTime(); + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder(); + + /** + *
+   * For multi-channel audio, this is the channel number corresponding to the
+   * recognized result for the audio from that channel.
+   * For audio_channel_count = N, its output values can range from '1' to 'N'.
+   * 
+ * + * int32 channel_tag = 5; + * @return The channelTag. + */ + int getChannelTag(); + + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString + getLanguageCodeBytes(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequest.java new file mode 100644 index 000000000000..0632d9754a23 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequest.java @@ -0,0 +1,955 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * The top-level message sent by the client for the `StreamingRecognize` method.
+ * Multiple `StreamingRecognizeRequest` messages are sent. The first message
+ * must contain a `streaming_config` message and must not contain
+ * `audio_content`. All subsequent messages must contain `audio_content` and
+ * must not contain a `streaming_config` message.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.StreamingRecognizeRequest} + */ +public final class StreamingRecognizeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.StreamingRecognizeRequest) + StreamingRecognizeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use StreamingRecognizeRequest.newBuilder() to construct. + private StreamingRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StreamingRecognizeRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StreamingRecognizeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StreamingRecognizeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder subBuilder = null; + if (streamingRequestCase_ == 1) { + subBuilder = ((com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_).toBuilder(); + } + streamingRequest_ = + input.readMessage(com.google.cloud.speech.v1.StreamingRecognitionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_); + streamingRequest_ = subBuilder.buildPartial(); + } + streamingRequestCase_ = 1; + break; + } + case 18: { + streamingRequest_ = input.readBytes(); + streamingRequestCase_ = 2; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.StreamingRecognizeRequest.class, com.google.cloud.speech.v1.StreamingRecognizeRequest.Builder.class); + } + + private int streamingRequestCase_ = 0; + private java.lang.Object streamingRequest_; + public enum StreamingRequestCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STREAMING_CONFIG(1), + AUDIO_CONTENT(2), + STREAMINGREQUEST_NOT_SET(0); + private final int value; + private StreamingRequestCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StreamingRequestCase valueOf(int value) { + return forNumber(value); + } + + public static StreamingRequestCase forNumber(int value) { + switch (value) { + case 1: return STREAMING_CONFIG; + case 2: return AUDIO_CONTENT; + case 0: return STREAMINGREQUEST_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public StreamingRequestCase + getStreamingRequestCase() { + return StreamingRequestCase.forNumber( + streamingRequestCase_); + } + + public static final int STREAMING_CONFIG_FIELD_NUMBER = 1; + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request. The first `StreamingRecognizeRequest` message must contain a
+   * `streaming_config`  message.
+   * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + * @return Whether the streamingConfig field is set. + */ + @java.lang.Override + public boolean hasStreamingConfig() { + return streamingRequestCase_ == 1; + } + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request. The first `StreamingRecognizeRequest` message must contain a
+   * `streaming_config`  message.
+   * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + * @return The streamingConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionConfig getStreamingConfig() { + if (streamingRequestCase_ == 1) { + return (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_; + } + return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); + } + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request. The first `StreamingRecognizeRequest` message must contain a
+   * `streaming_config`  message.
+   * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder() { + if (streamingRequestCase_ == 1) { + return (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_; + } + return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); + } + + public static final int AUDIO_CONTENT_FIELD_NUMBER = 2; + /** + *
+   * The audio data to be recognized. Sequential chunks of audio data are sent
+   * in sequential `StreamingRecognizeRequest` messages. The first
+   * `StreamingRecognizeRequest` message must not contain `audio_content` data
+   * and all subsequent `StreamingRecognizeRequest` messages must contain
+   * `audio_content` data. The audio bytes must be encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation (not base64). See
+   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * 
+ * + * bytes audio_content = 2; + * @return Whether the audioContent field is set. + */ + @java.lang.Override + public boolean hasAudioContent() { + return streamingRequestCase_ == 2; + } + /** + *
+   * The audio data to be recognized. Sequential chunks of audio data are sent
+   * in sequential `StreamingRecognizeRequest` messages. The first
+   * `StreamingRecognizeRequest` message must not contain `audio_content` data
+   * and all subsequent `StreamingRecognizeRequest` messages must contain
+   * `audio_content` data. The audio bytes must be encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation (not base64). See
+   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * 
+ * + * bytes audio_content = 2; + * @return The audioContent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAudioContent() { + if (streamingRequestCase_ == 2) { + return (com.google.protobuf.ByteString) streamingRequest_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (streamingRequestCase_ == 1) { + output.writeMessage(1, (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_); + } + if (streamingRequestCase_ == 2) { + output.writeBytes( + 2, (com.google.protobuf.ByteString) streamingRequest_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (streamingRequestCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_); + } + if (streamingRequestCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 2, (com.google.protobuf.ByteString) streamingRequest_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.StreamingRecognizeRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.StreamingRecognizeRequest other = (com.google.cloud.speech.v1.StreamingRecognizeRequest) obj; + + if (!getStreamingRequestCase().equals(other.getStreamingRequestCase())) return false; + switch (streamingRequestCase_) { + case 1: + if (!getStreamingConfig() + .equals(other.getStreamingConfig())) return false; + break; + case 2: + if (!getAudioContent() + .equals(other.getAudioContent())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (streamingRequestCase_) { + case 1: + hash = (37 * hash) + STREAMING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getStreamingConfig().hashCode(); + break; + case 2: + hash = (37 * hash) + AUDIO_CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getAudioContent().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.StreamingRecognizeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The top-level message sent by the client for the `StreamingRecognize` method.
+   * Multiple `StreamingRecognizeRequest` messages are sent. The first message
+   * must contain a `streaming_config` message and must not contain
+   * `audio_content`. All subsequent messages must contain `audio_content` and
+   * must not contain a `streaming_config` message.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.StreamingRecognizeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.StreamingRecognizeRequest) + com.google.cloud.speech.v1.StreamingRecognizeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.StreamingRecognizeRequest.class, com.google.cloud.speech.v1.StreamingRecognizeRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.StreamingRecognizeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + streamingRequestCase_ = 0; + streamingRequest_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognizeRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.StreamingRecognizeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognizeRequest build() { + com.google.cloud.speech.v1.StreamingRecognizeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognizeRequest buildPartial() { + com.google.cloud.speech.v1.StreamingRecognizeRequest result = new com.google.cloud.speech.v1.StreamingRecognizeRequest(this); + if (streamingRequestCase_ == 1) { + if (streamingConfigBuilder_ == null) { + result.streamingRequest_ = streamingRequest_; + } else { + result.streamingRequest_ = streamingConfigBuilder_.build(); + } + } + if (streamingRequestCase_ == 2) { + result.streamingRequest_ = streamingRequest_; + } + result.streamingRequestCase_ = streamingRequestCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.StreamingRecognizeRequest) { + return mergeFrom((com.google.cloud.speech.v1.StreamingRecognizeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognizeRequest other) { + if (other == com.google.cloud.speech.v1.StreamingRecognizeRequest.getDefaultInstance()) return this; + switch (other.getStreamingRequestCase()) { + case STREAMING_CONFIG: { + mergeStreamingConfig(other.getStreamingConfig()); + break; + } + case AUDIO_CONTENT: { + setAudioContent(other.getAudioContent()); + break; + } + case STREAMINGREQUEST_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.StreamingRecognizeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.StreamingRecognizeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int streamingRequestCase_ = 0; + private java.lang.Object streamingRequest_; + public StreamingRequestCase + getStreamingRequestCase() { + return StreamingRequestCase.forNumber( + streamingRequestCase_); + } + + public Builder clearStreamingRequest() { + streamingRequestCase_ = 0; + streamingRequest_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.StreamingRecognitionConfig, com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder, com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder> streamingConfigBuilder_; + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + * @return Whether the streamingConfig field is set. + */ + @java.lang.Override + public boolean hasStreamingConfig() { + return streamingRequestCase_ == 1; + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + * @return The streamingConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionConfig getStreamingConfig() { + if (streamingConfigBuilder_ == null) { + if (streamingRequestCase_ == 1) { + return (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_; + } + return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); + } else { + if (streamingRequestCase_ == 1) { + return streamingConfigBuilder_.getMessage(); + } + return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); + } + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + */ + public Builder setStreamingConfig(com.google.cloud.speech.v1.StreamingRecognitionConfig value) { + if (streamingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamingRequest_ = value; + onChanged(); + } else { + streamingConfigBuilder_.setMessage(value); + } + streamingRequestCase_ = 1; + return this; + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + */ + public Builder setStreamingConfig( + com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder builderForValue) { + if (streamingConfigBuilder_ == null) { + streamingRequest_ = builderForValue.build(); + onChanged(); + } else { + streamingConfigBuilder_.setMessage(builderForValue.build()); + } + streamingRequestCase_ = 1; + return this; + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + */ + public Builder mergeStreamingConfig(com.google.cloud.speech.v1.StreamingRecognitionConfig value) { + if (streamingConfigBuilder_ == null) { + if (streamingRequestCase_ == 1 && + streamingRequest_ != com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance()) { + streamingRequest_ = com.google.cloud.speech.v1.StreamingRecognitionConfig.newBuilder((com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_) + .mergeFrom(value).buildPartial(); + } else { + streamingRequest_ = value; + } + onChanged(); + } else { + if (streamingRequestCase_ == 1) { + streamingConfigBuilder_.mergeFrom(value); + } else { + streamingConfigBuilder_.setMessage(value); + } + } + streamingRequestCase_ = 1; + return this; + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + */ + public Builder clearStreamingConfig() { + if (streamingConfigBuilder_ == null) { + if (streamingRequestCase_ == 1) { + streamingRequestCase_ = 0; + streamingRequest_ = null; + onChanged(); + } + } else { + if (streamingRequestCase_ == 1) { + streamingRequestCase_ = 0; + streamingRequest_ = null; + } + streamingConfigBuilder_.clear(); + } + return this; + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + */ + public com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder getStreamingConfigBuilder() { + return getStreamingConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder() { + if ((streamingRequestCase_ == 1) && (streamingConfigBuilder_ != null)) { + return streamingConfigBuilder_.getMessageOrBuilder(); + } else { + if (streamingRequestCase_ == 1) { + return (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_; + } + return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); + } + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.StreamingRecognitionConfig, com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder, com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder> + getStreamingConfigFieldBuilder() { + if (streamingConfigBuilder_ == null) { + if (!(streamingRequestCase_ == 1)) { + streamingRequest_ = com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); + } + streamingConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.StreamingRecognitionConfig, com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder, com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder>( + (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_, + getParentForChildren(), + isClean()); + streamingRequest_ = null; + } + streamingRequestCase_ = 1; + onChanged();; + return streamingConfigBuilder_; + } + + /** + *
+     * The audio data to be recognized. Sequential chunks of audio data are sent
+     * in sequential `StreamingRecognizeRequest` messages. The first
+     * `StreamingRecognizeRequest` message must not contain `audio_content` data
+     * and all subsequent `StreamingRecognizeRequest` messages must contain
+     * `audio_content` data. The audio bytes must be encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation (not base64). See
+     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * 
+ * + * bytes audio_content = 2; + * @return Whether the audioContent field is set. + */ + public boolean hasAudioContent() { + return streamingRequestCase_ == 2; + } + /** + *
+     * The audio data to be recognized. Sequential chunks of audio data are sent
+     * in sequential `StreamingRecognizeRequest` messages. The first
+     * `StreamingRecognizeRequest` message must not contain `audio_content` data
+     * and all subsequent `StreamingRecognizeRequest` messages must contain
+     * `audio_content` data. The audio bytes must be encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation (not base64). See
+     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * 
+ * + * bytes audio_content = 2; + * @return The audioContent. + */ + public com.google.protobuf.ByteString getAudioContent() { + if (streamingRequestCase_ == 2) { + return (com.google.protobuf.ByteString) streamingRequest_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
+     * The audio data to be recognized. Sequential chunks of audio data are sent
+     * in sequential `StreamingRecognizeRequest` messages. The first
+     * `StreamingRecognizeRequest` message must not contain `audio_content` data
+     * and all subsequent `StreamingRecognizeRequest` messages must contain
+     * `audio_content` data. The audio bytes must be encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation (not base64). See
+     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * 
+ * + * bytes audio_content = 2; + * @param value The audioContent to set. + * @return This builder for chaining. + */ + public Builder setAudioContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + streamingRequestCase_ = 2; + streamingRequest_ = value; + onChanged(); + return this; + } + /** + *
+     * The audio data to be recognized. Sequential chunks of audio data are sent
+     * in sequential `StreamingRecognizeRequest` messages. The first
+     * `StreamingRecognizeRequest` message must not contain `audio_content` data
+     * and all subsequent `StreamingRecognizeRequest` messages must contain
+     * `audio_content` data. The audio bytes must be encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation (not base64). See
+     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * 
+ * + * bytes audio_content = 2; + * @return This builder for chaining. + */ + public Builder clearAudioContent() { + if (streamingRequestCase_ == 2) { + streamingRequestCase_ = 0; + streamingRequest_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.StreamingRecognizeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognizeRequest) + private static final com.google.cloud.speech.v1.StreamingRecognizeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.StreamingRecognizeRequest(); + } + + public static com.google.cloud.speech.v1.StreamingRecognizeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingRecognizeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingRecognizeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognizeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequestOrBuilder.java new file mode 100644 index 000000000000..28ed92b158ab --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequestOrBuilder.java @@ -0,0 +1,77 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface StreamingRecognizeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.StreamingRecognizeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request. The first `StreamingRecognizeRequest` message must contain a
+   * `streaming_config`  message.
+   * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + * @return Whether the streamingConfig field is set. + */ + boolean hasStreamingConfig(); + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request. The first `StreamingRecognizeRequest` message must contain a
+   * `streaming_config`  message.
+   * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + * @return The streamingConfig. + */ + com.google.cloud.speech.v1.StreamingRecognitionConfig getStreamingConfig(); + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request. The first `StreamingRecognizeRequest` message must contain a
+   * `streaming_config`  message.
+   * 
+ * + * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; + */ + com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder(); + + /** + *
+   * The audio data to be recognized. Sequential chunks of audio data are sent
+   * in sequential `StreamingRecognizeRequest` messages. The first
+   * `StreamingRecognizeRequest` message must not contain `audio_content` data
+   * and all subsequent `StreamingRecognizeRequest` messages must contain
+   * `audio_content` data. The audio bytes must be encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation (not base64). See
+   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * 
+ * + * bytes audio_content = 2; + * @return Whether the audioContent field is set. + */ + boolean hasAudioContent(); + /** + *
+   * The audio data to be recognized. Sequential chunks of audio data are sent
+   * in sequential `StreamingRecognizeRequest` messages. The first
+   * `StreamingRecognizeRequest` message must not contain `audio_content` data
+   * and all subsequent `StreamingRecognizeRequest` messages must contain
+   * `audio_content` data. The audio bytes must be encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation (not base64). See
+   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * 
+ * + * bytes audio_content = 2; + * @return The audioContent. + */ + com.google.protobuf.ByteString getAudioContent(); + + public com.google.cloud.speech.v1.StreamingRecognizeRequest.StreamingRequestCase getStreamingRequestCase(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponse.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponse.java new file mode 100644 index 000000000000..a4e49a1325ef --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponse.java @@ -0,0 +1,1771 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * `StreamingRecognizeResponse` is the only message returned to the client by
+ * `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
+ * messages are streamed back to the client. If there is no recognizable
+ * audio, and `single_utterance` is set to false, then no messages are streamed
+ * back to the client.
+ * Here's an example of a series of `StreamingRecognizeResponse`s that might be
+ * returned while processing audio:
+ * 1. results { alternatives { transcript: "tube" } stability: 0.01 }
+ * 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
+ * 3. results { alternatives { transcript: "to be" } stability: 0.9 }
+ *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
+ * 4. results { alternatives { transcript: "to be or not to be"
+ *                             confidence: 0.92 }
+ *              alternatives { transcript: "to bee or not to bee" }
+ *              is_final: true }
+ * 5. results { alternatives { transcript: " that's" } stability: 0.01 }
+ * 6. results { alternatives { transcript: " that is" } stability: 0.9 }
+ *    results { alternatives { transcript: " the question" } stability: 0.01 }
+ * 7. results { alternatives { transcript: " that is the question"
+ *                             confidence: 0.98 }
+ *              alternatives { transcript: " that was the question" }
+ *              is_final: true }
+ * Notes:
+ * - Only two of the above responses #4 and #7 contain final results; they are
+ *   indicated by `is_final: true`. Concatenating these together generates the
+ *   full transcript: "to be or not to be that is the question".
+ * - The others contain interim `results`. #3 and #6 contain two interim
+ *   `results`: the first portion has a high stability and is less likely to
+ *   change; the second portion has a low stability and is very likely to
+ *   change. A UI designer might choose to show only high stability `results`.
+ * - The specific `stability` and `confidence` values shown above are only for
+ *   illustrative purposes. Actual values may vary.
+ * - In each response, only one of these fields will be set:
+ *     `error`,
+ *     `speech_event_type`, or
+ *     one or more (repeated) `results`.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.StreamingRecognizeResponse} + */ +public final class StreamingRecognizeResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.StreamingRecognizeResponse) + StreamingRecognizeResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use StreamingRecognizeResponse.newBuilder() to construct. + private StreamingRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StreamingRecognizeResponse() { + results_ = java.util.Collections.emptyList(); + speechEventType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StreamingRecognizeResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StreamingRecognizeResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.rpc.Status.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + results_.add( + input.readMessage(com.google.cloud.speech.v1.StreamingRecognitionResult.parser(), extensionRegistry)); + break; + } + case 32: { + int rawValue = input.readEnum(); + + speechEventType_ = rawValue; + break; + } + case 42: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (totalBilledTime_ != null) { + subBuilder = totalBilledTime_.toBuilder(); + } + totalBilledTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(totalBilledTime_); + totalBilledTime_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.StreamingRecognizeResponse.class, com.google.cloud.speech.v1.StreamingRecognizeResponse.Builder.class); + } + + /** + *
+   * Indicates the type of speech event.
+   * 
+ * + * Protobuf enum {@code google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType} + */ + public enum SpeechEventType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * No speech event specified.
+     * 
+ * + * SPEECH_EVENT_UNSPECIFIED = 0; + */ + SPEECH_EVENT_UNSPECIFIED(0), + /** + *
+     * This event indicates that the server has detected the end of the user's
+     * speech utterance and expects no additional speech. Therefore, the server
+     * will not process additional audio (although it may subsequently return
+     * additional results). The client should stop sending additional audio
+     * data, half-close the gRPC connection, and wait for any additional results
+     * until the server closes the gRPC connection. This event is only sent if
+     * `single_utterance` was set to `true`, and is not used otherwise.
+     * 
+ * + * END_OF_SINGLE_UTTERANCE = 1; + */ + END_OF_SINGLE_UTTERANCE(1), + UNRECOGNIZED(-1), + ; + + /** + *
+     * No speech event specified.
+     * 
+ * + * SPEECH_EVENT_UNSPECIFIED = 0; + */ + public static final int SPEECH_EVENT_UNSPECIFIED_VALUE = 0; + /** + *
+     * This event indicates that the server has detected the end of the user's
+     * speech utterance and expects no additional speech. Therefore, the server
+     * will not process additional audio (although it may subsequently return
+     * additional results). The client should stop sending additional audio
+     * data, half-close the gRPC connection, and wait for any additional results
+     * until the server closes the gRPC connection. This event is only sent if
+     * `single_utterance` was set to `true`, and is not used otherwise.
+     * 
+ * + * END_OF_SINGLE_UTTERANCE = 1; + */ + public static final int END_OF_SINGLE_UTTERANCE_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SpeechEventType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SpeechEventType forNumber(int value) { + switch (value) { + case 0: return SPEECH_EVENT_UNSPECIFIED; + case 1: return END_OF_SINGLE_UTTERANCE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SpeechEventType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SpeechEventType findValueByNumber(int number) { + return SpeechEventType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.speech.v1.StreamingRecognizeResponse.getDescriptor().getEnumTypes().get(0); + } + + private static final SpeechEventType[] VALUES = values(); + + public static SpeechEventType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SpeechEventType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType) + } + + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.rpc.Status error_; + /** + *
+   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+   * specifies the error for the operation.
+   * 
+ * + * .google.rpc.Status error = 1; + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + /** + *
+   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+   * specifies the error for the operation.
+   * 
+ * + * .google.rpc.Status error = 1; + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + /** + *
+   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+   * specifies the error for the operation.
+   * 
+ * + * .google.rpc.Status error = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + return getError(); + } + + public static final int RESULTS_FIELD_NUMBER = 2; + private java.util.List results_; + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + @java.lang.Override + public java.util.List getResultsList() { + return results_; + } + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + @java.lang.Override + public java.util.List + getResultsOrBuilderList() { + return results_; + } + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionResult getResults(int index) { + return results_.get(index); + } + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( + int index) { + return results_.get(index); + } + + public static final int SPEECH_EVENT_TYPE_FIELD_NUMBER = 4; + private int speechEventType_; + /** + *
+   * Indicates the type of speech event.
+   * 
+ * + * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return The enum numeric value on the wire for speechEventType. + */ + @java.lang.Override public int getSpeechEventTypeValue() { + return speechEventType_; + } + /** + *
+   * Indicates the type of speech event.
+   * 
+ * + * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return The speechEventType. + */ + @java.lang.Override public com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType result = com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.valueOf(speechEventType_); + return result == null ? com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.UNRECOGNIZED : result; + } + + public static final int TOTAL_BILLED_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Duration totalBilledTime_; + /** + *
+   * When available, billed audio seconds for the stream.
+   * Set only if this is the last response in the stream.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + * @return Whether the totalBilledTime field is set. + */ + @java.lang.Override + public boolean hasTotalBilledTime() { + return totalBilledTime_ != null; + } + /** + *
+   * When available, billed audio seconds for the stream.
+   * Set only if this is the last response in the stream.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + * @return The totalBilledTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getTotalBilledTime() { + return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } + /** + *
+   * When available, billed audio seconds for the stream.
+   * Set only if this is the last response in the stream.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { + return getTotalBilledTime(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (error_ != null) { + output.writeMessage(1, getError()); + } + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(2, results_.get(i)); + } + if (speechEventType_ != com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.SPEECH_EVENT_UNSPECIFIED.getNumber()) { + output.writeEnum(4, speechEventType_); + } + if (totalBilledTime_ != null) { + output.writeMessage(5, getTotalBilledTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getError()); + } + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, results_.get(i)); + } + if (speechEventType_ != com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.SPEECH_EVENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, speechEventType_); + } + if (totalBilledTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getTotalBilledTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.StreamingRecognizeResponse)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.StreamingRecognizeResponse other = (com.google.cloud.speech.v1.StreamingRecognizeResponse) obj; + + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError() + .equals(other.getError())) return false; + } + if (!getResultsList() + .equals(other.getResultsList())) return false; + if (speechEventType_ != other.speechEventType_) return false; + if (hasTotalBilledTime() != other.hasTotalBilledTime()) return false; + if (hasTotalBilledTime()) { + if (!getTotalBilledTime() + .equals(other.getTotalBilledTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + hash = (37 * hash) + SPEECH_EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + speechEventType_; + if (hasTotalBilledTime()) { + hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; + hash = (53 * hash) + getTotalBilledTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.StreamingRecognizeResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * `StreamingRecognizeResponse` is the only message returned to the client by
+   * `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
+   * messages are streamed back to the client. If there is no recognizable
+   * audio, and `single_utterance` is set to false, then no messages are streamed
+   * back to the client.
+   * Here's an example of a series of `StreamingRecognizeResponse`s that might be
+   * returned while processing audio:
+   * 1. results { alternatives { transcript: "tube" } stability: 0.01 }
+   * 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
+   * 3. results { alternatives { transcript: "to be" } stability: 0.9 }
+   *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
+   * 4. results { alternatives { transcript: "to be or not to be"
+   *                             confidence: 0.92 }
+   *              alternatives { transcript: "to bee or not to bee" }
+   *              is_final: true }
+   * 5. results { alternatives { transcript: " that's" } stability: 0.01 }
+   * 6. results { alternatives { transcript: " that is" } stability: 0.9 }
+   *    results { alternatives { transcript: " the question" } stability: 0.01 }
+   * 7. results { alternatives { transcript: " that is the question"
+   *                             confidence: 0.98 }
+   *              alternatives { transcript: " that was the question" }
+   *              is_final: true }
+   * Notes:
+   * - Only two of the above responses #4 and #7 contain final results; they are
+   *   indicated by `is_final: true`. Concatenating these together generates the
+   *   full transcript: "to be or not to be that is the question".
+   * - The others contain interim `results`. #3 and #6 contain two interim
+   *   `results`: the first portion has a high stability and is less likely to
+   *   change; the second portion has a low stability and is very likely to
+   *   change. A UI designer might choose to show only high stability `results`.
+   * - The specific `stability` and `confidence` values shown above are only for
+   *   illustrative purposes. Actual values may vary.
+   * - In each response, only one of these fields will be set:
+   *     `error`,
+   *     `speech_event_type`, or
+   *     one or more (repeated) `results`.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.StreamingRecognizeResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.StreamingRecognizeResponse) + com.google.cloud.speech.v1.StreamingRecognizeResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.StreamingRecognizeResponse.class, com.google.cloud.speech.v1.StreamingRecognizeResponse.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.StreamingRecognizeResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorBuilder_ == null) { + error_ = null; + } else { + error_ = null; + errorBuilder_ = null; + } + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resultsBuilder_.clear(); + } + speechEventType_ = 0; + + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = null; + } else { + totalBilledTime_ = null; + totalBilledTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognizeResponse getDefaultInstanceForType() { + return com.google.cloud.speech.v1.StreamingRecognizeResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognizeResponse build() { + com.google.cloud.speech.v1.StreamingRecognizeResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognizeResponse buildPartial() { + com.google.cloud.speech.v1.StreamingRecognizeResponse result = new com.google.cloud.speech.v1.StreamingRecognizeResponse(this); + int from_bitField0_ = bitField0_; + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.build(); + } + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + result.speechEventType_ = speechEventType_; + if (totalBilledTimeBuilder_ == null) { + result.totalBilledTime_ = totalBilledTime_; + } else { + result.totalBilledTime_ = totalBilledTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.StreamingRecognizeResponse) { + return mergeFrom((com.google.cloud.speech.v1.StreamingRecognizeResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognizeResponse other) { + if (other == com.google.cloud.speech.v1.StreamingRecognizeResponse.getDefaultInstance()) return this; + if (other.hasError()) { + mergeError(other.getError()); + } + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResultsFieldBuilder() : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (other.speechEventType_ != 0) { + setSpeechEventTypeValue(other.getSpeechEventTypeValue()); + } + if (other.hasTotalBilledTime()) { + mergeTotalBilledTime(other.getTotalBilledTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.StreamingRecognizeResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.StreamingRecognizeResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.rpc.Status error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + * @return The error. + */ + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + public Builder setError( + com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? + com.google.rpc.Status.getDefaultInstance() : error_; + } + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getError(), + getParentForChildren(), + isClean()); + error_ = null; + } + return errorBuilder_; + } + + private java.util.List results_ = + java.util.Collections.emptyList(); + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.StreamingRecognitionResult, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder, com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder> resultsBuilder_; + + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public java.util.List getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.StreamingRecognitionResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public Builder setResults( + int index, com.google.cloud.speech.v1.StreamingRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public Builder setResults( + int index, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public Builder addResults(com.google.cloud.speech.v1.StreamingRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public Builder addResults( + int index, com.google.cloud.speech.v1.StreamingRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public Builder addResults( + com.google.cloud.speech.v1.StreamingRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public Builder addResults( + int index, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public Builder addAllResults( + java.lang.Iterable values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.StreamingRecognitionResult.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( + int index) { + if (resultsBuilder_ == null) { + return results_.get(index); } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public java.util.List + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.StreamingRecognitionResult.Builder addResultsBuilder() { + return getResultsFieldBuilder().addBuilder( + com.google.cloud.speech.v1.StreamingRecognitionResult.getDefaultInstance()); + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1.StreamingRecognitionResult.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1.StreamingRecognitionResult.getDefaultInstance()); + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.StreamingRecognitionResult, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder, com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1.StreamingRecognitionResult, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder, com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder>( + results_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private int speechEventType_ = 0; + /** + *
+     * Indicates the type of speech event.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return The enum numeric value on the wire for speechEventType. + */ + @java.lang.Override public int getSpeechEventTypeValue() { + return speechEventType_; + } + /** + *
+     * Indicates the type of speech event.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @param value The enum numeric value on the wire for speechEventType to set. + * @return This builder for chaining. + */ + public Builder setSpeechEventTypeValue(int value) { + + speechEventType_ = value; + onChanged(); + return this; + } + /** + *
+     * Indicates the type of speech event.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return The speechEventType. + */ + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType result = com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.valueOf(speechEventType_); + return result == null ? com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.UNRECOGNIZED : result; + } + /** + *
+     * Indicates the type of speech event.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @param value The speechEventType to set. + * @return This builder for chaining. + */ + public Builder setSpeechEventType(com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType value) { + if (value == null) { + throw new NullPointerException(); + } + + speechEventType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Indicates the type of speech event.
+     * 
+ * + * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return This builder for chaining. + */ + public Builder clearSpeechEventType() { + + speechEventType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration totalBilledTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalBilledTimeBuilder_; + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + * @return Whether the totalBilledTime field is set. + */ + public boolean hasTotalBilledTime() { + return totalBilledTimeBuilder_ != null || totalBilledTime_ != null; + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + * @return The totalBilledTime. + */ + public com.google.protobuf.Duration getTotalBilledTime() { + if (totalBilledTimeBuilder_ == null) { + return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } else { + return totalBilledTimeBuilder_.getMessage(); + } + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + public Builder setTotalBilledTime(com.google.protobuf.Duration value) { + if (totalBilledTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + totalBilledTime_ = value; + onChanged(); + } else { + totalBilledTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + public Builder setTotalBilledTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = builderForValue.build(); + onChanged(); + } else { + totalBilledTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + public Builder mergeTotalBilledTime(com.google.protobuf.Duration value) { + if (totalBilledTimeBuilder_ == null) { + if (totalBilledTime_ != null) { + totalBilledTime_ = + com.google.protobuf.Duration.newBuilder(totalBilledTime_).mergeFrom(value).buildPartial(); + } else { + totalBilledTime_ = value; + } + onChanged(); + } else { + totalBilledTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + public Builder clearTotalBilledTime() { + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = null; + onChanged(); + } else { + totalBilledTime_ = null; + totalBilledTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + public com.google.protobuf.Duration.Builder getTotalBilledTimeBuilder() { + + onChanged(); + return getTotalBilledTimeFieldBuilder().getBuilder(); + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { + if (totalBilledTimeBuilder_ != null) { + return totalBilledTimeBuilder_.getMessageOrBuilder(); + } else { + return totalBilledTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getTotalBilledTimeFieldBuilder() { + if (totalBilledTimeBuilder_ == null) { + totalBilledTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getTotalBilledTime(), + getParentForChildren(), + isClean()); + totalBilledTime_ = null; + } + return totalBilledTimeBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.StreamingRecognizeResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognizeResponse) + private static final com.google.cloud.speech.v1.StreamingRecognizeResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.StreamingRecognizeResponse(); + } + + public static com.google.cloud.speech.v1.StreamingRecognizeResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingRecognizeResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingRecognizeResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.StreamingRecognizeResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java new file mode 100644 index 000000000000..1a3c3b062d4b --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java @@ -0,0 +1,147 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface StreamingRecognizeResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.StreamingRecognizeResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+   * specifies the error for the operation.
+   * 
+ * + * .google.rpc.Status error = 1; + * @return Whether the error field is set. + */ + boolean hasError(); + /** + *
+   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+   * specifies the error for the operation.
+   * 
+ * + * .google.rpc.Status error = 1; + * @return The error. + */ + com.google.rpc.Status getError(); + /** + *
+   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+   * specifies the error for the operation.
+   * 
+ * + * .google.rpc.Status error = 1; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + java.util.List + getResultsList(); + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + com.google.cloud.speech.v1.StreamingRecognitionResult getResults(int index); + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + int getResultsCount(); + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + java.util.List + getResultsOrBuilderList(); + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; + */ + com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( + int index); + + /** + *
+   * Indicates the type of speech event.
+   * 
+ * + * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return The enum numeric value on the wire for speechEventType. + */ + int getSpeechEventTypeValue(); + /** + *
+   * Indicates the type of speech event.
+   * 
+ * + * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return The speechEventType. + */ + com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType(); + + /** + *
+   * When available, billed audio seconds for the stream.
+   * Set only if this is the last response in the stream.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + * @return Whether the totalBilledTime field is set. + */ + boolean hasTotalBilledTime(); + /** + *
+   * When available, billed audio seconds for the stream.
+   * Set only if this is the last response in the stream.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + * @return The totalBilledTime. + */ + com.google.protobuf.Duration getTotalBilledTime(); + /** + *
+   * When available, billed audio seconds for the stream.
+   * Set only if this is the last response in the stream.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfig.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfig.java new file mode 100644 index 000000000000..aa9696e23886 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfig.java @@ -0,0 +1,732 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Specifies an optional destination for the recognition results.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.TranscriptOutputConfig} + */ +public final class TranscriptOutputConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.TranscriptOutputConfig) + TranscriptOutputConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use TranscriptOutputConfig.newBuilder() to construct. + private TranscriptOutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TranscriptOutputConfig() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TranscriptOutputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TranscriptOutputConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + outputTypeCase_ = 1; + outputType_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_TranscriptOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_TranscriptOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.TranscriptOutputConfig.class, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder.class); + } + + private int outputTypeCase_ = 0; + private java.lang.Object outputType_; + public enum OutputTypeCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_URI(1), + OUTPUTTYPE_NOT_SET(0); + private final int value; + private OutputTypeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OutputTypeCase valueOf(int value) { + return forNumber(value); + } + + public static OutputTypeCase forNumber(int value) { + switch (value) { + case 1: return GCS_URI; + case 0: return OUTPUTTYPE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OutputTypeCase + getOutputTypeCase() { + return OutputTypeCase.forNumber( + outputTypeCase_); + } + + public static final int GCS_URI_FIELD_NUMBER = 1; + /** + *
+   * Specifies a Cloud Storage URI for the recognition results. Must be
+   * specified in the format: `gs://bucket_name/object_name`, and the bucket
+   * must already exist.
+   * 
+ * + * string gcs_uri = 1; + * @return Whether the gcsUri field is set. + */ + public boolean hasGcsUri() { + return outputTypeCase_ == 1; + } + /** + *
+   * Specifies a Cloud Storage URI for the recognition results. Must be
+   * specified in the format: `gs://bucket_name/object_name`, and the bucket
+   * must already exist.
+   * 
+ * + * string gcs_uri = 1; + * @return The gcsUri. + */ + public java.lang.String getGcsUri() { + java.lang.Object ref = ""; + if (outputTypeCase_ == 1) { + ref = outputType_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (outputTypeCase_ == 1) { + outputType_ = s; + } + return s; + } + } + /** + *
+   * Specifies a Cloud Storage URI for the recognition results. Must be
+   * specified in the format: `gs://bucket_name/object_name`, and the bucket
+   * must already exist.
+   * 
+ * + * string gcs_uri = 1; + * @return The bytes for gcsUri. + */ + public com.google.protobuf.ByteString + getGcsUriBytes() { + java.lang.Object ref = ""; + if (outputTypeCase_ == 1) { + ref = outputType_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (outputTypeCase_ == 1) { + outputType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (outputTypeCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (outputTypeCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.TranscriptOutputConfig)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.TranscriptOutputConfig other = (com.google.cloud.speech.v1.TranscriptOutputConfig) obj; + + if (!getOutputTypeCase().equals(other.getOutputTypeCase())) return false; + switch (outputTypeCase_) { + case 1: + if (!getGcsUri() + .equals(other.getGcsUri())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (outputTypeCase_) { + case 1: + hash = (37 * hash) + GCS_URI_FIELD_NUMBER; + hash = (53 * hash) + getGcsUri().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.TranscriptOutputConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.TranscriptOutputConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.TranscriptOutputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Specifies an optional destination for the recognition results.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.TranscriptOutputConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.TranscriptOutputConfig) + com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_TranscriptOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_TranscriptOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.TranscriptOutputConfig.class, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.TranscriptOutputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + outputTypeCase_ = 0; + outputType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_TranscriptOutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptOutputConfig getDefaultInstanceForType() { + return com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptOutputConfig build() { + com.google.cloud.speech.v1.TranscriptOutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptOutputConfig buildPartial() { + com.google.cloud.speech.v1.TranscriptOutputConfig result = new com.google.cloud.speech.v1.TranscriptOutputConfig(this); + if (outputTypeCase_ == 1) { + result.outputType_ = outputType_; + } + result.outputTypeCase_ = outputTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.TranscriptOutputConfig) { + return mergeFrom((com.google.cloud.speech.v1.TranscriptOutputConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.TranscriptOutputConfig other) { + if (other == com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance()) return this; + switch (other.getOutputTypeCase()) { + case GCS_URI: { + outputTypeCase_ = 1; + outputType_ = other.outputType_; + onChanged(); + break; + } + case OUTPUTTYPE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.TranscriptOutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.TranscriptOutputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int outputTypeCase_ = 0; + private java.lang.Object outputType_; + public OutputTypeCase + getOutputTypeCase() { + return OutputTypeCase.forNumber( + outputTypeCase_); + } + + public Builder clearOutputType() { + outputTypeCase_ = 0; + outputType_ = null; + onChanged(); + return this; + } + + + /** + *
+     * Specifies a Cloud Storage URI for the recognition results. Must be
+     * specified in the format: `gs://bucket_name/object_name`, and the bucket
+     * must already exist.
+     * 
+ * + * string gcs_uri = 1; + * @return Whether the gcsUri field is set. + */ + @java.lang.Override + public boolean hasGcsUri() { + return outputTypeCase_ == 1; + } + /** + *
+     * Specifies a Cloud Storage URI for the recognition results. Must be
+     * specified in the format: `gs://bucket_name/object_name`, and the bucket
+     * must already exist.
+     * 
+ * + * string gcs_uri = 1; + * @return The gcsUri. + */ + @java.lang.Override + public java.lang.String getGcsUri() { + java.lang.Object ref = ""; + if (outputTypeCase_ == 1) { + ref = outputType_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (outputTypeCase_ == 1) { + outputType_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Specifies a Cloud Storage URI for the recognition results. Must be
+     * specified in the format: `gs://bucket_name/object_name`, and the bucket
+     * must already exist.
+     * 
+ * + * string gcs_uri = 1; + * @return The bytes for gcsUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGcsUriBytes() { + java.lang.Object ref = ""; + if (outputTypeCase_ == 1) { + ref = outputType_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (outputTypeCase_ == 1) { + outputType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Specifies a Cloud Storage URI for the recognition results. Must be
+     * specified in the format: `gs://bucket_name/object_name`, and the bucket
+     * must already exist.
+     * 
+ * + * string gcs_uri = 1; + * @param value The gcsUri to set. + * @return This builder for chaining. + */ + public Builder setGcsUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputTypeCase_ = 1; + outputType_ = value; + onChanged(); + return this; + } + /** + *
+     * Specifies a Cloud Storage URI for the recognition results. Must be
+     * specified in the format: `gs://bucket_name/object_name`, and the bucket
+     * must already exist.
+     * 
+ * + * string gcs_uri = 1; + * @return This builder for chaining. + */ + public Builder clearGcsUri() { + if (outputTypeCase_ == 1) { + outputTypeCase_ = 0; + outputType_ = null; + onChanged(); + } + return this; + } + /** + *
+     * Specifies a Cloud Storage URI for the recognition results. Must be
+     * specified in the format: `gs://bucket_name/object_name`, and the bucket
+     * must already exist.
+     * 
+ * + * string gcs_uri = 1; + * @param value The bytes for gcsUri to set. + * @return This builder for chaining. + */ + public Builder setGcsUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputTypeCase_ = 1; + outputType_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.TranscriptOutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.TranscriptOutputConfig) + private static final com.google.cloud.speech.v1.TranscriptOutputConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.TranscriptOutputConfig(); + } + + public static com.google.cloud.speech.v1.TranscriptOutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TranscriptOutputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TranscriptOutputConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.TranscriptOutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfigOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfigOrBuilder.java new file mode 100644 index 000000000000..5ce9fd8335aa --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfigOrBuilder.java @@ -0,0 +1,46 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface TranscriptOutputConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.TranscriptOutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Specifies a Cloud Storage URI for the recognition results. Must be
+   * specified in the format: `gs://bucket_name/object_name`, and the bucket
+   * must already exist.
+   * 
+ * + * string gcs_uri = 1; + * @return Whether the gcsUri field is set. + */ + boolean hasGcsUri(); + /** + *
+   * Specifies a Cloud Storage URI for the recognition results. Must be
+   * specified in the format: `gs://bucket_name/object_name`, and the bucket
+   * must already exist.
+   * 
+ * + * string gcs_uri = 1; + * @return The gcsUri. + */ + java.lang.String getGcsUri(); + /** + *
+   * Specifies a Cloud Storage URI for the recognition results. Must be
+   * specified in the format: `gs://bucket_name/object_name`, and the bucket
+   * must already exist.
+   * 
+ * + * string gcs_uri = 1; + * @return The bytes for gcsUri. + */ + com.google.protobuf.ByteString + getGcsUriBytes(); + + public com.google.cloud.speech.v1.TranscriptOutputConfig.OutputTypeCase getOutputTypeCase(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequest.java new file mode 100644 index 000000000000..f77de019bb0e --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequest.java @@ -0,0 +1,997 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Message sent by the client for the `UpdateCustomClass` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.UpdateCustomClassRequest} + */ +public final class UpdateCustomClassRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.UpdateCustomClassRequest) + UpdateCustomClassRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateCustomClassRequest.newBuilder() to construct. + private UpdateCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateCustomClassRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UpdateCustomClassRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateCustomClassRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.cloud.speech.v1.CustomClass.Builder subBuilder = null; + if (customClass_ != null) { + subBuilder = customClass_.toBuilder(); + } + customClass_ = input.readMessage(com.google.cloud.speech.v1.CustomClass.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(customClass_); + customClass_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.UpdateCustomClassRequest.class, com.google.cloud.speech.v1.UpdateCustomClassRequest.Builder.class); + } + + public static final int CUSTOM_CLASS_FIELD_NUMBER = 1; + private com.google.cloud.speech.v1.CustomClass customClass_; + /** + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the customClass field is set. + */ + @java.lang.Override + public boolean hasCustomClass() { + return customClass_ != null; + } + /** + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClass. + */ + @java.lang.Override + public com.google.cloud.speech.v1.CustomClass getCustomClass() { + return customClass_ == null ? com.google.cloud.speech.v1.CustomClass.getDefaultInstance() : customClass_; + } + /** + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassOrBuilder() { + return getCustomClass(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (customClass_ != null) { + output.writeMessage(1, getCustomClass()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (customClass_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getCustomClass()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.UpdateCustomClassRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.UpdateCustomClassRequest other = (com.google.cloud.speech.v1.UpdateCustomClassRequest) obj; + + if (hasCustomClass() != other.hasCustomClass()) return false; + if (hasCustomClass()) { + if (!getCustomClass() + .equals(other.getCustomClass())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask() + .equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCustomClass()) { + hash = (37 * hash) + CUSTOM_CLASS_FIELD_NUMBER; + hash = (53 * hash) + getCustomClass().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.UpdateCustomClassRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `UpdateCustomClass` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.UpdateCustomClassRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.UpdateCustomClassRequest) + com.google.cloud.speech.v1.UpdateCustomClassRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.UpdateCustomClassRequest.class, com.google.cloud.speech.v1.UpdateCustomClassRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.UpdateCustomClassRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (customClassBuilder_ == null) { + customClass_ = null; + } else { + customClass_ = null; + customClassBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.UpdateCustomClassRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.UpdateCustomClassRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.UpdateCustomClassRequest build() { + com.google.cloud.speech.v1.UpdateCustomClassRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.UpdateCustomClassRequest buildPartial() { + com.google.cloud.speech.v1.UpdateCustomClassRequest result = new com.google.cloud.speech.v1.UpdateCustomClassRequest(this); + if (customClassBuilder_ == null) { + result.customClass_ = customClass_; + } else { + result.customClass_ = customClassBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.UpdateCustomClassRequest) { + return mergeFrom((com.google.cloud.speech.v1.UpdateCustomClassRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.UpdateCustomClassRequest other) { + if (other == com.google.cloud.speech.v1.UpdateCustomClassRequest.getDefaultInstance()) return this; + if (other.hasCustomClass()) { + mergeCustomClass(other.getCustomClass()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.UpdateCustomClassRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.UpdateCustomClassRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.speech.v1.CustomClass customClass_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> customClassBuilder_; + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the customClass field is set. + */ + public boolean hasCustomClass() { + return customClassBuilder_ != null || customClass_ != null; + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClass. + */ + public com.google.cloud.speech.v1.CustomClass getCustomClass() { + if (customClassBuilder_ == null) { + return customClass_ == null ? com.google.cloud.speech.v1.CustomClass.getDefaultInstance() : customClass_; + } else { + return customClassBuilder_.getMessage(); + } + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setCustomClass(com.google.cloud.speech.v1.CustomClass value) { + if (customClassBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customClass_ = value; + onChanged(); + } else { + customClassBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setCustomClass( + com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { + if (customClassBuilder_ == null) { + customClass_ = builderForValue.build(); + onChanged(); + } else { + customClassBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeCustomClass(com.google.cloud.speech.v1.CustomClass value) { + if (customClassBuilder_ == null) { + if (customClass_ != null) { + customClass_ = + com.google.cloud.speech.v1.CustomClass.newBuilder(customClass_).mergeFrom(value).buildPartial(); + } else { + customClass_ = value; + } + onChanged(); + } else { + customClassBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearCustomClass() { + if (customClassBuilder_ == null) { + customClass_ = null; + onChanged(); + } else { + customClass_ = null; + customClassBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.CustomClass.Builder getCustomClassBuilder() { + + onChanged(); + return getCustomClassFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassOrBuilder() { + if (customClassBuilder_ != null) { + return customClassBuilder_.getMessageOrBuilder(); + } else { + return customClass_ == null ? + com.google.cloud.speech.v1.CustomClass.getDefaultInstance() : customClass_; + } + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> + getCustomClassFieldBuilder() { + if (customClassBuilder_ == null) { + customClassBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder>( + getCustomClass(), + getParentForChildren(), + isClean()); + customClass_ = null; + } + return customClassBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.UpdateCustomClassRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.UpdateCustomClassRequest) + private static final com.google.cloud.speech.v1.UpdateCustomClassRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.UpdateCustomClassRequest(); + } + + public static com.google.cloud.speech.v1.UpdateCustomClassRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateCustomClassRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateCustomClassRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.UpdateCustomClassRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequestOrBuilder.java new file mode 100644 index 000000000000..502a36d4010f --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequestOrBuilder.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public interface UpdateCustomClassRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.UpdateCustomClassRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the customClass field is set. + */ + boolean hasCustomClass(); + /** + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClass. + */ + com.google.cloud.speech.v1.CustomClass getCustomClass(); + /** + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassOrBuilder(); + + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequest.java new file mode 100644 index 000000000000..b0510d68c25f --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequest.java @@ -0,0 +1,997 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Message sent by the client for the `UpdatePhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.UpdatePhraseSetRequest} + */ +public final class UpdatePhraseSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.UpdatePhraseSetRequest) + UpdatePhraseSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdatePhraseSetRequest.newBuilder() to construct. + private UpdatePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdatePhraseSetRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UpdatePhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdatePhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.cloud.speech.v1.PhraseSet.Builder subBuilder = null; + if (phraseSet_ != null) { + subBuilder = phraseSet_.toBuilder(); + } + phraseSet_ = input.readMessage(com.google.cloud.speech.v1.PhraseSet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(phraseSet_); + phraseSet_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.UpdatePhraseSetRequest.class, com.google.cloud.speech.v1.UpdatePhraseSetRequest.Builder.class); + } + + public static final int PHRASE_SET_FIELD_NUMBER = 1; + private com.google.cloud.speech.v1.PhraseSet phraseSet_; + /** + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the phraseSet field is set. + */ + @java.lang.Override + public boolean hasPhraseSet() { + return phraseSet_ != null; + } + /** + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSet. + */ + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSet getPhraseSet() { + return phraseSet_ == null ? com.google.cloud.speech.v1.PhraseSet.getDefaultInstance() : phraseSet_; + } + /** + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetOrBuilder() { + return getPhraseSet(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (phraseSet_ != null) { + output.writeMessage(1, getPhraseSet()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (phraseSet_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getPhraseSet()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.UpdatePhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.UpdatePhraseSetRequest other = (com.google.cloud.speech.v1.UpdatePhraseSetRequest) obj; + + if (hasPhraseSet() != other.hasPhraseSet()) return false; + if (hasPhraseSet()) { + if (!getPhraseSet() + .equals(other.getPhraseSet())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask() + .equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPhraseSet()) { + hash = (37 * hash) + PHRASE_SET_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSet().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.UpdatePhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `UpdatePhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.UpdatePhraseSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.UpdatePhraseSetRequest) + com.google.cloud.speech.v1.UpdatePhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.UpdatePhraseSetRequest.class, com.google.cloud.speech.v1.UpdatePhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.UpdatePhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (phraseSetBuilder_ == null) { + phraseSet_ = null; + } else { + phraseSet_ = null; + phraseSetBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.UpdatePhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1.UpdatePhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.UpdatePhraseSetRequest build() { + com.google.cloud.speech.v1.UpdatePhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.UpdatePhraseSetRequest buildPartial() { + com.google.cloud.speech.v1.UpdatePhraseSetRequest result = new com.google.cloud.speech.v1.UpdatePhraseSetRequest(this); + if (phraseSetBuilder_ == null) { + result.phraseSet_ = phraseSet_; + } else { + result.phraseSet_ = phraseSetBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.UpdatePhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1.UpdatePhraseSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.UpdatePhraseSetRequest other) { + if (other == com.google.cloud.speech.v1.UpdatePhraseSetRequest.getDefaultInstance()) return this; + if (other.hasPhraseSet()) { + mergePhraseSet(other.getPhraseSet()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.UpdatePhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.UpdatePhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.speech.v1.PhraseSet phraseSet_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> phraseSetBuilder_; + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the phraseSet field is set. + */ + public boolean hasPhraseSet() { + return phraseSetBuilder_ != null || phraseSet_ != null; + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSet. + */ + public com.google.cloud.speech.v1.PhraseSet getPhraseSet() { + if (phraseSetBuilder_ == null) { + return phraseSet_ == null ? com.google.cloud.speech.v1.PhraseSet.getDefaultInstance() : phraseSet_; + } else { + return phraseSetBuilder_.getMessage(); + } + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPhraseSet(com.google.cloud.speech.v1.PhraseSet value) { + if (phraseSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + phraseSet_ = value; + onChanged(); + } else { + phraseSetBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPhraseSet( + com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { + if (phraseSetBuilder_ == null) { + phraseSet_ = builderForValue.build(); + onChanged(); + } else { + phraseSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergePhraseSet(com.google.cloud.speech.v1.PhraseSet value) { + if (phraseSetBuilder_ == null) { + if (phraseSet_ != null) { + phraseSet_ = + com.google.cloud.speech.v1.PhraseSet.newBuilder(phraseSet_).mergeFrom(value).buildPartial(); + } else { + phraseSet_ = value; + } + onChanged(); + } else { + phraseSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearPhraseSet() { + if (phraseSetBuilder_ == null) { + phraseSet_ = null; + onChanged(); + } else { + phraseSet_ = null; + phraseSetBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.PhraseSet.Builder getPhraseSetBuilder() { + + onChanged(); + return getPhraseSetFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetOrBuilder() { + if (phraseSetBuilder_ != null) { + return phraseSetBuilder_.getMessageOrBuilder(); + } else { + return phraseSet_ == null ? + com.google.cloud.speech.v1.PhraseSet.getDefaultInstance() : phraseSet_; + } + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> + getPhraseSetFieldBuilder() { + if (phraseSetBuilder_ == null) { + phraseSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder>( + getPhraseSet(), + getParentForChildren(), + isClean()); + phraseSet_ = null; + } + return phraseSetBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.UpdatePhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.UpdatePhraseSetRequest) + private static final com.google.cloud.speech.v1.UpdatePhraseSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.UpdatePhraseSetRequest(); + } + + public static com.google.cloud.speech.v1.UpdatePhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdatePhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdatePhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.UpdatePhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequestOrBuilder.java new file mode 100644 index 000000000000..1c70780af975 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequestOrBuilder.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1; + +public interface UpdatePhraseSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.UpdatePhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the phraseSet field is set. + */ + boolean hasPhraseSet(); + /** + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSet. + */ + com.google.cloud.speech.v1.PhraseSet getPhraseSet(); + /** + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetOrBuilder(); + + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java new file mode 100644 index 000000000000..45597a92de64 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java @@ -0,0 +1,1389 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +/** + *
+ * Word-specific information for recognized words.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1.WordInfo} + */ +public final class WordInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.WordInfo) + WordInfoOrBuilder { +private static final long serialVersionUID = 0L; + // Use WordInfo.newBuilder() to construct. + private WordInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WordInfo() { + word_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WordInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WordInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + word_ = s; + break; + } + case 37: { + + confidence_ = input.readFloat(); + break; + } + case 40: { + + speakerTag_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_WordInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_WordInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.WordInfo.class, com.google.cloud.speech.v1.WordInfo.Builder.class); + } + + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Duration startTime_; + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the start of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration start_time = 1; + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the start of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration start_time = 1; + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getStartTime() { + return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; + } + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the start of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Duration endTime_; + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the end of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration end_time = 2; + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the end of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration end_time = 2; + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getEndTime() { + return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; + } + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the end of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int WORD_FIELD_NUMBER = 3; + private volatile java.lang.Object word_; + /** + *
+   * The word corresponding to this set of information.
+   * 
+ * + * string word = 3; + * @return The word. + */ + @java.lang.Override + public java.lang.String getWord() { + java.lang.Object ref = word_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + word_ = s; + return s; + } + } + /** + *
+   * The word corresponding to this set of information.
+   * 
+ * + * string word = 3; + * @return The bytes for word. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getWordBytes() { + java.lang.Object ref = word_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + word_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIDENCE_FIELD_NUMBER = 4; + private float confidence_; + /** + *
+   * The confidence estimate between 0.0 and 1.0. A higher number
+   * indicates an estimated greater likelihood that the recognized words are
+   * correct. This field is set only for the top alternative of a non-streaming
+   * result or, of a streaming result where `is_final=true`.
+   * This field is not guaranteed to be accurate and users should not rely on it
+   * to be always provided.
+   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+   * 
+ * + * float confidence = 4; + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + + public static final int SPEAKER_TAG_FIELD_NUMBER = 5; + private int speakerTag_; + /** + *
+   * Output only. A distinct integer value is assigned for every speaker within
+   * the audio. This field specifies which one of those speakers was detected to
+   * have spoken this word. Value ranges from '1' to diarization_speaker_count.
+   * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
+   * top alternative.
+   * 
+ * + * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The speakerTag. + */ + @java.lang.Override + public int getSpeakerTag() { + return speakerTag_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (startTime_ != null) { + output.writeMessage(1, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(word_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, word_); + } + if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { + output.writeFloat(4, confidence_); + } + if (speakerTag_ != 0) { + output.writeInt32(5, speakerTag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(word_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, word_); + } + if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, confidence_); + } + if (speakerTag_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, speakerTag_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1.WordInfo)) { + return super.equals(obj); + } + com.google.cloud.speech.v1.WordInfo other = (com.google.cloud.speech.v1.WordInfo) obj; + + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime() + .equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime() + .equals(other.getEndTime())) return false; + } + if (!getWord() + .equals(other.getWord())) return false; + if (java.lang.Float.floatToIntBits(getConfidence()) + != java.lang.Float.floatToIntBits( + other.getConfidence())) return false; + if (getSpeakerTag() + != other.getSpeakerTag()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + WORD_FIELD_NUMBER; + hash = (53 * hash) + getWord().hashCode(); + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; + hash = (53 * hash) + getSpeakerTag(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1.WordInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.WordInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.WordInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.WordInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.WordInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1.WordInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1.WordInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.WordInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.WordInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.WordInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1.WordInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1.WordInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1.WordInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Word-specific information for recognized words.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1.WordInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.WordInfo) + com.google.cloud.speech.v1.WordInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_WordInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_WordInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1.WordInfo.class, com.google.cloud.speech.v1.WordInfo.Builder.class); + } + + // Construct using com.google.cloud.speech.v1.WordInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + word_ = ""; + + confidence_ = 0F; + + speakerTag_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_WordInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1.WordInfo getDefaultInstanceForType() { + return com.google.cloud.speech.v1.WordInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1.WordInfo build() { + com.google.cloud.speech.v1.WordInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1.WordInfo buildPartial() { + com.google.cloud.speech.v1.WordInfo result = new com.google.cloud.speech.v1.WordInfo(this); + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.word_ = word_; + result.confidence_ = confidence_; + result.speakerTag_ = speakerTag_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1.WordInfo) { + return mergeFrom((com.google.cloud.speech.v1.WordInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1.WordInfo other) { + if (other == com.google.cloud.speech.v1.WordInfo.getDefaultInstance()) return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getWord().isEmpty()) { + word_ = other.word_; + onChanged(); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + if (other.getSpeakerTag() != 0) { + setSpeakerTag(other.getSpeakerTag()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1.WordInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1.WordInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Duration startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> startTimeBuilder_; + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + * @return The startTime. + */ + public com.google.protobuf.Duration getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Duration value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + public Builder setStartTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Duration value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Duration.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + public com.google.protobuf.Duration.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : startTime_; + } + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getStartTime(), + getParentForChildren(), + isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Duration endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> endTimeBuilder_; + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + * @return The endTime. + */ + public com.google.protobuf.Duration getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Duration value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + public Builder setEndTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Duration value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Duration.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + public com.google.protobuf.Duration.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : endTime_; + } + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getEndTime(), + getParentForChildren(), + isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object word_ = ""; + /** + *
+     * The word corresponding to this set of information.
+     * 
+ * + * string word = 3; + * @return The word. + */ + public java.lang.String getWord() { + java.lang.Object ref = word_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + word_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The word corresponding to this set of information.
+     * 
+ * + * string word = 3; + * @return The bytes for word. + */ + public com.google.protobuf.ByteString + getWordBytes() { + java.lang.Object ref = word_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + word_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The word corresponding to this set of information.
+     * 
+ * + * string word = 3; + * @param value The word to set. + * @return This builder for chaining. + */ + public Builder setWord( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + word_ = value; + onChanged(); + return this; + } + /** + *
+     * The word corresponding to this set of information.
+     * 
+ * + * string word = 3; + * @return This builder for chaining. + */ + public Builder clearWord() { + + word_ = getDefaultInstance().getWord(); + onChanged(); + return this; + } + /** + *
+     * The word corresponding to this set of information.
+     * 
+ * + * string word = 3; + * @param value The bytes for word to set. + * @return This builder for chaining. + */ + public Builder setWordBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + word_ = value; + onChanged(); + return this; + } + + private float confidence_ ; + /** + *
+     * The confidence estimate between 0.0 and 1.0. A higher number
+     * indicates an estimated greater likelihood that the recognized words are
+     * correct. This field is set only for the top alternative of a non-streaming
+     * result or, of a streaming result where `is_final=true`.
+     * This field is not guaranteed to be accurate and users should not rely on it
+     * to be always provided.
+     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+     * 
+ * + * float confidence = 4; + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + /** + *
+     * The confidence estimate between 0.0 and 1.0. A higher number
+     * indicates an estimated greater likelihood that the recognized words are
+     * correct. This field is set only for the top alternative of a non-streaming
+     * result or, of a streaming result where `is_final=true`.
+     * This field is not guaranteed to be accurate and users should not rely on it
+     * to be always provided.
+     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+     * 
+ * + * float confidence = 4; + * @param value The confidence to set. + * @return This builder for chaining. + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * The confidence estimate between 0.0 and 1.0. A higher number
+     * indicates an estimated greater likelihood that the recognized words are
+     * correct. This field is set only for the top alternative of a non-streaming
+     * result or, of a streaming result where `is_final=true`.
+     * This field is not guaranteed to be accurate and users should not rely on it
+     * to be always provided.
+     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+     * 
+ * + * float confidence = 4; + * @return This builder for chaining. + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + + private int speakerTag_ ; + /** + *
+     * Output only. A distinct integer value is assigned for every speaker within
+     * the audio. This field specifies which one of those speakers was detected to
+     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
+     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
+     * top alternative.
+     * 
+ * + * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The speakerTag. + */ + @java.lang.Override + public int getSpeakerTag() { + return speakerTag_; + } + /** + *
+     * Output only. A distinct integer value is assigned for every speaker within
+     * the audio. This field specifies which one of those speakers was detected to
+     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
+     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
+     * top alternative.
+     * 
+ * + * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The speakerTag to set. + * @return This builder for chaining. + */ + public Builder setSpeakerTag(int value) { + + speakerTag_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. A distinct integer value is assigned for every speaker within
+     * the audio. This field specifies which one of those speakers was detected to
+     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
+     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
+     * top alternative.
+     * 
+ * + * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearSpeakerTag() { + + speakerTag_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.WordInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.WordInfo) + private static final com.google.cloud.speech.v1.WordInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1.WordInfo(); + } + + public static com.google.cloud.speech.v1.WordInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WordInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WordInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1.WordInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java new file mode 100644 index 000000000000..f8e889216201 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java @@ -0,0 +1,143 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1/cloud_speech.proto + +package com.google.cloud.speech.v1; + +public interface WordInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.WordInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the start of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration start_time = 1; + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the start of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration start_time = 1; + * @return The startTime. + */ + com.google.protobuf.Duration getStartTime(); + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the start of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder(); + + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the end of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration end_time = 2; + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the end of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration end_time = 2; + * @return The endTime. + */ + com.google.protobuf.Duration getEndTime(); + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the end of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder(); + + /** + *
+   * The word corresponding to this set of information.
+   * 
+ * + * string word = 3; + * @return The word. + */ + java.lang.String getWord(); + /** + *
+   * The word corresponding to this set of information.
+   * 
+ * + * string word = 3; + * @return The bytes for word. + */ + com.google.protobuf.ByteString + getWordBytes(); + + /** + *
+   * The confidence estimate between 0.0 and 1.0. A higher number
+   * indicates an estimated greater likelihood that the recognized words are
+   * correct. This field is set only for the top alternative of a non-streaming
+   * result or, of a streaming result where `is_final=true`.
+   * This field is not guaranteed to be accurate and users should not rely on it
+   * to be always provided.
+   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+   * 
+ * + * float confidence = 4; + * @return The confidence. + */ + float getConfidence(); + + /** + *
+   * Output only. A distinct integer value is assigned for every speaker within
+   * the audio. This field specifies which one of those speakers was detected to
+   * have spoken this word. Value ranges from '1' to diarization_speaker_count.
+   * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
+   * top alternative.
+   * 
+ * + * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The speakerTag. + */ + int getSpeakerTag(); +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto new file mode 100644 index 000000000000..65aed9837e85 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto @@ -0,0 +1,899 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/speech/v1/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1;speech"; +option java_multiple_files = true; +option java_outer_classname = "SpeechProto"; +option java_package = "com.google.cloud.speech.v1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech API. +service Speech { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Performs synchronous speech recognition: receive results after all audio + // has been sent and processed. + rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { + option (google.api.http) = { + post: "/v1/speech:recognize" + body: "*" + }; + option (google.api.method_signature) = "config,audio"; + } + + // Performs asynchronous speech recognition: receive results via the + // google.longrunning.Operations interface. Returns either an + // `Operation.error` or an `Operation.response` which contains + // a `LongRunningRecognizeResponse` message. + // For more information on asynchronous speech recognition, see the + // [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + rpc LongRunningRecognize(LongRunningRecognizeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/speech:longrunningrecognize" + body: "*" + }; + option (google.api.method_signature) = "config,audio"; + option (google.longrunning.operation_info) = { + response_type: "LongRunningRecognizeResponse" + metadata_type: "LongRunningRecognizeMetadata" + }; + } + + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + rpc StreamingRecognize(stream StreamingRecognizeRequest) returns (stream StreamingRecognizeResponse) { + } +} + +// The top-level message sent by the client for the `Recognize` method. +message RecognizeRequest { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The audio data to be recognized. + RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The top-level message sent by the client for the `LongRunningRecognize` +// method. +message LongRunningRecognizeRequest { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The audio data to be recognized. + RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies an optional destination for the recognition results. + TranscriptOutputConfig output_config = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies an optional destination for the recognition results. +message TranscriptOutputConfig { + oneof output_type { + // Specifies a Cloud Storage URI for the recognition results. Must be + // specified in the format: `gs://bucket_name/object_name`, and the bucket + // must already exist. + string gcs_uri = 1; + } +} + +// The top-level message sent by the client for the `StreamingRecognize` method. +// Multiple `StreamingRecognizeRequest` messages are sent. The first message +// must contain a `streaming_config` message and must not contain +// `audio_content`. All subsequent messages must contain `audio_content` and +// must not contain a `streaming_config` message. +message StreamingRecognizeRequest { + // The streaming request, which is either a streaming config or audio content. + oneof streaming_request { + // Provides information to the recognizer that specifies how to process the + // request. The first `StreamingRecognizeRequest` message must contain a + // `streaming_config` message. + StreamingRecognitionConfig streaming_config = 1; + + // The audio data to be recognized. Sequential chunks of audio data are sent + // in sequential `StreamingRecognizeRequest` messages. The first + // `StreamingRecognizeRequest` message must not contain `audio_content` data + // and all subsequent `StreamingRecognizeRequest` messages must contain + // `audio_content` data. The audio bytes must be encoded as specified in + // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + // pure binary representation (not base64). See + // [content limits](https://cloud.google.com/speech-to-text/quotas#content). + bytes audio_content = 2; + } +} + +// Provides information to the recognizer that specifies how to process the +// request. +message StreamingRecognitionConfig { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // If `false` or omitted, the recognizer will perform continuous + // recognition (continuing to wait for and process audio even if the user + // pauses speaking) until the client closes the input stream (gRPC API) or + // until the maximum time limit has been reached. May return multiple + // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. + // + // If `true`, the recognizer will detect a single spoken utterance. When it + // detects that the user has paused or stopped speaking, it will return an + // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no + // more than one `StreamingRecognitionResult` with the `is_final` flag set to + // `true`. + // + // The `single_utterance` field can only be used with specified models, + // otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] + // must be set to: + // + // * `command_and_search` + // * `phone_call` AND additional field `useEnhanced`=`true` + // * The `model` field is left undefined. In this case the API auto-selects + // a model based on any other parameters that you set in + // `RecognitionConfig`. + bool single_utterance = 2; + + // If `true`, interim results (tentative hypotheses) may be + // returned as they become available (these interim results are indicated with + // the `is_final=false` flag). + // If `false` or omitted, only `is_final=true` result(s) are returned. + bool interim_results = 3; +} + +// Provides information to the recognizer that specifies how to process the +// request. +message RecognitionConfig { + // The encoding of the audio data sent in the request. + // + // All encodings support only 1 channel (mono) audio, unless the + // `audio_channel_count` and `enable_separate_recognition_per_channel` fields + // are set. + // + // For best results, the audio source should be captured and transmitted using + // a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech + // recognition can be reduced if lossy codecs are used to capture or transmit + // audio, particularly if background noise is present. Lossy codecs include + // `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`, + // and `WEBM_OPUS`. + // + // The `FLAC` and `WAV` audio file formats include a header that describes the + // included audio content. You can request recognition for `WAV` files that + // contain either `LINEAR16` or `MULAW` encoded audio. + // If you send `FLAC` or `WAV` audio file format in + // your request, you do not need to specify an `AudioEncoding`; the audio + // encoding format is determined from the file header. If you specify + // an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the + // encoding configuration must match the encoding described in the audio + // header; otherwise the request returns an + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code. + enum AudioEncoding { + // Not specified. + ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + LINEAR16 = 1; + + // `FLAC` (Free Lossless Audio + // Codec) is the recommended encoding because it is + // lossless--therefore recognition is not compromised--and + // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream + // encoding supports 16-bit and 24-bit samples, however, not all fields in + // `STREAMINFO` are supported. + FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + MULAW = 3; + + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AMR = 4; + + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AMR_WB = 5; + + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. + OGG_OPUS = 6; + + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Cloud Speech API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + SPEEX_WITH_HEADER_BYTE = 7; + + // Opus encoded audio frames in WebM container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be + // one of 8000, 12000, 16000, 24000, or 48000. + WEBM_OPUS = 9; + } + + // Encoding of audio data sent in all `RecognitionAudio` messages. + // This field is optional for `FLAC` and `WAV` audio files and required + // for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding]. + AudioEncoding encoding = 1; + + // Sample rate in Hertz of the audio data sent in all + // `RecognitionAudio` messages. Valid values are: 8000-48000. + // 16000 is optimal. For best results, set the sampling rate of the audio + // source to 16000 Hz. If that's not possible, use the native sample rate of + // the audio source (instead of re-sampling). + // This field is optional for FLAC and WAV audio files, but is + // required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding]. + int32 sample_rate_hertz = 2; + + // The number of channels in the input audio data. + // ONLY set this for MULTI-CHANNEL recognition. + // Valid values for LINEAR16 and FLAC are `1`-`8`. + // Valid values for OGG_OPUS are '1'-'254'. + // Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. + // If `0` or omitted, defaults to one channel (mono). + // Note: We only recognize the first channel by default. + // To perform independent recognition on each channel set + // `enable_separate_recognition_per_channel` to 'true'. + int32 audio_channel_count = 7; + + // This needs to be set to `true` explicitly and `audio_channel_count` > 1 + // to get each channel recognized separately. The recognition result will + // contain a `channel_tag` field to state which channel that result belongs + // to. If this is not true, we will only recognize the first channel. The + // request is billed cumulatively for all channels recognized: + // `audio_channel_count` multiplied by the length of the audio. + bool enable_separate_recognition_per_channel = 12; + + // Required. The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Example: "en-US". + // See [Language + // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + // of the currently supported language codes. + string language_code = 3 [(google.api.field_behavior) = REQUIRED]; + + // A list of up to 3 additional + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, + // listing possible alternative languages of the supplied audio. + // See [Language + // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + // of the currently supported language codes. If alternative languages are + // listed, recognition result will contain recognition in the most likely + // language detected including the main language_code. The recognition result + // will include the language tag of the language detected in the audio. Note: + // This feature is only supported for Voice Command and Voice Search use cases + // and performance may vary for other use cases (e.g., phone call + // transcription). + repeated string alternative_language_codes = 18; + + // Maximum number of recognition hypotheses to be returned. + // Specifically, the maximum number of `SpeechRecognitionAlternative` messages + // within each `SpeechRecognitionResult`. + // The server may return fewer than `max_alternatives`. + // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + // one. If omitted, will return a maximum of one. + int32 max_alternatives = 4; + + // If set to `true`, the server will attempt to filter out + // profanities, replacing all but the initial character in each filtered word + // with asterisks, e.g. "f***". If set to `false` or omitted, profanities + // won't be filtered out. + bool profanity_filter = 5; + + // Speech adaptation configuration improves the accuracy of speech + // recognition. For more information, see the [speech + // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation) + // documentation. + // When speech adaptation is set it supersedes the `speech_contexts` field. + SpeechAdaptation adaptation = 20; + + // Array of [SpeechContext][google.cloud.speech.v1.SpeechContext]. + // A means to provide context to assist the speech recognition. For more + // information, see + // [speech + // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation). + repeated SpeechContext speech_contexts = 6; + + // If `true`, the top result includes a list of words and + // the start and end time offsets (timestamps) for those words. If + // `false`, no word-level time offset information is returned. The default is + // `false`. + bool enable_word_time_offsets = 8; + + // If `true`, the top result includes a list of words and the + // confidence for those words. If `false`, no word-level confidence + // information is returned. The default is `false`. + bool enable_word_confidence = 15; + + // If 'true', adds punctuation to recognition result hypotheses. + // This feature is only available in select languages. Setting this for + // requests in other languages has no effect at all. + // The default 'false' value does not add punctuation to result hypotheses. + bool enable_automatic_punctuation = 11; + + // The spoken punctuation behavior for the call + // If not set, uses default behavior based on model of choice + // e.g. command_and_search will enable spoken punctuation by default + // If 'true', replaces spoken punctuation with the corresponding symbols in + // the request. For example, "how are you question mark" becomes "how are + // you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation + // for support. If 'false', spoken punctuation is not replaced. + google.protobuf.BoolValue enable_spoken_punctuation = 22; + + // The spoken emoji behavior for the call + // If not set, uses default behavior based on model of choice + // If 'true', adds spoken emoji formatting for the request. This will replace + // spoken emojis with the corresponding Unicode symbols in the final + // transcript. If 'false', spoken emojis are not replaced. + google.protobuf.BoolValue enable_spoken_emojis = 23; + + // Config to enable speaker diarization and set additional + // parameters to make diarization better suited for your application. + // Note: When this is enabled, we send all the words from the beginning of the + // audio for the top alternative in every consecutive STREAMING responses. + // This is done in order to improve our speaker tags as our models learn to + // identify the speakers in the conversation over time. + // For non-streaming requests, the diarization results will be provided only + // in the top alternative of the FINAL SpeechRecognitionResult. + SpeakerDiarizationConfig diarization_config = 19; + + // Metadata regarding this request. + RecognitionMetadata metadata = 9; + + // Which model to select for the given request. Select the model + // best suited to your domain to get best results. If a model is not + // explicitly specified, then we auto-select a model based on the parameters + // in the RecognitionConfig. + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + //
ModelDescription
latest_longBest for long form content like media or conversation.
latest_shortBest for short form content like commands or single shot directed + // speech.
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically + // recorded at an 8khz sampling rate).
videoBest for audio that originated from video or includes multiple + // speakers. Ideally the audio is recorded at a 16khz or greater + // sampling rate. This is a premium model that costs more than the + // standard rate.
defaultBest for audio that is not one of the specific audio models. + // For example, long-form audio. Ideally the audio is high-fidelity, + // recorded at a 16khz or greater sampling rate.
medical_conversationBest for audio that originated from a conversation between a + // medical provider and patient.
medical_dictationBest for audio that originated from dictation notes by a medical + // provider.
+ string model = 13; + + // Set to true to use an enhanced model for speech recognition. + // If `use_enhanced` is set to true and the `model` field is not set, then + // an appropriate enhanced model is chosen if an enhanced model exists for + // the audio. + // + // If `use_enhanced` is true and an enhanced version of the specified model + // does not exist, then the speech is recognized using the standard version + // of the specified model. + bool use_enhanced = 14; +} + +// Config to enable speaker diarization. +message SpeakerDiarizationConfig { + // If 'true', enables speaker detection for each recognized word in + // the top alternative of the recognition result using a speaker_tag provided + // in the WordInfo. + bool enable_speaker_diarization = 1; + + // Minimum number of speakers in the conversation. This range gives you more + // flexibility by allowing the system to automatically determine the correct + // number of speakers. If not set, the default value is 2. + int32 min_speaker_count = 2; + + // Maximum number of speakers in the conversation. This range gives you more + // flexibility by allowing the system to automatically determine the correct + // number of speakers. If not set, the default value is 6. + int32 max_speaker_count = 3; + + // Output only. Unused. + int32 speaker_tag = 5 [ + deprecated = true, + (google.api.field_behavior) = OUTPUT_ONLY + ]; +} + +// Description of audio data to be recognized. +message RecognitionMetadata { + option deprecated = true; + + // Use case categories that the audio recognition request can be described + // by. + enum InteractionType { + // Use case is either unknown or is something other than one of the other + // values below. + INTERACTION_TYPE_UNSPECIFIED = 0; + + // Multiple people in a conversation or discussion. For example in a + // meeting with two or more people actively participating. Typically + // all the primary people speaking would be in the same room (if not, + // see PHONE_CALL) + DISCUSSION = 1; + + // One or more persons lecturing or presenting to others, mostly + // uninterrupted. + PRESENTATION = 2; + + // A phone-call or video-conference in which two or more people, who are + // not in the same room, are actively participating. + PHONE_CALL = 3; + + // A recorded message intended for another person to listen to. + VOICEMAIL = 4; + + // Professionally produced audio (eg. TV Show, Podcast). + PROFESSIONALLY_PRODUCED = 5; + + // Transcribe spoken questions and queries into text. + VOICE_SEARCH = 6; + + // Transcribe voice commands, such as for controlling a device. + VOICE_COMMAND = 7; + + // Transcribe speech to text to create a written document, such as a + // text-message, email or report. + DICTATION = 8; + } + + // Enumerates the types of capture settings describing an audio file. + enum MicrophoneDistance { + // Audio type is not known. + MICROPHONE_DISTANCE_UNSPECIFIED = 0; + + // The audio was captured from a closely placed microphone. Eg. phone, + // dictaphone, or handheld microphone. Generally if there speaker is within + // 1 meter of the microphone. + NEARFIELD = 1; + + // The speaker if within 3 meters of the microphone. + MIDFIELD = 2; + + // The speaker is more than 3 meters away from the microphone. + FARFIELD = 3; + } + + // The original media the speech was recorded on. + enum OriginalMediaType { + // Unknown original media type. + ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; + + // The speech data is an audio recording. + AUDIO = 1; + + // The speech data originally recorded on a video. + VIDEO = 2; + } + + // The type of device the speech was recorded with. + enum RecordingDeviceType { + // The recording device is unknown. + RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; + + // Speech was recorded on a smartphone. + SMARTPHONE = 1; + + // Speech was recorded using a personal computer or tablet. + PC = 2; + + // Speech was recorded over a phone line. + PHONE_LINE = 3; + + // Speech was recorded in a vehicle. + VEHICLE = 4; + + // Speech was recorded outdoors. + OTHER_OUTDOOR_DEVICE = 5; + + // Speech was recorded indoors. + OTHER_INDOOR_DEVICE = 6; + } + + // The use case most closely describing the audio content to be recognized. + InteractionType interaction_type = 1; + + // The industry vertical to which this speech recognition request most + // closely applies. This is most indicative of the topics contained + // in the audio. Use the 6-digit NAICS code to identify the industry + // vertical - see https://www.naics.com/search/. + uint32 industry_naics_code_of_audio = 3; + + // The audio type that most closely describes the audio being recognized. + MicrophoneDistance microphone_distance = 4; + + // The original media the speech was recorded on. + OriginalMediaType original_media_type = 5; + + // The type of device the speech was recorded with. + RecordingDeviceType recording_device_type = 6; + + // The device used to make the recording. Examples 'Nexus 5X' or + // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or + // 'Cardioid Microphone'. + string recording_device_name = 7; + + // Mime type of the original audio file. For example `audio/m4a`, + // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. + // A list of possible audio mime types is maintained at + // http://www.iana.org/assignments/media-types/media-types.xhtml#audio + string original_mime_type = 8; + + // Description of the content. Eg. "Recordings of federal supreme court + // hearings from 2012". + string audio_topic = 10; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message SpeechContext { + // A list of strings containing words and phrases "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + // + // List items can also be set to classes for groups of words that represent + // common concepts that occur in natural language. For example, rather than + // providing phrase hints for every month of the year, using the $MONTH class + // improves the likelihood of correctly transcribing audio that includes + // months. + repeated string phrases = 1; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Negative boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost will simply be ignored. Though `boost` can + // accept a wide range of positive values, most use cases are best served with + // values between 0 and 20. We recommend using a binary search approach to + // finding the optimal value for your use case. + float boost = 4; +} + +// Contains audio data in the encoding specified in the `RecognitionConfig`. +// Either `content` or `uri` must be supplied. Supplying both or neither +// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See +// [content limits](https://cloud.google.com/speech-to-text/quotas#content). +message RecognitionAudio { + // The audio source, which is either inline content or a Google Cloud + // Storage uri. + oneof audio_source { + // The audio data bytes encoded as specified in + // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + // pure binary representation, whereas JSON representations use base64. + bytes content = 1; + + // URI that points to a file that contains audio data bytes as specified in + // `RecognitionConfig`. The file must not be compressed (for example, gzip). + // Currently, only Google Cloud Storage URIs are + // supported, which must be specified in the following format: + // `gs://bucket_name/object_name` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see + // [Request URIs](https://cloud.google.com/storage/docs/reference-uris). + string uri = 2; + } +} + +// The only message returned to the client by the `Recognize` method. It +// contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. +message RecognizeResponse { + // Sequential list of transcription results corresponding to + // sequential portions of audio. + repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; +} + +// The only message returned to the client by the `LongRunningRecognize` method. +// It contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. It is included in the `result.response` field of the `Operation` +// returned by the `GetOperation` call of the `google::longrunning::Operations` +// service. +message LongRunningRecognizeResponse { + // Sequential list of transcription results corresponding to + // sequential portions of audio. + repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; + + // Original output config if present in the request. + TranscriptOutputConfig output_config = 6; + + // If the transcript output fails this field contains the relevant error. + google.rpc.Status output_error = 7; +} + +// Describes the progress of a long-running `LongRunningRecognize` call. It is +// included in the `metadata` field of the `Operation` returned by the +// `GetOperation` call of the `google::longrunning::Operations` service. +message LongRunningRecognizeMetadata { + // Approximate percentage of audio processed thus far. Guaranteed to be 100 + // when the audio is fully processed and the results are available. + int32 progress_percent = 1; + + // Time when the request was received. + google.protobuf.Timestamp start_time = 2; + + // Time of the most recent processing update. + google.protobuf.Timestamp last_update_time = 3; + + // Output only. The URI of the audio file being transcribed. Empty if the audio was sent + // as byte content. + string uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `StreamingRecognizeResponse` is the only message returned to the client by +// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` +// messages are streamed back to the client. If there is no recognizable +// audio, and `single_utterance` is set to false, then no messages are streamed +// back to the client. +// +// Here's an example of a series of `StreamingRecognizeResponse`s that might be +// returned while processing audio: +// +// 1. results { alternatives { transcript: "tube" } stability: 0.01 } +// +// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } +// +// 3. results { alternatives { transcript: "to be" } stability: 0.9 } +// results { alternatives { transcript: " or not to be" } stability: 0.01 } +// +// 4. results { alternatives { transcript: "to be or not to be" +// confidence: 0.92 } +// alternatives { transcript: "to bee or not to bee" } +// is_final: true } +// +// 5. results { alternatives { transcript: " that's" } stability: 0.01 } +// +// 6. results { alternatives { transcript: " that is" } stability: 0.9 } +// results { alternatives { transcript: " the question" } stability: 0.01 } +// +// 7. results { alternatives { transcript: " that is the question" +// confidence: 0.98 } +// alternatives { transcript: " that was the question" } +// is_final: true } +// +// Notes: +// +// - Only two of the above responses #4 and #7 contain final results; they are +// indicated by `is_final: true`. Concatenating these together generates the +// full transcript: "to be or not to be that is the question". +// +// - The others contain interim `results`. #3 and #6 contain two interim +// `results`: the first portion has a high stability and is less likely to +// change; the second portion has a low stability and is very likely to +// change. A UI designer might choose to show only high stability `results`. +// +// - The specific `stability` and `confidence` values shown above are only for +// illustrative purposes. Actual values may vary. +// +// - In each response, only one of these fields will be set: +// `error`, +// `speech_event_type`, or +// one or more (repeated) `results`. +message StreamingRecognizeResponse { + // Indicates the type of speech event. + enum SpeechEventType { + // No speech event specified. + SPEECH_EVENT_UNSPECIFIED = 0; + + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This event is only sent if + // `single_utterance` was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 1; + } + + // If set, returns a [google.rpc.Status][google.rpc.Status] message that + // specifies the error for the operation. + google.rpc.Status error = 1; + + // This repeated list contains zero or more results that + // correspond to consecutive portions of the audio currently being processed. + // It contains zero or one `is_final=true` result (the newly settled portion), + // followed by zero or more `is_final=false` results (the interim results). + repeated StreamingRecognitionResult results = 2; + + // Indicates the type of speech event. + SpeechEventType speech_event_type = 4; + + // When available, billed audio seconds for the stream. + // Set only if this is the last response in the stream. + google.protobuf.Duration total_billed_time = 5; +} + +// A streaming speech recognition result corresponding to a portion of the audio +// that is currently being processed. +message StreamingRecognitionResult { + // May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // If `false`, this `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, this is the final time the + // speech service will return this particular `StreamingRecognitionResult`, + // the recognizer will not return any further hypotheses for this portion of + // the transcript and corresponding audio. + bool is_final = 2; + + // An estimate of the likelihood that the recognizer will not + // change its guess about this interim result. Values range from 0.0 + // (completely unstable) to 1.0 (completely stable). + // This field is only provided for interim results (`is_final=false`). + // The default of 0.0 is a sentinel value indicating `stability` was not set. + float stability = 3; + + // Time offset of the end of this result relative to the + // beginning of the audio. + google.protobuf.Duration result_end_time = 4; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For audio_channel_count = N, its output values can range from '1' to 'N'. + int32 channel_tag = 5; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag + // of the language in this result. This language code was detected to have + // the most likelihood of being spoken in the audio. + string language_code = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A speech recognition result corresponding to a portion of the audio. +message SpeechRecognitionResult { + // May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For audio_channel_count = N, its output values can range from '1' to 'N'. + int32 channel_tag = 2; + + // Time offset of the end of this result relative to the + // beginning of the audio. + google.protobuf.Duration result_end_time = 4; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag + // of the language in this result. This language code was detected to have + // the most likelihood of being spoken in the audio. + string language_code = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Alternative hypotheses (a.k.a. n-best list). +message SpeechRecognitionAlternative { + // Transcript text representing the words that the user spoke. + // In languages that use spaces to separate words, the transcript might have a + // leading space if it isn't the first result. You can concatenate each result + // to obtain the full transcript without using a separator. + string transcript = 1; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where `is_final=true`. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 2; + + // A list of word-specific information for each recognized word. + // Note: When `enable_speaker_diarization` is true, you will see all the words + // from the beginning of the audio. + repeated WordInfo words = 3; +} + +// Word-specific information for recognized words. +message WordInfo { + // Time offset relative to the beginning of the audio, + // and corresponding to the start of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + google.protobuf.Duration start_time = 1; + + // Time offset relative to the beginning of the audio, + // and corresponding to the end of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + google.protobuf.Duration end_time = 2; + + // The word corresponding to this set of information. + string word = 3; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where `is_final=true`. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 4; + + // Output only. A distinct integer value is assigned for every speaker within + // the audio. This field specifies which one of those speakers was detected to + // have spoken this word. Value ranges from '1' to diarization_speaker_count. + // speaker_tag is set if enable_speaker_diarization = 'true' and only in the + // top alternative. + int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech_adaptation.proto b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech_adaptation.proto new file mode 100644 index 000000000000..b0d60ab4a1dd --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech_adaptation.proto @@ -0,0 +1,370 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/speech/v1/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1;speech"; +option java_multiple_files = true; +option java_outer_classname = "SpeechAdaptationProto"; +option java_package = "com.google.cloud.speech.v1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech Adaptation API. +service Adaptation { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Create a set of phrase hints. Each item in the set can be a single word or + // a multi-word phrase. The items in the PhraseSet are favored by the + // recognition model when you send a call that includes the PhraseSet. + rpc CreatePhraseSet(CreatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/phraseSets" + body: "*" + }; + option (google.api.method_signature) = "parent,phrase_set,phrase_set_id"; + } + + // Get a phrase set. + rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List phrase sets. + rpc ListPhraseSet(ListPhraseSetRequest) returns (ListPhraseSetResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/phraseSets" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a phrase set. + rpc UpdatePhraseSet(UpdatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + patch: "/v1/{phrase_set.name=projects/*/locations/*/phraseSets/*}" + body: "phrase_set" + }; + option (google.api.method_signature) = "phrase_set,update_mask"; + } + + // Delete a phrase set. + rpc DeletePhraseSet(DeletePhraseSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a custom class. + rpc CreateCustomClass(CreateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/customClasses" + body: "*" + }; + option (google.api.method_signature) = "parent,custom_class,custom_class_id"; + } + + // Get a custom class. + rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List custom classes. + rpc ListCustomClasses(ListCustomClassesRequest) returns (ListCustomClassesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/customClasses" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a custom class. + rpc UpdateCustomClass(UpdateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + patch: "/v1/{custom_class.name=projects/*/locations/*/customClasses/*}" + body: "custom_class" + }; + option (google.api.method_signature) = "custom_class,update_mask"; + } + + // Delete a custom class. + rpc DeleteCustomClass(DeleteCustomClassRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Message sent by the client for the `CreatePhraseSet` method. +message CreatePhraseSetRequest { + // Required. The parent resource where this phrase set will be created. Format: + // + // `projects/{project}/locations/{location}/phraseSets` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // Required. The ID to use for the phrase set, which will become the final + // component of the phrase set's resource name. + // + // This value should restrict to letters, numbers, and hyphens, with the first + // character a letter, the last a letter or a number, and be 4-63 characters. + string phrase_set_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The phrase set to create. + PhraseSet phrase_set = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdatePhraseSet` method. +message UpdatePhraseSetRequest { + // Required. The phrase set to update. + // + // The phrase set's `name` field is used to identify the set to be + // updated. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetPhraseSet` method. +message GetPhraseSetRequest { + // Required. The name of the phrase set to retrieve. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `ListPhraseSet` method. +message ListPhraseSetRequest { + // Required. The parent, which owns this collection of phrase set. Format: + // + // `projects/{project}/locations/{location}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // The maximum number of phrase sets to return. The service may return + // fewer than this value. If unspecified, at most 50 phrase sets will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListPhraseSet` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListPhraseSet` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListPhraseSet` method. +message ListPhraseSetResponse { + // The phrase set. + repeated PhraseSet phrase_sets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeletePhraseSet` method. +message DeletePhraseSetRequest { + // Required. The name of the phrase set to delete. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `CreateCustomClass` method. +message CreateCustomClassRequest { + // Required. The parent resource where this custom class will be created. Format: + // + // `projects/{project}/locations/{location}/customClasses` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // Required. The ID to use for the custom class, which will become the final + // component of the custom class' resource name. + // + // This value should restrict to letters, numbers, and hyphens, with the first + // character a letter, the last a letter or a number, and be 4-63 characters. + string custom_class_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The custom class to create. + CustomClass custom_class = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdateCustomClass` method. +message UpdateCustomClassRequest { + // Required. The custom class to update. + // + // The custom class's `name` field is used to identify the custom class to be + // updated. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetCustomClass` method. +message GetCustomClassRequest { + // Required. The name of the custom class to retrieve. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} + +// Message sent by the client for the `ListCustomClasses` method. +message ListCustomClassesRequest { + // Required. The parent, which owns this collection of custom classes. Format: + // + // `projects/{project}/locations/{location}/customClasses` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // The maximum number of custom classes to return. The service may return + // fewer than this value. If unspecified, at most 50 custom classes will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListCustomClass` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCustomClass` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListCustomClasses` method. +message ListCustomClassesResponse { + // The custom classes. + repeated CustomClass custom_classes = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeleteCustomClass` method. +message DeleteCustomClassRequest { + // Required. The name of the custom class to delete. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/resource.proto b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/resource.proto new file mode 100644 index 000000000000..0ae5caa9e9ff --- /dev/null +++ b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/resource.proto @@ -0,0 +1,138 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1; + +import "google/api/resource.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1;speech"; +option java_multiple_files = true; +option java_outer_classname = "SpeechResourceProto"; +option java_package = "com.google.cloud.speech.v1"; +option objc_class_prefix = "GCS"; + +// A set of words or phrases that represents a common concept likely to appear +// in your audio, for example a list of passenger ship names. CustomClass items +// can be substituted into placeholders that you set in PhraseSet phrases. +message CustomClass { + option (google.api.resource) = { + type: "speech.googleapis.com/CustomClass" + pattern: "projects/{project}/locations/{location}/customClasses/{custom_class}" + }; + + // An item of the class. + message ClassItem { + // The class item's value. + string value = 1; + } + + // The resource name of the custom class. + string name = 1; + + // If this custom class is a resource, the custom_class_id is the resource id + // of the CustomClass. Case sensitive. + string custom_class_id = 2; + + // A collection of class items. + repeated ClassItem items = 3; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message PhraseSet { + option (google.api.resource) = { + type: "speech.googleapis.com/PhraseSet" + pattern: "projects/{project}/locations/{location}/phraseSets/{phrase_set}" + }; + + // A phrases containing words and phrase "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + // + // List items can also include pre-built or custom classes containing groups + // of words that represent common concepts that occur in natural language. For + // example, rather than providing a phrase hint for every month of the + // year (e.g. "i was born in january", "i was born in febuary", ...), use the + // pre-built `$MONTH` class improves the likelihood of correctly transcribing + // audio that includes months (e.g. "i was born in $month"). + // To refer to pre-built classes, use the class' symbol prepended with `$` + // e.g. `$MONTH`. To refer to custom classes that were defined inline in the + // request, set the class's `custom_class_id` to a string unique to all class + // resources and inline classes. Then use the class' id wrapped in $`{...}` + // e.g. "${my-months}". To refer to custom classes resources, use the class' + // id wrapped in `${}` (e.g. `${my-months}`). + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or + // `eu` location value. + message Phrase { + // The phrase itself. + string value = 1; + + // Hint Boost. Overrides the boost set at the phrase set level. + // Positive value will increase the probability that a specific phrase will + // be recognized over other similar sounding phrases. The higher the boost, + // the higher the chance of false positive recognition as well. Negative + // boost will simply be ignored. Though `boost` can accept a wide range of + // positive values, most use cases are best served + // with values between 0 and 20. We recommend using a binary search approach + // to finding the optimal value for your use case. Speech recognition + // will skip PhraseSets with a boost value of 0. + float boost = 2; + } + + // The resource name of the phrase set. + string name = 1; + + // A list of word and phrases. + repeated Phrase phrases = 2; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Negative boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost will simply be ignored. Though `boost` can + // accept a wide range of positive values, most use cases are best served with + // values between 0 (exclusive) and 20. We recommend using a binary search + // approach to finding the optimal value for your use case. Speech recognition + // will skip PhraseSets with a boost value of 0. + float boost = 4; +} + +// Speech adaptation configuration. +message SpeechAdaptation { + // A collection of phrase sets. To specify the hints inline, leave the + // phrase set's `name` blank and fill in the rest of its fields. Any + // phrase set can use any custom class. + repeated PhraseSet phrase_sets = 1; + + // A collection of phrase set resource names to use. + repeated string phrase_set_references = 2 [(google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + }]; + + // A collection of custom classes. To specify the classes inline, leave the + // class' `name` blank and fill in the rest of its fields, giving it a unique + // `custom_class_id`. Refer to the inline defined class in phrase hints by its + // `custom_class_id`. + repeated CustomClass custom_classes = 3; +} diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..b2bcdf720b7f --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.AdaptationSettings; +import com.google.cloud.speech.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AdaptationSettings adaptationSettings = + AdaptationSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings); + } +} +// [END speech_v1_generated_adaptationclient_create_setcredentialsprovider_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..1bab8005d019 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,43 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_create_setcredentialsprovider1_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.AdaptationSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AdaptationSettings adaptationSettings = + AdaptationSettings.newBuilder() + .setTransportChannelProvider( + AdaptationSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings); + } +} +// [END speech_v1_generated_adaptationclient_create_setcredentialsprovider1_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetEndpoint.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..bd27d2fcec3c --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_create_setendpoint_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.AdaptationSettings; +import com.google.cloud.speech.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AdaptationSettings adaptationSettings = + AdaptationSettings.newBuilder().setEndpoint(myEndpoint).build(); + AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings); + } +} +// [END speech_v1_generated_adaptationclient_create_setendpoint_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java new file mode 100644 index 000000000000..40bd825d213d --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java @@ -0,0 +1,52 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_createcustomclass_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CreateCustomClassRequest; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.LocationName; + +public class AsyncCreateCustomClass { + + public static void main(String[] args) throws Exception { + asyncCreateCustomClass(); + } + + public static void asyncCreateCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CreateCustomClassRequest request = + CreateCustomClassRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setCustomClassId("customClassId1871032322") + .setCustomClass(CustomClass.newBuilder().build()) + .build(); + ApiFuture future = + adaptationClient.createCustomClassCallable().futureCall(request); + // Do something. + CustomClass response = future.get(); + } + } +} +// [END speech_v1_generated_adaptationclient_createcustomclass_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClass.java new file mode 100644 index 000000000000..3d8f3f2c0f31 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClass.java @@ -0,0 +1,48 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_createcustomclass_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CreateCustomClassRequest; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.LocationName; + +public class SyncCreateCustomClass { + + public static void main(String[] args) throws Exception { + syncCreateCustomClass(); + } + + public static void syncCreateCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CreateCustomClassRequest request = + CreateCustomClassRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setCustomClassId("customClassId1871032322") + .setCustomClass(CustomClass.newBuilder().build()) + .build(); + CustomClass response = adaptationClient.createCustomClass(request); + } + } +} +// [END speech_v1_generated_adaptationclient_createcustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java new file mode 100644 index 000000000000..2203cbf4e00f --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_createcustomclass_locationnamecustomclassstring_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.LocationName; + +public class SyncCreateCustomClassLocationnameCustomclassString { + + public static void main(String[] args) throws Exception { + syncCreateCustomClassLocationnameCustomclassString(); + } + + public static void syncCreateCustomClassLocationnameCustomclassString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId); + } + } +} +// [END speech_v1_generated_adaptationclient_createcustomclass_locationnamecustomclassstring_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java new file mode 100644 index 000000000000..4ba5f80f6f6d --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_createcustomclass_stringcustomclassstring_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.LocationName; + +public class SyncCreateCustomClassStringCustomclassString { + + public static void main(String[] args) throws Exception { + syncCreateCustomClassStringCustomclassString(); + } + + public static void syncCreateCustomClassStringCustomclassString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId); + } + } +} +// [END speech_v1_generated_adaptationclient_createcustomclass_stringcustomclassstring_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java new file mode 100644 index 000000000000..52d59f186ef3 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_createphraseset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1.LocationName; +import com.google.cloud.speech.v1.PhraseSet; + +public class AsyncCreatePhraseSet { + + public static void main(String[] args) throws Exception { + asyncCreatePhraseSet(); + } + + public static void asyncCreatePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CreatePhraseSetRequest request = + CreatePhraseSetRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPhraseSetId("phraseSetId959902180") + .setPhraseSet(PhraseSet.newBuilder().build()) + .build(); + ApiFuture future = adaptationClient.createPhraseSetCallable().futureCall(request); + // Do something. + PhraseSet response = future.get(); + } + } +} +// [END speech_v1_generated_adaptationclient_createphraseset_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSet.java new file mode 100644 index 000000000000..6512403a09dd --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSet.java @@ -0,0 +1,48 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_createphraseset_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1.LocationName; +import com.google.cloud.speech.v1.PhraseSet; + +public class SyncCreatePhraseSet { + + public static void main(String[] args) throws Exception { + syncCreatePhraseSet(); + } + + public static void syncCreatePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CreatePhraseSetRequest request = + CreatePhraseSetRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPhraseSetId("phraseSetId959902180") + .setPhraseSet(PhraseSet.newBuilder().build()) + .build(); + PhraseSet response = adaptationClient.createPhraseSet(request); + } + } +} +// [END speech_v1_generated_adaptationclient_createphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java new file mode 100644 index 000000000000..8cbc5627275c --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_createphraseset_locationnamephrasesetstring_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.LocationName; +import com.google.cloud.speech.v1.PhraseSet; + +public class SyncCreatePhraseSetLocationnamePhrasesetString { + + public static void main(String[] args) throws Exception { + syncCreatePhraseSetLocationnamePhrasesetString(); + } + + public static void syncCreatePhraseSetLocationnamePhrasesetString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId); + } + } +} +// [END speech_v1_generated_adaptationclient_createphraseset_locationnamephrasesetstring_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java new file mode 100644 index 000000000000..ca700e324514 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_createphraseset_stringphrasesetstring_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.LocationName; +import com.google.cloud.speech.v1.PhraseSet; + +public class SyncCreatePhraseSetStringPhrasesetString { + + public static void main(String[] args) throws Exception { + syncCreatePhraseSetStringPhrasesetString(); + } + + public static void syncCreatePhraseSetStringPhrasesetString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId); + } + } +} +// [END speech_v1_generated_adaptationclient_createphraseset_stringphrasesetstring_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java new file mode 100644 index 000000000000..0d0fd62e6a07 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_deletecustomclass_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClassName; +import com.google.cloud.speech.v1.DeleteCustomClassRequest; +import com.google.protobuf.Empty; + +public class AsyncDeleteCustomClass { + + public static void main(String[] args) throws Exception { + asyncDeleteCustomClass(); + } + + public static void asyncDeleteCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + DeleteCustomClassRequest request = + DeleteCustomClassRequest.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .build(); + ApiFuture future = adaptationClient.deleteCustomClassCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END speech_v1_generated_adaptationclient_deletecustomclass_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java new file mode 100644 index 000000000000..86e20619366a --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java @@ -0,0 +1,46 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_deletecustomclass_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClassName; +import com.google.cloud.speech.v1.DeleteCustomClassRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteCustomClass { + + public static void main(String[] args) throws Exception { + syncDeleteCustomClass(); + } + + public static void syncDeleteCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + DeleteCustomClassRequest request = + DeleteCustomClassRequest.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .build(); + adaptationClient.deleteCustomClass(request); + } + } +} +// [END speech_v1_generated_adaptationclient_deletecustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java new file mode 100644 index 000000000000..a40dfb49e8ce --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_deletecustomclass_customclassname_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClassName; +import com.google.protobuf.Empty; + +public class SyncDeleteCustomClassCustomclassname { + + public static void main(String[] args) throws Exception { + syncDeleteCustomClassCustomclassname(); + } + + public static void syncDeleteCustomClassCustomclassname() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + adaptationClient.deleteCustomClass(name); + } + } +} +// [END speech_v1_generated_adaptationclient_deletecustomclass_customclassname_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java new file mode 100644 index 000000000000..784c891bc532 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_deletecustomclass_string_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClassName; +import com.google.protobuf.Empty; + +public class SyncDeleteCustomClassString { + + public static void main(String[] args) throws Exception { + syncDeleteCustomClassString(); + } + + public static void syncDeleteCustomClassString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString(); + adaptationClient.deleteCustomClass(name); + } + } +} +// [END speech_v1_generated_adaptationclient_deletecustomclass_string_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java new file mode 100644 index 000000000000..a78c39816344 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_deletephraseset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1.PhraseSetName; +import com.google.protobuf.Empty; + +public class AsyncDeletePhraseSet { + + public static void main(String[] args) throws Exception { + asyncDeletePhraseSet(); + } + + public static void asyncDeletePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + DeletePhraseSetRequest request = + DeletePhraseSetRequest.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .build(); + ApiFuture future = adaptationClient.deletePhraseSetCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END speech_v1_generated_adaptationclient_deletephraseset_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java new file mode 100644 index 000000000000..367673ef3c2b --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java @@ -0,0 +1,46 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_deletephraseset_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1.PhraseSetName; +import com.google.protobuf.Empty; + +public class SyncDeletePhraseSet { + + public static void main(String[] args) throws Exception { + syncDeletePhraseSet(); + } + + public static void syncDeletePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + DeletePhraseSetRequest request = + DeletePhraseSetRequest.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .build(); + adaptationClient.deletePhraseSet(request); + } + } +} +// [END speech_v1_generated_adaptationclient_deletephraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java new file mode 100644 index 000000000000..c3c1427d133d --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_deletephraseset_phrasesetname_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.PhraseSetName; +import com.google.protobuf.Empty; + +public class SyncDeletePhraseSetPhrasesetname { + + public static void main(String[] args) throws Exception { + syncDeletePhraseSetPhrasesetname(); + } + + public static void syncDeletePhraseSetPhrasesetname() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + adaptationClient.deletePhraseSet(name); + } + } +} +// [END speech_v1_generated_adaptationclient_deletephraseset_phrasesetname_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java new file mode 100644 index 000000000000..bf8bb5a391a5 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_deletephraseset_string_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.PhraseSetName; +import com.google.protobuf.Empty; + +public class SyncDeletePhraseSetString { + + public static void main(String[] args) throws Exception { + syncDeletePhraseSetString(); + } + + public static void syncDeletePhraseSetString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString(); + adaptationClient.deletePhraseSet(name); + } + } +} +// [END speech_v1_generated_adaptationclient_deletephraseset_string_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/AsyncGetCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/AsyncGetCustomClass.java new file mode 100644 index 000000000000..cd328b12ee82 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/AsyncGetCustomClass.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_getcustomclass_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.CustomClassName; +import com.google.cloud.speech.v1.GetCustomClassRequest; + +public class AsyncGetCustomClass { + + public static void main(String[] args) throws Exception { + asyncGetCustomClass(); + } + + public static void asyncGetCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + GetCustomClassRequest request = + GetCustomClassRequest.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .build(); + ApiFuture future = adaptationClient.getCustomClassCallable().futureCall(request); + // Do something. + CustomClass response = future.get(); + } + } +} +// [END speech_v1_generated_adaptationclient_getcustomclass_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClass.java new file mode 100644 index 000000000000..191aa960d608 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClass.java @@ -0,0 +1,46 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_getcustomclass_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.CustomClassName; +import com.google.cloud.speech.v1.GetCustomClassRequest; + +public class SyncGetCustomClass { + + public static void main(String[] args) throws Exception { + syncGetCustomClass(); + } + + public static void syncGetCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + GetCustomClassRequest request = + GetCustomClassRequest.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .build(); + CustomClass response = adaptationClient.getCustomClass(request); + } + } +} +// [END speech_v1_generated_adaptationclient_getcustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java new file mode 100644 index 000000000000..a233a5292c83 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_getcustomclass_customclassname_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.CustomClassName; + +public class SyncGetCustomClassCustomclassname { + + public static void main(String[] args) throws Exception { + syncGetCustomClassCustomclassname(); + } + + public static void syncGetCustomClassCustomclassname() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + CustomClass response = adaptationClient.getCustomClass(name); + } + } +} +// [END speech_v1_generated_adaptationclient_getcustomclass_customclassname_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassString.java new file mode 100644 index 000000000000..47c1cd4352f9 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassString.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_getcustomclass_string_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.CustomClassName; + +public class SyncGetCustomClassString { + + public static void main(String[] args) throws Exception { + syncGetCustomClassString(); + } + + public static void syncGetCustomClassString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString(); + CustomClass response = adaptationClient.getCustomClass(name); + } + } +} +// [END speech_v1_generated_adaptationclient_getcustomclass_string_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/AsyncGetPhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/AsyncGetPhraseSet.java new file mode 100644 index 000000000000..20bfd9e54da1 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/AsyncGetPhraseSet.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_getphraseset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.GetPhraseSetRequest; +import com.google.cloud.speech.v1.PhraseSet; +import com.google.cloud.speech.v1.PhraseSetName; + +public class AsyncGetPhraseSet { + + public static void main(String[] args) throws Exception { + asyncGetPhraseSet(); + } + + public static void asyncGetPhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + GetPhraseSetRequest request = + GetPhraseSetRequest.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .build(); + ApiFuture future = adaptationClient.getPhraseSetCallable().futureCall(request); + // Do something. + PhraseSet response = future.get(); + } + } +} +// [END speech_v1_generated_adaptationclient_getphraseset_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSet.java new file mode 100644 index 000000000000..9399c9f20d73 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSet.java @@ -0,0 +1,46 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_getphraseset_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.GetPhraseSetRequest; +import com.google.cloud.speech.v1.PhraseSet; +import com.google.cloud.speech.v1.PhraseSetName; + +public class SyncGetPhraseSet { + + public static void main(String[] args) throws Exception { + syncGetPhraseSet(); + } + + public static void syncGetPhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + GetPhraseSetRequest request = + GetPhraseSetRequest.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .build(); + PhraseSet response = adaptationClient.getPhraseSet(request); + } + } +} +// [END speech_v1_generated_adaptationclient_getphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java new file mode 100644 index 000000000000..eb9726fb2052 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_getphraseset_phrasesetname_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.PhraseSet; +import com.google.cloud.speech.v1.PhraseSetName; + +public class SyncGetPhraseSetPhrasesetname { + + public static void main(String[] args) throws Exception { + syncGetPhraseSetPhrasesetname(); + } + + public static void syncGetPhraseSetPhrasesetname() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + PhraseSet response = adaptationClient.getPhraseSet(name); + } + } +} +// [END speech_v1_generated_adaptationclient_getphraseset_phrasesetname_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetString.java new file mode 100644 index 000000000000..67068562983b --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetString.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_getphraseset_string_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.PhraseSet; +import com.google.cloud.speech.v1.PhraseSetName; + +public class SyncGetPhraseSetString { + + public static void main(String[] args) throws Exception { + syncGetPhraseSetString(); + } + + public static void syncGetPhraseSetString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString(); + PhraseSet response = adaptationClient.getPhraseSet(name); + } + } +} +// [END speech_v1_generated_adaptationclient_getphraseset_string_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java new file mode 100644 index 000000000000..8fd934090797 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java @@ -0,0 +1,54 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_listcustomclasses_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.ListCustomClassesRequest; +import com.google.cloud.speech.v1.LocationName; + +public class AsyncListCustomClasses { + + public static void main(String[] args) throws Exception { + asyncListCustomClasses(); + } + + public static void asyncListCustomClasses() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + ListCustomClassesRequest request = + ListCustomClassesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + adaptationClient.listCustomClassesPagedCallable().futureCall(request); + // Do something. + for (CustomClass element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1_generated_adaptationclient_listcustomclasses_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java new file mode 100644 index 000000000000..34e934e7a73c --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java @@ -0,0 +1,62 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_listcustomclasses_paged_async] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.ListCustomClassesRequest; +import com.google.cloud.speech.v1.ListCustomClassesResponse; +import com.google.cloud.speech.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListCustomClassesPaged { + + public static void main(String[] args) throws Exception { + asyncListCustomClassesPaged(); + } + + public static void asyncListCustomClassesPaged() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + ListCustomClassesRequest request = + ListCustomClassesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListCustomClassesResponse response = + adaptationClient.listCustomClassesCallable().call(request); + for (CustomClass element : response.getCustomClassesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END speech_v1_generated_adaptationclient_listcustomclasses_paged_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClasses.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClasses.java new file mode 100644 index 000000000000..09c326f4d220 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClasses.java @@ -0,0 +1,50 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_listcustomclasses_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.ListCustomClassesRequest; +import com.google.cloud.speech.v1.LocationName; + +public class SyncListCustomClasses { + + public static void main(String[] args) throws Exception { + syncListCustomClasses(); + } + + public static void syncListCustomClasses() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + ListCustomClassesRequest request = + ListCustomClassesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (CustomClass element : adaptationClient.listCustomClasses(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1_generated_adaptationclient_listcustomclasses_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java new file mode 100644 index 000000000000..5289bee23bb5 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_listcustomclasses_locationname_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.LocationName; + +public class SyncListCustomClassesLocationname { + + public static void main(String[] args) throws Exception { + syncListCustomClassesLocationname(); + } + + public static void syncListCustomClassesLocationname() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1_generated_adaptationclient_listcustomclasses_locationname_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java new file mode 100644 index 000000000000..42bba433c3dc --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_listcustomclasses_string_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.LocationName; + +public class SyncListCustomClassesString { + + public static void main(String[] args) throws Exception { + syncListCustomClassesString(); + } + + public static void syncListCustomClassesString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1_generated_adaptationclient_listcustomclasses_string_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSet.java new file mode 100644 index 000000000000..fe7003398fac --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSet.java @@ -0,0 +1,54 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_listphraseset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.ListPhraseSetRequest; +import com.google.cloud.speech.v1.LocationName; +import com.google.cloud.speech.v1.PhraseSet; + +public class AsyncListPhraseSet { + + public static void main(String[] args) throws Exception { + asyncListPhraseSet(); + } + + public static void asyncListPhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + ListPhraseSetRequest request = + ListPhraseSetRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + adaptationClient.listPhraseSetPagedCallable().futureCall(request); + // Do something. + for (PhraseSet element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1_generated_adaptationclient_listphraseset_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java new file mode 100644 index 000000000000..e9b49a546e26 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java @@ -0,0 +1,61 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_listphraseset_paged_async] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.ListPhraseSetRequest; +import com.google.cloud.speech.v1.ListPhraseSetResponse; +import com.google.cloud.speech.v1.LocationName; +import com.google.cloud.speech.v1.PhraseSet; +import com.google.common.base.Strings; + +public class AsyncListPhraseSetPaged { + + public static void main(String[] args) throws Exception { + asyncListPhraseSetPaged(); + } + + public static void asyncListPhraseSetPaged() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + ListPhraseSetRequest request = + ListPhraseSetRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListPhraseSetResponse response = adaptationClient.listPhraseSetCallable().call(request); + for (PhraseSet element : response.getPhraseSetsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END speech_v1_generated_adaptationclient_listphraseset_paged_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSet.java new file mode 100644 index 000000000000..aaac2ba57d8b --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSet.java @@ -0,0 +1,50 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_listphraseset_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.ListPhraseSetRequest; +import com.google.cloud.speech.v1.LocationName; +import com.google.cloud.speech.v1.PhraseSet; + +public class SyncListPhraseSet { + + public static void main(String[] args) throws Exception { + syncListPhraseSet(); + } + + public static void syncListPhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + ListPhraseSetRequest request = + ListPhraseSetRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (PhraseSet element : adaptationClient.listPhraseSet(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1_generated_adaptationclient_listphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java new file mode 100644 index 000000000000..9948db0c2fa5 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_listphraseset_locationname_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.LocationName; +import com.google.cloud.speech.v1.PhraseSet; + +public class SyncListPhraseSetLocationname { + + public static void main(String[] args) throws Exception { + syncListPhraseSetLocationname(); + } + + public static void syncListPhraseSetLocationname() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1_generated_adaptationclient_listphraseset_locationname_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetString.java new file mode 100644 index 000000000000..abfbf98740be --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetString.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_listphraseset_string_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.LocationName; +import com.google.cloud.speech.v1.PhraseSet; + +public class SyncListPhraseSetString { + + public static void main(String[] args) throws Exception { + syncListPhraseSetString(); + } + + public static void syncListPhraseSetString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1_generated_adaptationclient_listphraseset_string_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java new file mode 100644 index 000000000000..5c89002514c1 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_updatecustomclass_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.UpdateCustomClassRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateCustomClass { + + public static void main(String[] args) throws Exception { + asyncUpdateCustomClass(); + } + + public static void asyncUpdateCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + UpdateCustomClassRequest request = + UpdateCustomClassRequest.newBuilder() + .setCustomClass(CustomClass.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + adaptationClient.updateCustomClassCallable().futureCall(request); + // Do something. + CustomClass response = future.get(); + } + } +} +// [END speech_v1_generated_adaptationclient_updatecustomclass_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java new file mode 100644 index 000000000000..a1535b85a5f7 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java @@ -0,0 +1,47 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_updatecustomclass_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.cloud.speech.v1.UpdateCustomClassRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCustomClass { + + public static void main(String[] args) throws Exception { + syncUpdateCustomClass(); + } + + public static void syncUpdateCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + UpdateCustomClassRequest request = + UpdateCustomClassRequest.newBuilder() + .setCustomClass(CustomClass.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + CustomClass response = adaptationClient.updateCustomClass(request); + } + } +} +// [END speech_v1_generated_adaptationclient_updatecustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java new file mode 100644 index 000000000000..faa4757595d1 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_updatecustomclass_customclassfieldmask_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.CustomClass; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCustomClassCustomclassFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateCustomClassCustomclassFieldmask(); + } + + public static void syncUpdateCustomClassCustomclassFieldmask() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CustomClass customClass = CustomClass.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + CustomClass response = adaptationClient.updateCustomClass(customClass, updateMask); + } + } +} +// [END speech_v1_generated_adaptationclient_updatecustomclass_customclassfieldmask_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java new file mode 100644 index 000000000000..1c8c11ab45e9 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java @@ -0,0 +1,50 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_updatephraseset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.PhraseSet; +import com.google.cloud.speech.v1.UpdatePhraseSetRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdatePhraseSet { + + public static void main(String[] args) throws Exception { + asyncUpdatePhraseSet(); + } + + public static void asyncUpdatePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + UpdatePhraseSetRequest request = + UpdatePhraseSetRequest.newBuilder() + .setPhraseSet(PhraseSet.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = adaptationClient.updatePhraseSetCallable().futureCall(request); + // Do something. + PhraseSet response = future.get(); + } + } +} +// [END speech_v1_generated_adaptationclient_updatephraseset_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java new file mode 100644 index 000000000000..5a7c4c3357cd --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java @@ -0,0 +1,47 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_updatephraseset_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.PhraseSet; +import com.google.cloud.speech.v1.UpdatePhraseSetRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdatePhraseSet { + + public static void main(String[] args) throws Exception { + syncUpdatePhraseSet(); + } + + public static void syncUpdatePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + UpdatePhraseSetRequest request = + UpdatePhraseSetRequest.newBuilder() + .setPhraseSet(PhraseSet.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + PhraseSet response = adaptationClient.updatePhraseSet(request); + } + } +} +// [END speech_v1_generated_adaptationclient_updatephraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java new file mode 100644 index 000000000000..939e3c359d0f --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationclient_updatephraseset_phrasesetfieldmask_sync] +import com.google.cloud.speech.v1.AdaptationClient; +import com.google.cloud.speech.v1.PhraseSet; +import com.google.protobuf.FieldMask; + +public class SyncUpdatePhraseSetPhrasesetFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdatePhraseSetPhrasesetFieldmask(); + } + + public static void syncUpdatePhraseSetPhrasesetFieldmask() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + PhraseSet response = adaptationClient.updatePhraseSet(phraseSet, updateMask); + } + } +} +// [END speech_v1_generated_adaptationclient_updatephraseset_phrasesetfieldmask_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java new file mode 100644 index 000000000000..af61f9983d36 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java @@ -0,0 +1,45 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_adaptationsettings_createphraseset_sync] +import com.google.cloud.speech.v1.AdaptationSettings; +import java.time.Duration; + +public class SyncCreatePhraseSet { + + public static void main(String[] args) throws Exception { + syncCreatePhraseSet(); + } + + public static void syncCreatePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AdaptationSettings.Builder adaptationSettingsBuilder = AdaptationSettings.newBuilder(); + adaptationSettingsBuilder + .createPhraseSetSettings() + .setRetrySettings( + adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AdaptationSettings adaptationSettings = adaptationSettingsBuilder.build(); + } +} +// [END speech_v1_generated_adaptationsettings_createphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..4d001abc7c00 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_speechclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.speech.v1.SpeechClient; +import com.google.cloud.speech.v1.SpeechSettings; +import com.google.cloud.speech.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SpeechSettings speechSettings = + SpeechSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SpeechClient speechClient = SpeechClient.create(speechSettings); + } +} +// [END speech_v1_generated_speechclient_create_setcredentialsprovider_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider1.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..5057116dfad9 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,43 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_speechclient_create_setcredentialsprovider1_sync] +import com.google.cloud.speech.v1.SpeechClient; +import com.google.cloud.speech.v1.SpeechSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SpeechSettings speechSettings = + SpeechSettings.newBuilder() + .setTransportChannelProvider( + SpeechSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + SpeechClient speechClient = SpeechClient.create(speechSettings); + } +} +// [END speech_v1_generated_speechclient_create_setcredentialsprovider1_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetEndpoint.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..dffc532af6ee --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_speechclient_create_setendpoint_sync] +import com.google.cloud.speech.v1.SpeechClient; +import com.google.cloud.speech.v1.SpeechSettings; +import com.google.cloud.speech.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build(); + SpeechClient speechClient = SpeechClient.create(speechSettings); + } +} +// [END speech_v1_generated_speechclient_create_setendpoint_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java new file mode 100644 index 000000000000..4674a8bf43b4 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java @@ -0,0 +1,53 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_speechclient_longrunningrecognize_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1.RecognitionAudio; +import com.google.cloud.speech.v1.RecognitionConfig; +import com.google.cloud.speech.v1.SpeechClient; +import com.google.cloud.speech.v1.TranscriptOutputConfig; +import com.google.longrunning.Operation; + +public class AsyncLongRunningRecognize { + + public static void main(String[] args) throws Exception { + asyncLongRunningRecognize(); + } + + public static void asyncLongRunningRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + LongRunningRecognizeRequest request = + LongRunningRecognizeRequest.newBuilder() + .setConfig(RecognitionConfig.newBuilder().build()) + .setAudio(RecognitionAudio.newBuilder().build()) + .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) + .build(); + ApiFuture future = speechClient.longRunningRecognizeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END speech_v1_generated_speechclient_longrunningrecognize_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java new file mode 100644 index 000000000000..e68f8d9dec30 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java @@ -0,0 +1,55 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_speechclient_longrunningrecognize_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1.RecognitionAudio; +import com.google.cloud.speech.v1.RecognitionConfig; +import com.google.cloud.speech.v1.SpeechClient; +import com.google.cloud.speech.v1.TranscriptOutputConfig; + +public class AsyncLongRunningRecognizeLRO { + + public static void main(String[] args) throws Exception { + asyncLongRunningRecognizeLRO(); + } + + public static void asyncLongRunningRecognizeLRO() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + LongRunningRecognizeRequest request = + LongRunningRecognizeRequest.newBuilder() + .setConfig(RecognitionConfig.newBuilder().build()) + .setAudio(RecognitionAudio.newBuilder().build()) + .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) + .build(); + OperationFuture future = + speechClient.longRunningRecognizeOperationCallable().futureCall(request); + // Do something. + LongRunningRecognizeResponse response = future.get(); + } + } +} +// [END speech_v1_generated_speechclient_longrunningrecognize_lro_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java new file mode 100644 index 000000000000..17f2879d8711 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java @@ -0,0 +1,50 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_speechclient_longrunningrecognize_sync] +import com.google.cloud.speech.v1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1.RecognitionAudio; +import com.google.cloud.speech.v1.RecognitionConfig; +import com.google.cloud.speech.v1.SpeechClient; +import com.google.cloud.speech.v1.TranscriptOutputConfig; + +public class SyncLongRunningRecognize { + + public static void main(String[] args) throws Exception { + syncLongRunningRecognize(); + } + + public static void syncLongRunningRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + LongRunningRecognizeRequest request = + LongRunningRecognizeRequest.newBuilder() + .setConfig(RecognitionConfig.newBuilder().build()) + .setAudio(RecognitionAudio.newBuilder().build()) + .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) + .build(); + LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get(); + } + } +} +// [END speech_v1_generated_speechclient_longrunningrecognize_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java new file mode 100644 index 000000000000..04feacdf3446 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java @@ -0,0 +1,45 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_speechclient_longrunningrecognize_recognitionconfigrecognitionaudio_sync] +import com.google.cloud.speech.v1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1.RecognitionAudio; +import com.google.cloud.speech.v1.RecognitionConfig; +import com.google.cloud.speech.v1.SpeechClient; + +public class SyncLongRunningRecognizeRecognitionconfigRecognitionaudio { + + public static void main(String[] args) throws Exception { + syncLongRunningRecognizeRecognitionconfigRecognitionaudio(); + } + + public static void syncLongRunningRecognizeRecognitionconfigRecognitionaudio() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + LongRunningRecognizeResponse response = + speechClient.longRunningRecognizeAsync(config, audio).get(); + } + } +} +// [END speech_v1_generated_speechclient_longrunningrecognize_recognitionconfigrecognitionaudio_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/AsyncRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/AsyncRecognize.java new file mode 100644 index 000000000000..b905afd8134c --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/AsyncRecognize.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_speechclient_recognize_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1.RecognitionAudio; +import com.google.cloud.speech.v1.RecognitionConfig; +import com.google.cloud.speech.v1.RecognizeRequest; +import com.google.cloud.speech.v1.RecognizeResponse; +import com.google.cloud.speech.v1.SpeechClient; + +public class AsyncRecognize { + + public static void main(String[] args) throws Exception { + asyncRecognize(); + } + + public static void asyncRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + RecognizeRequest request = + RecognizeRequest.newBuilder() + .setConfig(RecognitionConfig.newBuilder().build()) + .setAudio(RecognitionAudio.newBuilder().build()) + .build(); + ApiFuture future = speechClient.recognizeCallable().futureCall(request); + // Do something. + RecognizeResponse response = future.get(); + } + } +} +// [END speech_v1_generated_speechclient_recognize_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognize.java new file mode 100644 index 000000000000..77ea09fdcb29 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognize.java @@ -0,0 +1,48 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_speechclient_recognize_sync] +import com.google.cloud.speech.v1.RecognitionAudio; +import com.google.cloud.speech.v1.RecognitionConfig; +import com.google.cloud.speech.v1.RecognizeRequest; +import com.google.cloud.speech.v1.RecognizeResponse; +import com.google.cloud.speech.v1.SpeechClient; + +public class SyncRecognize { + + public static void main(String[] args) throws Exception { + syncRecognize(); + } + + public static void syncRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + RecognizeRequest request = + RecognizeRequest.newBuilder() + .setConfig(RecognitionConfig.newBuilder().build()) + .setAudio(RecognitionAudio.newBuilder().build()) + .build(); + RecognizeResponse response = speechClient.recognize(request); + } + } +} +// [END speech_v1_generated_speechclient_recognize_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java new file mode 100644 index 000000000000..886ab8017225 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_speechclient_recognize_recognitionconfigrecognitionaudio_sync] +import com.google.cloud.speech.v1.RecognitionAudio; +import com.google.cloud.speech.v1.RecognitionConfig; +import com.google.cloud.speech.v1.RecognizeResponse; +import com.google.cloud.speech.v1.SpeechClient; + +public class SyncRecognizeRecognitionconfigRecognitionaudio { + + public static void main(String[] args) throws Exception { + syncRecognizeRecognitionconfigRecognitionaudio(); + } + + public static void syncRecognizeRecognitionconfigRecognitionaudio() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + RecognizeResponse response = speechClient.recognize(config, audio); + } + } +} +// [END speech_v1_generated_speechclient_recognize_recognitionconfigrecognitionaudio_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/streamingrecognize/AsyncStreamingRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/streamingrecognize/AsyncStreamingRecognize.java new file mode 100644 index 000000000000..99388791a7a3 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/streamingrecognize/AsyncStreamingRecognize.java @@ -0,0 +1,48 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_speechclient_streamingrecognize_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.speech.v1.SpeechClient; +import com.google.cloud.speech.v1.StreamingRecognizeRequest; +import com.google.cloud.speech.v1.StreamingRecognizeResponse; + +public class AsyncStreamingRecognize { + + public static void main(String[] args) throws Exception { + asyncStreamingRecognize(); + } + + public static void asyncStreamingRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + BidiStream bidiStream = + speechClient.streamingRecognizeCallable().call(); + StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); + bidiStream.send(request); + for (StreamingRecognizeResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END speech_v1_generated_speechclient_streamingrecognize_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechsettings/recognize/SyncRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechsettings/recognize/SyncRecognize.java new file mode 100644 index 000000000000..6c7ac4c9601e --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechsettings/recognize/SyncRecognize.java @@ -0,0 +1,45 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.samples; + +// [START speech_v1_generated_speechsettings_recognize_sync] +import com.google.cloud.speech.v1.SpeechSettings; +import java.time.Duration; + +public class SyncRecognize { + + public static void main(String[] args) throws Exception { + syncRecognize(); + } + + public static void syncRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder(); + speechSettingsBuilder + .recognizeSettings() + .setRetrySettings( + speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SpeechSettings speechSettings = speechSettingsBuilder.build(); + } +} +// [END speech_v1_generated_speechsettings_recognize_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java new file mode 100644 index 000000000000..ba671b79bc53 --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java @@ -0,0 +1,45 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub.samples; + +// [START speech_v1_generated_adaptationstubsettings_createphraseset_sync] +import com.google.cloud.speech.v1.stub.AdaptationStubSettings; +import java.time.Duration; + +public class SyncCreatePhraseSet { + + public static void main(String[] args) throws Exception { + syncCreatePhraseSet(); + } + + public static void syncCreatePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AdaptationStubSettings.Builder adaptationSettingsBuilder = AdaptationStubSettings.newBuilder(); + adaptationSettingsBuilder + .createPhraseSetSettings() + .setRetrySettings( + adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AdaptationStubSettings adaptationSettings = adaptationSettingsBuilder.build(); + } +} +// [END speech_v1_generated_adaptationstubsettings_createphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/speechstubsettings/recognize/SyncRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/speechstubsettings/recognize/SyncRecognize.java new file mode 100644 index 000000000000..af6790d8c8bf --- /dev/null +++ b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/speechstubsettings/recognize/SyncRecognize.java @@ -0,0 +1,45 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1.stub.samples; + +// [START speech_v1_generated_speechstubsettings_recognize_sync] +import com.google.cloud.speech.v1.stub.SpeechStubSettings; +import java.time.Duration; + +public class SyncRecognize { + + public static void main(String[] args) throws Exception { + syncRecognize(); + } + + public static void syncRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SpeechStubSettings.Builder speechSettingsBuilder = SpeechStubSettings.newBuilder(); + speechSettingsBuilder + .recognizeSettings() + .setRetrySettings( + speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SpeechStubSettings speechSettings = speechSettingsBuilder.build(); + } +} +// [END speech_v1_generated_speechstubsettings_recognize_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java new file mode 100644 index 000000000000..99136ef2cd56 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java @@ -0,0 +1,1676 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.stub.AdaptationStub; +import com.google.cloud.speech.v1p1beta1.stub.AdaptationStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service that implements Google Cloud Speech Adaptation API. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+ *   String phraseSetId = "phraseSetId959902180";
+ *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the AdaptationClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of AdaptationSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AdaptationSettings adaptationSettings =
+ *     AdaptationSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AdaptationSettings adaptationSettings =
+ *     AdaptationSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AdaptationSettings adaptationSettings =
+ *     AdaptationSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             AdaptationSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class AdaptationClient implements BackgroundResource { + private final AdaptationSettings settings; + private final AdaptationStub stub; + + /** Constructs an instance of AdaptationClient with default settings. */ + public static final AdaptationClient create() throws IOException { + return create(AdaptationSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AdaptationClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final AdaptationClient create(AdaptationSettings settings) throws IOException { + return new AdaptationClient(settings); + } + + /** + * Constructs an instance of AdaptationClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(AdaptationSettings). + */ + public static final AdaptationClient create(AdaptationStub stub) { + return new AdaptationClient(stub); + } + + /** + * Constructs an instance of AdaptationClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected AdaptationClient(AdaptationSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AdaptationStubSettings) settings.getStubSettings()).createStub(); + } + + protected AdaptationClient(AdaptationStub stub) { + this.settings = null; + this.stub = stub; + } + + public final AdaptationSettings getSettings() { + return settings; + } + + public AdaptationStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. + * The items in the PhraseSet are favored by the recognition model when you send a call that + * includes the PhraseSet. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+   *   String phraseSetId = "phraseSetId959902180";
+   *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this phrase set will be created. Format: + *

`projects/{project}/locations/{location}/phraseSets` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @param phraseSet Required. The phrase set to create. + * @param phraseSetId Required. The ID to use for the phrase set, which will become the final + * component of the phrase set's resource name. + *

This value should restrict to letters, numbers, and hyphens, with the first character a + * letter, the last a letter or a number, and be 4-63 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet createPhraseSet( + LocationName parent, PhraseSet phraseSet, String phraseSetId) { + CreatePhraseSetRequest request = + CreatePhraseSetRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setPhraseSet(phraseSet) + .setPhraseSetId(phraseSetId) + .build(); + return createPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. + * The items in the PhraseSet are favored by the recognition model when you send a call that + * includes the PhraseSet. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+   *   String phraseSetId = "phraseSetId959902180";
+   *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this phrase set will be created. Format: + *

`projects/{project}/locations/{location}/phraseSets` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @param phraseSet Required. The phrase set to create. + * @param phraseSetId Required. The ID to use for the phrase set, which will become the final + * component of the phrase set's resource name. + *

This value should restrict to letters, numbers, and hyphens, with the first character a + * letter, the last a letter or a number, and be 4-63 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet createPhraseSet(String parent, PhraseSet phraseSet, String phraseSetId) { + CreatePhraseSetRequest request = + CreatePhraseSetRequest.newBuilder() + .setParent(parent) + .setPhraseSet(phraseSet) + .setPhraseSetId(phraseSetId) + .build(); + return createPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. + * The items in the PhraseSet are favored by the recognition model when you send a call that + * includes the PhraseSet. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CreatePhraseSetRequest request =
+   *       CreatePhraseSetRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPhraseSetId("phraseSetId959902180")
+   *           .setPhraseSet(PhraseSet.newBuilder().build())
+   *           .build();
+   *   PhraseSet response = adaptationClient.createPhraseSet(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet createPhraseSet(CreatePhraseSetRequest request) { + return createPhraseSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. + * The items in the PhraseSet are favored by the recognition model when you send a call that + * includes the PhraseSet. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CreatePhraseSetRequest request =
+   *       CreatePhraseSetRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPhraseSetId("phraseSetId959902180")
+   *           .setPhraseSet(PhraseSet.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = adaptationClient.createPhraseSetCallable().futureCall(request);
+   *   // Do something.
+   *   PhraseSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createPhraseSetCallable() { + return stub.createPhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
+   *   PhraseSet response = adaptationClient.getPhraseSet(name);
+   * }
+   * }
+ * + * @param name Required. The name of the phrase set to retrieve. Format: + *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet getPhraseSet(PhraseSetName name) { + GetPhraseSetRequest request = + GetPhraseSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
+   *   PhraseSet response = adaptationClient.getPhraseSet(name);
+   * }
+   * }
+ * + * @param name Required. The name of the phrase set to retrieve. Format: + *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet getPhraseSet(String name) { + GetPhraseSetRequest request = GetPhraseSetRequest.newBuilder().setName(name).build(); + return getPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   GetPhraseSetRequest request =
+   *       GetPhraseSetRequest.newBuilder()
+   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .build();
+   *   PhraseSet response = adaptationClient.getPhraseSet(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet getPhraseSet(GetPhraseSetRequest request) { + return getPhraseSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   GetPhraseSetRequest request =
+   *       GetPhraseSetRequest.newBuilder()
+   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .build();
+   *   ApiFuture future = adaptationClient.getPhraseSetCallable().futureCall(request);
+   *   // Do something.
+   *   PhraseSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getPhraseSetCallable() { + return stub.getPhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of phrase set. Format: + *

`projects/{project}/locations/{location}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPhraseSetPagedResponse listPhraseSet(LocationName parent) { + ListPhraseSetRequest request = + ListPhraseSetRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of phrase set. Format: + *

`projects/{project}/locations/{location}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPhraseSetPagedResponse listPhraseSet(String parent) { + ListPhraseSetRequest request = ListPhraseSetRequest.newBuilder().setParent(parent).build(); + return listPhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListPhraseSetRequest request =
+   *       ListPhraseSetRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (PhraseSet element : adaptationClient.listPhraseSet(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListPhraseSetPagedResponse listPhraseSet(ListPhraseSetRequest request) { + return listPhraseSetPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListPhraseSetRequest request =
+   *       ListPhraseSetRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       adaptationClient.listPhraseSetPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (PhraseSet element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listPhraseSetPagedCallable() { + return stub.listPhraseSetPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List phrase sets. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListPhraseSetRequest request =
+   *       ListPhraseSetRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListPhraseSetResponse response = adaptationClient.listPhraseSetCallable().call(request);
+   *     for (PhraseSet element : response.getPhraseSetsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listPhraseSetCallable() { + return stub.listPhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   PhraseSet response = adaptationClient.updatePhraseSet(phraseSet, updateMask);
+   * }
+   * }
+ * + * @param phraseSet Required. The phrase set to update. + *

The phrase set's `name` field is used to identify the set to be updated. Format: + *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @param updateMask The list of fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet updatePhraseSet(PhraseSet phraseSet, FieldMask updateMask) { + UpdatePhraseSetRequest request = + UpdatePhraseSetRequest.newBuilder() + .setPhraseSet(phraseSet) + .setUpdateMask(updateMask) + .build(); + return updatePhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   UpdatePhraseSetRequest request =
+   *       UpdatePhraseSetRequest.newBuilder()
+   *           .setPhraseSet(PhraseSet.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   PhraseSet response = adaptationClient.updatePhraseSet(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final PhraseSet updatePhraseSet(UpdatePhraseSetRequest request) { + return updatePhraseSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   UpdatePhraseSetRequest request =
+   *       UpdatePhraseSetRequest.newBuilder()
+   *           .setPhraseSet(PhraseSet.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = adaptationClient.updatePhraseSetCallable().futureCall(request);
+   *   // Do something.
+   *   PhraseSet response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updatePhraseSetCallable() { + return stub.updatePhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
+   *   adaptationClient.deletePhraseSet(name);
+   * }
+   * }
+ * + * @param name Required. The name of the phrase set to delete. Format: + *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePhraseSet(PhraseSetName name) { + DeletePhraseSetRequest request = + DeletePhraseSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deletePhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
+   *   adaptationClient.deletePhraseSet(name);
+   * }
+   * }
+ * + * @param name Required. The name of the phrase set to delete. Format: + *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePhraseSet(String name) { + DeletePhraseSetRequest request = DeletePhraseSetRequest.newBuilder().setName(name).build(); + deletePhraseSet(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   DeletePhraseSetRequest request =
+   *       DeletePhraseSetRequest.newBuilder()
+   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .build();
+   *   adaptationClient.deletePhraseSet(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deletePhraseSet(DeletePhraseSetRequest request) { + deletePhraseSetCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a phrase set. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   DeletePhraseSetRequest request =
+   *       DeletePhraseSetRequest.newBuilder()
+   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+   *           .build();
+   *   ApiFuture future = adaptationClient.deletePhraseSetCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deletePhraseSetCallable() { + return stub.deletePhraseSetCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   CustomClass customClass = CustomClass.newBuilder().build();
+   *   String customClassId = "customClassId1871032322";
+   *   CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this custom class will be created. Format: + *

`projects/{project}/locations/{location}/customClasses` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @param customClass Required. The custom class to create. + * @param customClassId Required. The ID to use for the custom class, which will become the final + * component of the custom class' resource name. + *

This value should restrict to letters, numbers, and hyphens, with the first character a + * letter, the last a letter or a number, and be 4-63 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass createCustomClass( + LocationName parent, CustomClass customClass, String customClassId) { + CreateCustomClassRequest request = + CreateCustomClassRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setCustomClass(customClass) + .setCustomClassId(customClassId) + .build(); + return createCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   CustomClass customClass = CustomClass.newBuilder().build();
+   *   String customClassId = "customClassId1871032322";
+   *   CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId);
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this custom class will be created. Format: + *

`projects/{project}/locations/{location}/customClasses` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @param customClass Required. The custom class to create. + * @param customClassId Required. The ID to use for the custom class, which will become the final + * component of the custom class' resource name. + *

This value should restrict to letters, numbers, and hyphens, with the first character a + * letter, the last a letter or a number, and be 4-63 characters. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass createCustomClass( + String parent, CustomClass customClass, String customClassId) { + CreateCustomClassRequest request = + CreateCustomClassRequest.newBuilder() + .setParent(parent) + .setCustomClass(customClass) + .setCustomClassId(customClassId) + .build(); + return createCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CreateCustomClassRequest request =
+   *       CreateCustomClassRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setCustomClassId("customClassId1871032322")
+   *           .setCustomClass(CustomClass.newBuilder().build())
+   *           .build();
+   *   CustomClass response = adaptationClient.createCustomClass(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass createCustomClass(CreateCustomClassRequest request) { + return createCustomClassCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Create a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CreateCustomClassRequest request =
+   *       CreateCustomClassRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setCustomClassId("customClassId1871032322")
+   *           .setCustomClass(CustomClass.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       adaptationClient.createCustomClassCallable().futureCall(request);
+   *   // Do something.
+   *   CustomClass response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createCustomClassCallable() { + return stub.createCustomClassCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
+   *   CustomClass response = adaptationClient.getCustomClass(name);
+   * }
+   * }
+ * + * @param name Required. The name of the custom class to retrieve. Format: + *

`projects/{project}/locations/{location}/customClasses/{custom_class}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass getCustomClass(CustomClassName name) { + GetCustomClassRequest request = + GetCustomClassRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
+   *   CustomClass response = adaptationClient.getCustomClass(name);
+   * }
+   * }
+ * + * @param name Required. The name of the custom class to retrieve. Format: + *

`projects/{project}/locations/{location}/customClasses/{custom_class}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass getCustomClass(String name) { + GetCustomClassRequest request = GetCustomClassRequest.newBuilder().setName(name).build(); + return getCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   GetCustomClassRequest request =
+   *       GetCustomClassRequest.newBuilder()
+   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .build();
+   *   CustomClass response = adaptationClient.getCustomClass(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass getCustomClass(GetCustomClassRequest request) { + return getCustomClassCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   GetCustomClassRequest request =
+   *       GetCustomClassRequest.newBuilder()
+   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .build();
+   *   ApiFuture future = adaptationClient.getCustomClassCallable().futureCall(request);
+   *   // Do something.
+   *   CustomClass response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCustomClassCallable() { + return stub.getCustomClassCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of custom classes. Format: + *

`projects/{project}/locations/{location}/customClasses` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomClassesPagedResponse listCustomClasses(LocationName parent) { + ListCustomClassesRequest request = + ListCustomClassesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listCustomClasses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent, which owns this collection of custom classes. Format: + *

`projects/{project}/locations/{location}/customClasses` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomClassesPagedResponse listCustomClasses(String parent) { + ListCustomClassesRequest request = + ListCustomClassesRequest.newBuilder().setParent(parent).build(); + return listCustomClasses(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListCustomClassesRequest request =
+   *       ListCustomClassesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (CustomClass element : adaptationClient.listCustomClasses(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListCustomClassesPagedResponse listCustomClasses(ListCustomClassesRequest request) { + return listCustomClassesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListCustomClassesRequest request =
+   *       ListCustomClassesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       adaptationClient.listCustomClassesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (CustomClass element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCustomClassesPagedCallable() { + return stub.listCustomClassesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List custom classes. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   ListCustomClassesRequest request =
+   *       ListCustomClassesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListCustomClassesResponse response =
+   *         adaptationClient.listCustomClassesCallable().call(request);
+   *     for (CustomClass element : response.getCustomClassesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listCustomClassesCallable() { + return stub.listCustomClassesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CustomClass customClass = CustomClass.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   CustomClass response = adaptationClient.updateCustomClass(customClass, updateMask);
+   * }
+   * }
+ * + * @param customClass Required. The custom class to update. + *

The custom class's `name` field is used to identify the custom class to be updated. + * Format: + *

`projects/{project}/locations/{location}/customClasses/{custom_class}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @param updateMask The list of fields to be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass updateCustomClass(CustomClass customClass, FieldMask updateMask) { + UpdateCustomClassRequest request = + UpdateCustomClassRequest.newBuilder() + .setCustomClass(customClass) + .setUpdateMask(updateMask) + .build(); + return updateCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   UpdateCustomClassRequest request =
+   *       UpdateCustomClassRequest.newBuilder()
+   *           .setCustomClass(CustomClass.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   CustomClass response = adaptationClient.updateCustomClass(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CustomClass updateCustomClass(UpdateCustomClassRequest request) { + return updateCustomClassCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   UpdateCustomClassRequest request =
+   *       UpdateCustomClassRequest.newBuilder()
+   *           .setCustomClass(CustomClass.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       adaptationClient.updateCustomClassCallable().futureCall(request);
+   *   // Do something.
+   *   CustomClass response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCustomClassCallable() { + return stub.updateCustomClassCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
+   *   adaptationClient.deleteCustomClass(name);
+   * }
+   * }
+ * + * @param name Required. The name of the custom class to delete. Format: + *

`projects/{project}/locations/{location}/customClasses/{custom_class}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCustomClass(CustomClassName name) { + DeleteCustomClassRequest request = + DeleteCustomClassRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
+   *   adaptationClient.deleteCustomClass(name);
+   * }
+   * }
+ * + * @param name Required. The name of the custom class to delete. Format: + *

`projects/{project}/locations/{location}/customClasses/{custom_class}` + *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` + * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` + * location. To specify a region, use a [regional + * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or + * `eu` location value. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCustomClass(String name) { + DeleteCustomClassRequest request = DeleteCustomClassRequest.newBuilder().setName(name).build(); + deleteCustomClass(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   DeleteCustomClassRequest request =
+   *       DeleteCustomClassRequest.newBuilder()
+   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .build();
+   *   adaptationClient.deleteCustomClass(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteCustomClass(DeleteCustomClassRequest request) { + deleteCustomClassCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Delete a custom class. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+   *   DeleteCustomClassRequest request =
+   *       DeleteCustomClassRequest.newBuilder()
+   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+   *           .build();
+   *   ApiFuture future = adaptationClient.deleteCustomClassCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteCustomClassCallable() { + return stub.deleteCustomClassCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListPhraseSetPagedResponse + extends AbstractPagedListResponse< + ListPhraseSetRequest, + ListPhraseSetResponse, + PhraseSet, + ListPhraseSetPage, + ListPhraseSetFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListPhraseSetPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListPhraseSetPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListPhraseSetPagedResponse(ListPhraseSetPage page) { + super(page, ListPhraseSetFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListPhraseSetPage + extends AbstractPage< + ListPhraseSetRequest, ListPhraseSetResponse, PhraseSet, ListPhraseSetPage> { + + private ListPhraseSetPage( + PageContext context, + ListPhraseSetResponse response) { + super(context, response); + } + + private static ListPhraseSetPage createEmptyPage() { + return new ListPhraseSetPage(null, null); + } + + @Override + protected ListPhraseSetPage createPage( + PageContext context, + ListPhraseSetResponse response) { + return new ListPhraseSetPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListPhraseSetFixedSizeCollection + extends AbstractFixedSizeCollection< + ListPhraseSetRequest, + ListPhraseSetResponse, + PhraseSet, + ListPhraseSetPage, + ListPhraseSetFixedSizeCollection> { + + private ListPhraseSetFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListPhraseSetFixedSizeCollection createEmptyCollection() { + return new ListPhraseSetFixedSizeCollection(null, 0); + } + + @Override + protected ListPhraseSetFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListPhraseSetFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListCustomClassesPagedResponse + extends AbstractPagedListResponse< + ListCustomClassesRequest, + ListCustomClassesResponse, + CustomClass, + ListCustomClassesPage, + ListCustomClassesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCustomClassesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListCustomClassesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListCustomClassesPagedResponse(ListCustomClassesPage page) { + super(page, ListCustomClassesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCustomClassesPage + extends AbstractPage< + ListCustomClassesRequest, ListCustomClassesResponse, CustomClass, ListCustomClassesPage> { + + private ListCustomClassesPage( + PageContext context, + ListCustomClassesResponse response) { + super(context, response); + } + + private static ListCustomClassesPage createEmptyPage() { + return new ListCustomClassesPage(null, null); + } + + @Override + protected ListCustomClassesPage createPage( + PageContext context, + ListCustomClassesResponse response) { + return new ListCustomClassesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCustomClassesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCustomClassesRequest, + ListCustomClassesResponse, + CustomClass, + ListCustomClassesPage, + ListCustomClassesFixedSizeCollection> { + + private ListCustomClassesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCustomClassesFixedSizeCollection createEmptyCollection() { + return new ListCustomClassesFixedSizeCollection(null, 0); + } + + @Override + protected ListCustomClassesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCustomClassesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java new file mode 100644 index 000000000000..2698cc554881 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java @@ -0,0 +1,306 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.speech.v1p1beta1.stub.AdaptationStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AdaptationClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (speech.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createPhraseSet to 30 seconds: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AdaptationSettings.Builder adaptationSettingsBuilder = AdaptationSettings.newBuilder();
+ * adaptationSettingsBuilder
+ *     .createPhraseSetSettings()
+ *     .setRetrySettings(
+ *         adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AdaptationSettings adaptationSettings = adaptationSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AdaptationSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createPhraseSet. */ + public UnaryCallSettings createPhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).createPhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to getPhraseSet. */ + public UnaryCallSettings getPhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).getPhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to listPhraseSet. */ + public PagedCallSettings + listPhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).listPhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to updatePhraseSet. */ + public UnaryCallSettings updatePhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).updatePhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to deletePhraseSet. */ + public UnaryCallSettings deletePhraseSetSettings() { + return ((AdaptationStubSettings) getStubSettings()).deletePhraseSetSettings(); + } + + /** Returns the object with the settings used for calls to createCustomClass. */ + public UnaryCallSettings createCustomClassSettings() { + return ((AdaptationStubSettings) getStubSettings()).createCustomClassSettings(); + } + + /** Returns the object with the settings used for calls to getCustomClass. */ + public UnaryCallSettings getCustomClassSettings() { + return ((AdaptationStubSettings) getStubSettings()).getCustomClassSettings(); + } + + /** Returns the object with the settings used for calls to listCustomClasses. */ + public PagedCallSettings< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings() { + return ((AdaptationStubSettings) getStubSettings()).listCustomClassesSettings(); + } + + /** Returns the object with the settings used for calls to updateCustomClass. */ + public UnaryCallSettings updateCustomClassSettings() { + return ((AdaptationStubSettings) getStubSettings()).updateCustomClassSettings(); + } + + /** Returns the object with the settings used for calls to deleteCustomClass. */ + public UnaryCallSettings deleteCustomClassSettings() { + return ((AdaptationStubSettings) getStubSettings()).deleteCustomClassSettings(); + } + + public static final AdaptationSettings create(AdaptationStubSettings stub) throws IOException { + return new AdaptationSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AdaptationStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AdaptationStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AdaptationStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AdaptationStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AdaptationStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return AdaptationStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AdaptationStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AdaptationStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AdaptationSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AdaptationSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AdaptationStubSettings.newBuilder(clientContext)); + } + + protected Builder(AdaptationSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AdaptationStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AdaptationStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(AdaptationStubSettings.newHttpJsonBuilder()); + } + + public AdaptationStubSettings.Builder getStubSettingsBuilder() { + return ((AdaptationStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createPhraseSet. */ + public UnaryCallSettings.Builder createPhraseSetSettings() { + return getStubSettingsBuilder().createPhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to getPhraseSet. */ + public UnaryCallSettings.Builder getPhraseSetSettings() { + return getStubSettingsBuilder().getPhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to listPhraseSet. */ + public PagedCallSettings.Builder< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + listPhraseSetSettings() { + return getStubSettingsBuilder().listPhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to updatePhraseSet. */ + public UnaryCallSettings.Builder updatePhraseSetSettings() { + return getStubSettingsBuilder().updatePhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to deletePhraseSet. */ + public UnaryCallSettings.Builder deletePhraseSetSettings() { + return getStubSettingsBuilder().deletePhraseSetSettings(); + } + + /** Returns the builder for the settings used for calls to createCustomClass. */ + public UnaryCallSettings.Builder + createCustomClassSettings() { + return getStubSettingsBuilder().createCustomClassSettings(); + } + + /** Returns the builder for the settings used for calls to getCustomClass. */ + public UnaryCallSettings.Builder getCustomClassSettings() { + return getStubSettingsBuilder().getCustomClassSettings(); + } + + /** Returns the builder for the settings used for calls to listCustomClasses. */ + public PagedCallSettings.Builder< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings() { + return getStubSettingsBuilder().listCustomClassesSettings(); + } + + /** Returns the builder for the settings used for calls to updateCustomClass. */ + public UnaryCallSettings.Builder + updateCustomClassSettings() { + return getStubSettingsBuilder().updateCustomClassSettings(); + } + + /** Returns the builder for the settings used for calls to deleteCustomClass. */ + public UnaryCallSettings.Builder deleteCustomClassSettings() { + return getStubSettingsBuilder().deleteCustomClassSettings(); + } + + @Override + public AdaptationSettings build() throws IOException { + return new AdaptationSettings(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java new file mode 100644 index 000000000000..ee1bf00d4884 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java @@ -0,0 +1,484 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.stub.SpeechStub; +import com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service that implements Google Cloud Speech API. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
+ *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
+ *   RecognizeResponse response = speechClient.recognize(config, audio);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the SpeechClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of SpeechSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SpeechSettings speechSettings =
+ *     SpeechSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SpeechClient speechClient = SpeechClient.create(speechSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SpeechClient speechClient = SpeechClient.create(speechSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SpeechSettings speechSettings =
+ *     SpeechSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             SpeechSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * SpeechClient speechClient = SpeechClient.create(speechSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SpeechClient implements BackgroundResource { + private final SpeechSettings settings; + private final SpeechStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of SpeechClient with default settings. */ + public static final SpeechClient create() throws IOException { + return create(SpeechSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SpeechClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final SpeechClient create(SpeechSettings settings) throws IOException { + return new SpeechClient(settings); + } + + /** + * Constructs an instance of SpeechClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(SpeechSettings). + */ + public static final SpeechClient create(SpeechStub stub) { + return new SpeechClient(stub); + } + + /** + * Constructs an instance of SpeechClient, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected SpeechClient(SpeechSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SpeechStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected SpeechClient(SpeechStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final SpeechSettings getSettings() { + return settings; + } + + public SpeechStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs synchronous speech recognition: receive results after all audio has been sent and + * processed. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
+   *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
+   *   RecognizeResponse response = speechClient.recognize(config, audio);
+   * }
+   * }
+ * + * @param config Required. Provides information to the recognizer that specifies how to process + * the request. + * @param audio Required. The audio data to be recognized. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RecognizeResponse recognize(RecognitionConfig config, RecognitionAudio audio) { + RecognizeRequest request = + RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); + return recognize(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs synchronous speech recognition: receive results after all audio has been sent and + * processed. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   RecognizeRequest request =
+   *       RecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .build();
+   *   RecognizeResponse response = speechClient.recognize(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RecognizeResponse recognize(RecognizeRequest request) { + return recognizeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs synchronous speech recognition: receive results after all audio has been sent and + * processed. + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   RecognizeRequest request =
+   *       RecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = speechClient.recognizeCallable().futureCall(request);
+   *   // Do something.
+   *   RecognizeResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable recognizeCallable() { + return stub.recognizeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. For more information on asynchronous speech + * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
+   *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
+   *   LongRunningRecognizeResponse response =
+   *       speechClient.longRunningRecognizeAsync(config, audio).get();
+   * }
+   * }
+ * + * @param config Required. Provides information to the recognizer that specifies how to process + * the request. + * @param audio Required. The audio data to be recognized. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio) { + LongRunningRecognizeRequest request = + LongRunningRecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); + return longRunningRecognizeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. For more information on asynchronous speech + * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   LongRunningRecognizeRequest request =
+   *       LongRunningRecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
+   *           .build();
+   *   LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + longRunningRecognizeAsync(LongRunningRecognizeRequest request) { + return longRunningRecognizeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. For more information on asynchronous speech + * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   LongRunningRecognizeRequest request =
+   *       LongRunningRecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       speechClient.longRunningRecognizeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   LongRunningRecognizeResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable() { + return stub.longRunningRecognizeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. For more information on asynchronous speech + * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   LongRunningRecognizeRequest request =
+   *       LongRunningRecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = speechClient.longRunningRecognizeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + longRunningRecognizeCallable() { + return stub.longRunningRecognizeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs bidirectional streaming speech recognition: receive results while sending audio. This + * method is only available via the gRPC API (not REST). + * + *

Sample code: + * + *

{@code
+   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   BidiStream bidiStream =
+   *       speechClient.streamingRecognizeCallable().call();
+   *   StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build();
+   *   bidiStream.send(request);
+   *   for (StreamingRecognizeResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final BidiStreamingCallable + streamingRecognizeCallable() { + return stub.streamingRecognizeCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java new file mode 100644 index 000000000000..b6e6468b14bb --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java @@ -0,0 +1,242 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SpeechClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (speech.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of recognize to 30 seconds: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder();
+ * speechSettingsBuilder
+ *     .recognizeSettings()
+ *     .setRetrySettings(
+ *         speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SpeechSettings speechSettings = speechSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class SpeechSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to recognize. */ + public UnaryCallSettings recognizeSettings() { + return ((SpeechStubSettings) getStubSettings()).recognizeSettings(); + } + + /** Returns the object with the settings used for calls to longRunningRecognize. */ + public UnaryCallSettings longRunningRecognizeSettings() { + return ((SpeechStubSettings) getStubSettings()).longRunningRecognizeSettings(); + } + + /** Returns the object with the settings used for calls to longRunningRecognize. */ + public OperationCallSettings< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings() { + return ((SpeechStubSettings) getStubSettings()).longRunningRecognizeOperationSettings(); + } + + /** Returns the object with the settings used for calls to streamingRecognize. */ + public StreamingCallSettings + streamingRecognizeSettings() { + return ((SpeechStubSettings) getStubSettings()).streamingRecognizeSettings(); + } + + public static final SpeechSettings create(SpeechStubSettings stub) throws IOException { + return new SpeechSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return SpeechStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return SpeechStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return SpeechStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return SpeechStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return SpeechStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return SpeechStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return SpeechStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SpeechStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SpeechSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for SpeechSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(SpeechStubSettings.newBuilder(clientContext)); + } + + protected Builder(SpeechSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(SpeechStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(SpeechStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(SpeechStubSettings.newHttpJsonBuilder()); + } + + public SpeechStubSettings.Builder getStubSettingsBuilder() { + return ((SpeechStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to recognize. */ + public UnaryCallSettings.Builder recognizeSettings() { + return getStubSettingsBuilder().recognizeSettings(); + } + + /** Returns the builder for the settings used for calls to longRunningRecognize. */ + public UnaryCallSettings.Builder + longRunningRecognizeSettings() { + return getStubSettingsBuilder().longRunningRecognizeSettings(); + } + + /** Returns the builder for the settings used for calls to longRunningRecognize. */ + public OperationCallSettings.Builder< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings() { + return getStubSettingsBuilder().longRunningRecognizeOperationSettings(); + } + + /** Returns the builder for the settings used for calls to streamingRecognize. */ + public StreamingCallSettings.Builder + streamingRecognizeSettings() { + return getStubSettingsBuilder().streamingRecognizeSettings(); + } + + @Override + public SpeechSettings build() throws IOException { + return new SpeechSettings(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/gapic_metadata.json b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/gapic_metadata.json new file mode 100644 index 000000000000..304cbe0bf0b4 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/gapic_metadata.json @@ -0,0 +1,66 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.speech.v1p1beta1", + "libraryPackage": "com.google.cloud.speech.v1p1beta1", + "services": { + "Speech": { + "clients": { + "grpc": { + "libraryClient": "SpeechClient", + "rpcs": { + "LongRunningRecognize": { + "methods": ["longRunningRecognizeAsync", "longRunningRecognizeAsync", "longRunningRecognizeOperationCallable", "longRunningRecognizeCallable"] + }, + "Recognize": { + "methods": ["recognize", "recognize", "recognizeCallable"] + }, + "StreamingRecognize": { + "methods": ["streamingRecognizeCallable"] + } + } + } + } + }, + "Adaptation": { + "clients": { + "grpc": { + "libraryClient": "AdaptationClient", + "rpcs": { + "CreateCustomClass": { + "methods": ["createCustomClass", "createCustomClass", "createCustomClass", "createCustomClassCallable"] + }, + "CreatePhraseSet": { + "methods": ["createPhraseSet", "createPhraseSet", "createPhraseSet", "createPhraseSetCallable"] + }, + "DeleteCustomClass": { + "methods": ["deleteCustomClass", "deleteCustomClass", "deleteCustomClass", "deleteCustomClassCallable"] + }, + "DeletePhraseSet": { + "methods": ["deletePhraseSet", "deletePhraseSet", "deletePhraseSet", "deletePhraseSetCallable"] + }, + "GetCustomClass": { + "methods": ["getCustomClass", "getCustomClass", "getCustomClass", "getCustomClassCallable"] + }, + "GetPhraseSet": { + "methods": ["getPhraseSet", "getPhraseSet", "getPhraseSet", "getPhraseSetCallable"] + }, + "ListCustomClasses": { + "methods": ["listCustomClasses", "listCustomClasses", "listCustomClasses", "listCustomClassesPagedCallable", "listCustomClassesCallable"] + }, + "ListPhraseSet": { + "methods": ["listPhraseSet", "listPhraseSet", "listPhraseSet", "listPhraseSetPagedCallable", "listPhraseSetCallable"] + }, + "UpdateCustomClass": { + "methods": ["updateCustomClass", "updateCustomClass", "updateCustomClassCallable"] + }, + "UpdatePhraseSet": { + "methods": ["updatePhraseSet", "updatePhraseSet", "updatePhraseSetCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java new file mode 100644 index 000000000000..e1d58a669454 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java @@ -0,0 +1,62 @@ +/* + * 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 + * + * https://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. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= SpeechClient ======================= + * + *

Service Description: Service that implements Google Cloud Speech API. + * + *

Sample for SpeechClient: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
+ *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
+ *   RecognizeResponse response = speechClient.recognize(config, audio);
+ * }
+ * }
+ * + *

======================= AdaptationClient ======================= + * + *

Service Description: Service that implements Google Cloud Speech Adaptation API. + * + *

Sample for AdaptationClient: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
+ *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
+ *   String phraseSetId = "phraseSetId959902180";
+ *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.speech.v1p1beta1; + +import javax.annotation.Generated; diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java new file mode 100644 index 000000000000..85fb550e2264 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java @@ -0,0 +1,105 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Adaptation service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class AdaptationStub implements BackgroundResource { + + public UnaryCallable createPhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: createPhraseSetCallable()"); + } + + public UnaryCallable getPhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: getPhraseSetCallable()"); + } + + public UnaryCallable + listPhraseSetPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listPhraseSetPagedCallable()"); + } + + public UnaryCallable listPhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: listPhraseSetCallable()"); + } + + public UnaryCallable updatePhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: updatePhraseSetCallable()"); + } + + public UnaryCallable deletePhraseSetCallable() { + throw new UnsupportedOperationException("Not implemented: deletePhraseSetCallable()"); + } + + public UnaryCallable createCustomClassCallable() { + throw new UnsupportedOperationException("Not implemented: createCustomClassCallable()"); + } + + public UnaryCallable getCustomClassCallable() { + throw new UnsupportedOperationException("Not implemented: getCustomClassCallable()"); + } + + public UnaryCallable + listCustomClassesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listCustomClassesPagedCallable()"); + } + + public UnaryCallable + listCustomClassesCallable() { + throw new UnsupportedOperationException("Not implemented: listCustomClassesCallable()"); + } + + public UnaryCallable updateCustomClassCallable() { + throw new UnsupportedOperationException("Not implemented: updateCustomClassCallable()"); + } + + public UnaryCallable deleteCustomClassCallable() { + throw new UnsupportedOperationException("Not implemented: deleteCustomClassCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java new file mode 100644 index 000000000000..cc2dc2efee2b --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java @@ -0,0 +1,670 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AdaptationStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (speech.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createPhraseSet to 30 seconds: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AdaptationStubSettings.Builder adaptationSettingsBuilder = AdaptationStubSettings.newBuilder();
+ * adaptationSettingsBuilder
+ *     .createPhraseSetSettings()
+ *     .setRetrySettings(
+ *         adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AdaptationStubSettings adaptationSettings = adaptationSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AdaptationStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createPhraseSetSettings; + private final UnaryCallSettings getPhraseSetSettings; + private final PagedCallSettings< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + listPhraseSetSettings; + private final UnaryCallSettings updatePhraseSetSettings; + private final UnaryCallSettings deletePhraseSetSettings; + private final UnaryCallSettings createCustomClassSettings; + private final UnaryCallSettings getCustomClassSettings; + private final PagedCallSettings< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings; + private final UnaryCallSettings updateCustomClassSettings; + private final UnaryCallSettings deleteCustomClassSettings; + + private static final PagedListDescriptor + LIST_PHRASE_SET_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListPhraseSetRequest injectToken(ListPhraseSetRequest payload, String token) { + return ListPhraseSetRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListPhraseSetRequest injectPageSize(ListPhraseSetRequest payload, int pageSize) { + return ListPhraseSetRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListPhraseSetRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListPhraseSetResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListPhraseSetResponse payload) { + return payload.getPhraseSetsList() == null + ? ImmutableList.of() + : payload.getPhraseSetsList(); + } + }; + + private static final PagedListDescriptor< + ListCustomClassesRequest, ListCustomClassesResponse, CustomClass> + LIST_CUSTOM_CLASSES_PAGE_STR_DESC = + new PagedListDescriptor< + ListCustomClassesRequest, ListCustomClassesResponse, CustomClass>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCustomClassesRequest injectToken( + ListCustomClassesRequest payload, String token) { + return ListCustomClassesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCustomClassesRequest injectPageSize( + ListCustomClassesRequest payload, int pageSize) { + return ListCustomClassesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListCustomClassesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCustomClassesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListCustomClassesResponse payload) { + return payload.getCustomClassesList() == null + ? ImmutableList.of() + : payload.getCustomClassesList(); + } + }; + + private static final PagedListResponseFactory< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + LIST_PHRASE_SET_PAGE_STR_FACT = + new PagedListResponseFactory< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListPhraseSetRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PHRASE_SET_PAGE_STR_DESC, request, context); + return ListPhraseSetPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + LIST_CUSTOM_CLASSES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCustomClassesRequest, + ListCustomClassesResponse, + ListCustomClassesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListCustomClassesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_CUSTOM_CLASSES_PAGE_STR_DESC, request, context); + return ListCustomClassesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createPhraseSet. */ + public UnaryCallSettings createPhraseSetSettings() { + return createPhraseSetSettings; + } + + /** Returns the object with the settings used for calls to getPhraseSet. */ + public UnaryCallSettings getPhraseSetSettings() { + return getPhraseSetSettings; + } + + /** Returns the object with the settings used for calls to listPhraseSet. */ + public PagedCallSettings + listPhraseSetSettings() { + return listPhraseSetSettings; + } + + /** Returns the object with the settings used for calls to updatePhraseSet. */ + public UnaryCallSettings updatePhraseSetSettings() { + return updatePhraseSetSettings; + } + + /** Returns the object with the settings used for calls to deletePhraseSet. */ + public UnaryCallSettings deletePhraseSetSettings() { + return deletePhraseSetSettings; + } + + /** Returns the object with the settings used for calls to createCustomClass. */ + public UnaryCallSettings createCustomClassSettings() { + return createCustomClassSettings; + } + + /** Returns the object with the settings used for calls to getCustomClass. */ + public UnaryCallSettings getCustomClassSettings() { + return getCustomClassSettings; + } + + /** Returns the object with the settings used for calls to listCustomClasses. */ + public PagedCallSettings< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings() { + return listCustomClassesSettings; + } + + /** Returns the object with the settings used for calls to updateCustomClass. */ + public UnaryCallSettings updateCustomClassSettings() { + return updateCustomClassSettings; + } + + /** Returns the object with the settings used for calls to deleteCustomClass. */ + public UnaryCallSettings deleteCustomClassSettings() { + return deleteCustomClassSettings; + } + + public AdaptationStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAdaptationStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAdaptationStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "speech.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "speech.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AdaptationStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AdaptationStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AdaptationStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AdaptationStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createPhraseSetSettings = settingsBuilder.createPhraseSetSettings().build(); + getPhraseSetSettings = settingsBuilder.getPhraseSetSettings().build(); + listPhraseSetSettings = settingsBuilder.listPhraseSetSettings().build(); + updatePhraseSetSettings = settingsBuilder.updatePhraseSetSettings().build(); + deletePhraseSetSettings = settingsBuilder.deletePhraseSetSettings().build(); + createCustomClassSettings = settingsBuilder.createCustomClassSettings().build(); + getCustomClassSettings = settingsBuilder.getCustomClassSettings().build(); + listCustomClassesSettings = settingsBuilder.listCustomClassesSettings().build(); + updateCustomClassSettings = settingsBuilder.updateCustomClassSettings().build(); + deleteCustomClassSettings = settingsBuilder.deleteCustomClassSettings().build(); + } + + /** Builder for AdaptationStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + createPhraseSetSettings; + private final UnaryCallSettings.Builder getPhraseSetSettings; + private final PagedCallSettings.Builder< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + listPhraseSetSettings; + private final UnaryCallSettings.Builder + updatePhraseSetSettings; + private final UnaryCallSettings.Builder deletePhraseSetSettings; + private final UnaryCallSettings.Builder + createCustomClassSettings; + private final UnaryCallSettings.Builder + getCustomClassSettings; + private final PagedCallSettings.Builder< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings; + private final UnaryCallSettings.Builder + updateCustomClassSettings; + private final UnaryCallSettings.Builder + deleteCustomClassSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createPhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getPhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listPhraseSetSettings = PagedCallSettings.newBuilder(LIST_PHRASE_SET_PAGE_STR_FACT); + updatePhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deletePhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listCustomClassesSettings = PagedCallSettings.newBuilder(LIST_CUSTOM_CLASSES_PAGE_STR_FACT); + updateCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createPhraseSetSettings, + getPhraseSetSettings, + listPhraseSetSettings, + updatePhraseSetSettings, + deletePhraseSetSettings, + createCustomClassSettings, + getCustomClassSettings, + listCustomClassesSettings, + updateCustomClassSettings, + deleteCustomClassSettings); + initDefaults(this); + } + + protected Builder(AdaptationStubSettings settings) { + super(settings); + + createPhraseSetSettings = settings.createPhraseSetSettings.toBuilder(); + getPhraseSetSettings = settings.getPhraseSetSettings.toBuilder(); + listPhraseSetSettings = settings.listPhraseSetSettings.toBuilder(); + updatePhraseSetSettings = settings.updatePhraseSetSettings.toBuilder(); + deletePhraseSetSettings = settings.deletePhraseSetSettings.toBuilder(); + createCustomClassSettings = settings.createCustomClassSettings.toBuilder(); + getCustomClassSettings = settings.getCustomClassSettings.toBuilder(); + listCustomClassesSettings = settings.listCustomClassesSettings.toBuilder(); + updateCustomClassSettings = settings.updateCustomClassSettings.toBuilder(); + deleteCustomClassSettings = settings.deleteCustomClassSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createPhraseSetSettings, + getPhraseSetSettings, + listPhraseSetSettings, + updatePhraseSetSettings, + deletePhraseSetSettings, + createCustomClassSettings, + getCustomClassSettings, + listCustomClassesSettings, + updateCustomClassSettings, + deleteCustomClassSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createPhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getPhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listPhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updatePhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deletePhraseSetSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createCustomClassSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getCustomClassSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listCustomClassesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateCustomClassSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteCustomClassSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createPhraseSet. */ + public UnaryCallSettings.Builder createPhraseSetSettings() { + return createPhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to getPhraseSet. */ + public UnaryCallSettings.Builder getPhraseSetSettings() { + return getPhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to listPhraseSet. */ + public PagedCallSettings.Builder< + ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> + listPhraseSetSettings() { + return listPhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to updatePhraseSet. */ + public UnaryCallSettings.Builder updatePhraseSetSettings() { + return updatePhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to deletePhraseSet. */ + public UnaryCallSettings.Builder deletePhraseSetSettings() { + return deletePhraseSetSettings; + } + + /** Returns the builder for the settings used for calls to createCustomClass. */ + public UnaryCallSettings.Builder + createCustomClassSettings() { + return createCustomClassSettings; + } + + /** Returns the builder for the settings used for calls to getCustomClass. */ + public UnaryCallSettings.Builder getCustomClassSettings() { + return getCustomClassSettings; + } + + /** Returns the builder for the settings used for calls to listCustomClasses. */ + public PagedCallSettings.Builder< + ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> + listCustomClassesSettings() { + return listCustomClassesSettings; + } + + /** Returns the builder for the settings used for calls to updateCustomClass. */ + public UnaryCallSettings.Builder + updateCustomClassSettings() { + return updateCustomClassSettings; + } + + /** Returns the builder for the settings used for calls to deleteCustomClass. */ + public UnaryCallSettings.Builder deleteCustomClassSettings() { + return deleteCustomClassSettings; + } + + @Override + public AdaptationStubSettings build() throws IOException { + return new AdaptationStubSettings(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java new file mode 100644 index 000000000000..8a8b43cf5078 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Adaptation service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAdaptationCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java new file mode 100644 index 000000000000..526e244c2f61 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java @@ -0,0 +1,477 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Adaptation service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAdaptationStub extends AdaptationStub { + private static final MethodDescriptor + createPhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/CreatePhraseSet") + .setRequestMarshaller( + ProtoUtils.marshaller(CreatePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getPhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/GetPhraseSet") + .setRequestMarshaller(ProtoUtils.marshaller(GetPhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listPhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/ListPhraseSet") + .setRequestMarshaller( + ProtoUtils.marshaller(ListPhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListPhraseSetResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updatePhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/UpdatePhraseSet") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdatePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deletePhraseSetMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/DeletePhraseSet") + .setRequestMarshaller( + ProtoUtils.marshaller(DeletePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createCustomClassMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/CreateCustomClass") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getCustomClassMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/GetCustomClass") + .setRequestMarshaller( + ProtoUtils.marshaller(GetCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listCustomClassesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/ListCustomClasses") + .setRequestMarshaller( + ProtoUtils.marshaller(ListCustomClassesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCustomClassesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateCustomClassMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/UpdateCustomClass") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteCustomClassMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/DeleteCustomClass") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private final UnaryCallable createPhraseSetCallable; + private final UnaryCallable getPhraseSetCallable; + private final UnaryCallable listPhraseSetCallable; + private final UnaryCallable + listPhraseSetPagedCallable; + private final UnaryCallable updatePhraseSetCallable; + private final UnaryCallable deletePhraseSetCallable; + private final UnaryCallable createCustomClassCallable; + private final UnaryCallable getCustomClassCallable; + private final UnaryCallable + listCustomClassesCallable; + private final UnaryCallable + listCustomClassesPagedCallable; + private final UnaryCallable updateCustomClassCallable; + private final UnaryCallable deleteCustomClassCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAdaptationStub create(AdaptationStubSettings settings) + throws IOException { + return new GrpcAdaptationStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAdaptationStub create(ClientContext clientContext) throws IOException { + return new GrpcAdaptationStub(AdaptationStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAdaptationStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAdaptationStub( + AdaptationStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAdaptationStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcAdaptationStub(AdaptationStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAdaptationCallableFactory()); + } + + /** + * Constructs an instance of GrpcAdaptationStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcAdaptationStub( + AdaptationStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createPhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createPhraseSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getPhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getPhraseSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listPhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listPhraseSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updatePhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updatePhraseSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("phrase_set.name", String.valueOf(request.getPhraseSet().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deletePhraseSetTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deletePhraseSetMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings createCustomClassTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createCustomClassMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings getCustomClassTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getCustomClassMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listCustomClassesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listCustomClassesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateCustomClassTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateCustomClassMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "custom_class.name", String.valueOf(request.getCustomClass().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteCustomClassTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteCustomClassMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.createPhraseSetCallable = + callableFactory.createUnaryCallable( + createPhraseSetTransportSettings, settings.createPhraseSetSettings(), clientContext); + this.getPhraseSetCallable = + callableFactory.createUnaryCallable( + getPhraseSetTransportSettings, settings.getPhraseSetSettings(), clientContext); + this.listPhraseSetCallable = + callableFactory.createUnaryCallable( + listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); + this.listPhraseSetPagedCallable = + callableFactory.createPagedCallable( + listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); + this.updatePhraseSetCallable = + callableFactory.createUnaryCallable( + updatePhraseSetTransportSettings, settings.updatePhraseSetSettings(), clientContext); + this.deletePhraseSetCallable = + callableFactory.createUnaryCallable( + deletePhraseSetTransportSettings, settings.deletePhraseSetSettings(), clientContext); + this.createCustomClassCallable = + callableFactory.createUnaryCallable( + createCustomClassTransportSettings, + settings.createCustomClassSettings(), + clientContext); + this.getCustomClassCallable = + callableFactory.createUnaryCallable( + getCustomClassTransportSettings, settings.getCustomClassSettings(), clientContext); + this.listCustomClassesCallable = + callableFactory.createUnaryCallable( + listCustomClassesTransportSettings, + settings.listCustomClassesSettings(), + clientContext); + this.listCustomClassesPagedCallable = + callableFactory.createPagedCallable( + listCustomClassesTransportSettings, + settings.listCustomClassesSettings(), + clientContext); + this.updateCustomClassCallable = + callableFactory.createUnaryCallable( + updateCustomClassTransportSettings, + settings.updateCustomClassSettings(), + clientContext); + this.deleteCustomClassCallable = + callableFactory.createUnaryCallable( + deleteCustomClassTransportSettings, + settings.deleteCustomClassSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createPhraseSetCallable() { + return createPhraseSetCallable; + } + + @Override + public UnaryCallable getPhraseSetCallable() { + return getPhraseSetCallable; + } + + @Override + public UnaryCallable listPhraseSetCallable() { + return listPhraseSetCallable; + } + + @Override + public UnaryCallable + listPhraseSetPagedCallable() { + return listPhraseSetPagedCallable; + } + + @Override + public UnaryCallable updatePhraseSetCallable() { + return updatePhraseSetCallable; + } + + @Override + public UnaryCallable deletePhraseSetCallable() { + return deletePhraseSetCallable; + } + + @Override + public UnaryCallable createCustomClassCallable() { + return createCustomClassCallable; + } + + @Override + public UnaryCallable getCustomClassCallable() { + return getCustomClassCallable; + } + + @Override + public UnaryCallable + listCustomClassesCallable() { + return listCustomClassesCallable; + } + + @Override + public UnaryCallable + listCustomClassesPagedCallable() { + return listCustomClassesPagedCallable; + } + + @Override + public UnaryCallable updateCustomClassCallable() { + return updateCustomClassCallable; + } + + @Override + public UnaryCallable deleteCustomClassCallable() { + return deleteCustomClassCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java new file mode 100644 index 000000000000..8b7dc082d62f --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the Speech service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSpeechCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java new file mode 100644 index 000000000000..b265cdb79674 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java @@ -0,0 +1,229 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.RecognizeRequest; +import com.google.cloud.speech.v1p1beta1.RecognizeResponse; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Speech service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSpeechStub extends SpeechStub { + private static final MethodDescriptor + recognizeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/Recognize") + .setRequestMarshaller(ProtoUtils.marshaller(RecognizeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RecognizeResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + longRunningRecognizeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/LongRunningRecognize") + .setRequestMarshaller( + ProtoUtils.marshaller(LongRunningRecognizeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + streamingRecognizeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/StreamingRecognize") + .setRequestMarshaller( + ProtoUtils.marshaller(StreamingRecognizeRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamingRecognizeResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable recognizeCallable; + private final UnaryCallable longRunningRecognizeCallable; + private final OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable; + private final BidiStreamingCallable + streamingRecognizeCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSpeechStub create(SpeechStubSettings settings) throws IOException { + return new GrpcSpeechStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSpeechStub create(ClientContext clientContext) throws IOException { + return new GrpcSpeechStub(SpeechStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSpeechStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSpeechStub( + SpeechStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSpeechCallableFactory()); + } + + /** + * Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected GrpcSpeechStub( + SpeechStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings recognizeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(recognizeMethodDescriptor) + .build(); + GrpcCallSettings longRunningRecognizeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(longRunningRecognizeMethodDescriptor) + .build(); + GrpcCallSettings + streamingRecognizeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamingRecognizeMethodDescriptor) + .build(); + + this.recognizeCallable = + callableFactory.createUnaryCallable( + recognizeTransportSettings, settings.recognizeSettings(), clientContext); + this.longRunningRecognizeCallable = + callableFactory.createUnaryCallable( + longRunningRecognizeTransportSettings, + settings.longRunningRecognizeSettings(), + clientContext); + this.longRunningRecognizeOperationCallable = + callableFactory.createOperationCallable( + longRunningRecognizeTransportSettings, + settings.longRunningRecognizeOperationSettings(), + clientContext, + operationsStub); + this.streamingRecognizeCallable = + callableFactory.createBidiStreamingCallable( + streamingRecognizeTransportSettings, + settings.streamingRecognizeSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable recognizeCallable() { + return recognizeCallable; + } + + @Override + public UnaryCallable longRunningRecognizeCallable() { + return longRunningRecognizeCallable; + } + + @Override + public OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable() { + return longRunningRecognizeOperationCallable; + } + + @Override + public BidiStreamingCallable + streamingRecognizeCallable() { + return streamingRecognizeCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationCallableFactory.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationCallableFactory.java new file mode 100644 index 000000000000..85c896189cc1 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationCallableFactory.java @@ -0,0 +1,105 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Adaptation service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonAdaptationCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationStub.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationStub.java new file mode 100644 index 000000000000..0f5e1743cfdb --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationStub.java @@ -0,0 +1,695 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Adaptation service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonAdaptationStub extends AdaptationStub { + private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); + + private static final ApiMethodDescriptor + createPhraseSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/CreatePhraseSet") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PhraseSet.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getPhraseSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/GetPhraseSet") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PhraseSet.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listPhraseSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/ListPhraseSet") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListPhraseSetResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updatePhraseSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/UpdatePhraseSet") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/{phraseSet.name=projects/*/locations/*/phraseSets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "phraseSet.name", request.getPhraseSet().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("phraseSet", request.getPhraseSet(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(PhraseSet.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deletePhraseSetMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/DeletePhraseSet") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createCustomClassMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/CreateCustomClass") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/{parent=projects/*/locations/*}/customClasses", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(CustomClass.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getCustomClassMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/GetCustomClass") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(CustomClass.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listCustomClassesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/ListCustomClasses") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/{parent=projects/*/locations/*}/customClasses", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListCustomClassesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + updateCustomClassMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/UpdateCustomClass") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/{customClass.name=projects/*/locations/*/customClasses/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "customClass.name", request.getCustomClass().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("customClass", request.getCustomClass(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(CustomClass.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + deleteCustomClassMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/DeleteCustomClass") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createPhraseSetCallable; + private final UnaryCallable getPhraseSetCallable; + private final UnaryCallable listPhraseSetCallable; + private final UnaryCallable + listPhraseSetPagedCallable; + private final UnaryCallable updatePhraseSetCallable; + private final UnaryCallable deletePhraseSetCallable; + private final UnaryCallable createCustomClassCallable; + private final UnaryCallable getCustomClassCallable; + private final UnaryCallable + listCustomClassesCallable; + private final UnaryCallable + listCustomClassesPagedCallable; + private final UnaryCallable updateCustomClassCallable; + private final UnaryCallable deleteCustomClassCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAdaptationStub create(AdaptationStubSettings settings) + throws IOException { + return new HttpJsonAdaptationStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAdaptationStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAdaptationStub( + AdaptationStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAdaptationStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAdaptationStub( + AdaptationStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAdaptationStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonAdaptationStub(AdaptationStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonAdaptationCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAdaptationStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonAdaptationStub( + AdaptationStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + HttpJsonCallSettings createPhraseSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createPhraseSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getPhraseSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getPhraseSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listPhraseSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listPhraseSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updatePhraseSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updatePhraseSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deletePhraseSetTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deletePhraseSetMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createCustomClassTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createCustomClassMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getCustomClassTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getCustomClassMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listCustomClassesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listCustomClassesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateCustomClassTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateCustomClassMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteCustomClassTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteCustomClassMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createPhraseSetCallable = + callableFactory.createUnaryCallable( + createPhraseSetTransportSettings, settings.createPhraseSetSettings(), clientContext); + this.getPhraseSetCallable = + callableFactory.createUnaryCallable( + getPhraseSetTransportSettings, settings.getPhraseSetSettings(), clientContext); + this.listPhraseSetCallable = + callableFactory.createUnaryCallable( + listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); + this.listPhraseSetPagedCallable = + callableFactory.createPagedCallable( + listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); + this.updatePhraseSetCallable = + callableFactory.createUnaryCallable( + updatePhraseSetTransportSettings, settings.updatePhraseSetSettings(), clientContext); + this.deletePhraseSetCallable = + callableFactory.createUnaryCallable( + deletePhraseSetTransportSettings, settings.deletePhraseSetSettings(), clientContext); + this.createCustomClassCallable = + callableFactory.createUnaryCallable( + createCustomClassTransportSettings, + settings.createCustomClassSettings(), + clientContext); + this.getCustomClassCallable = + callableFactory.createUnaryCallable( + getCustomClassTransportSettings, settings.getCustomClassSettings(), clientContext); + this.listCustomClassesCallable = + callableFactory.createUnaryCallable( + listCustomClassesTransportSettings, + settings.listCustomClassesSettings(), + clientContext); + this.listCustomClassesPagedCallable = + callableFactory.createPagedCallable( + listCustomClassesTransportSettings, + settings.listCustomClassesSettings(), + clientContext); + this.updateCustomClassCallable = + callableFactory.createUnaryCallable( + updateCustomClassTransportSettings, + settings.updateCustomClassSettings(), + clientContext); + this.deleteCustomClassCallable = + callableFactory.createUnaryCallable( + deleteCustomClassTransportSettings, + settings.deleteCustomClassSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createPhraseSetMethodDescriptor); + methodDescriptors.add(getPhraseSetMethodDescriptor); + methodDescriptors.add(listPhraseSetMethodDescriptor); + methodDescriptors.add(updatePhraseSetMethodDescriptor); + methodDescriptors.add(deletePhraseSetMethodDescriptor); + methodDescriptors.add(createCustomClassMethodDescriptor); + methodDescriptors.add(getCustomClassMethodDescriptor); + methodDescriptors.add(listCustomClassesMethodDescriptor); + methodDescriptors.add(updateCustomClassMethodDescriptor); + methodDescriptors.add(deleteCustomClassMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createPhraseSetCallable() { + return createPhraseSetCallable; + } + + @Override + public UnaryCallable getPhraseSetCallable() { + return getPhraseSetCallable; + } + + @Override + public UnaryCallable listPhraseSetCallable() { + return listPhraseSetCallable; + } + + @Override + public UnaryCallable + listPhraseSetPagedCallable() { + return listPhraseSetPagedCallable; + } + + @Override + public UnaryCallable updatePhraseSetCallable() { + return updatePhraseSetCallable; + } + + @Override + public UnaryCallable deletePhraseSetCallable() { + return deletePhraseSetCallable; + } + + @Override + public UnaryCallable createCustomClassCallable() { + return createCustomClassCallable; + } + + @Override + public UnaryCallable getCustomClassCallable() { + return getCustomClassCallable; + } + + @Override + public UnaryCallable + listCustomClassesCallable() { + return listCustomClassesCallable; + } + + @Override + public UnaryCallable + listCustomClassesPagedCallable() { + return listCustomClassesPagedCallable; + } + + @Override + public UnaryCallable updateCustomClassCallable() { + return updateCustomClassCallable; + } + + @Override + public UnaryCallable deleteCustomClassCallable() { + return deleteCustomClassCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechCallableFactory.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechCallableFactory.java new file mode 100644 index 000000000000..008215d4f8b4 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechCallableFactory.java @@ -0,0 +1,105 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Speech service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSpeechCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechStub.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechStub.java new file mode 100644 index 000000000000..bd3f8465a503 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechStub.java @@ -0,0 +1,281 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.RecognizeRequest; +import com.google.cloud.speech.v1p1beta1.RecognizeResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Speech service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonSpeechStub extends SpeechStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(LongRunningRecognizeResponse.getDescriptor()) + .add(LongRunningRecognizeMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + recognizeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/Recognize") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/speech:recognize", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RecognizeResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + longRunningRecognizeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/LongRunningRecognize") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/speech:longrunningrecognize", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (LongRunningRecognizeRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable recognizeCallable; + private final UnaryCallable longRunningRecognizeCallable; + private final OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSpeechStub create(SpeechStubSettings settings) throws IOException { + return new HttpJsonSpeechStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSpeechStub create(ClientContext clientContext) throws IOException { + return new HttpJsonSpeechStub(SpeechStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSpeechStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSpeechStub( + SpeechStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSpeechStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonSpeechCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSpeechStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonSpeechStub( + SpeechStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings recognizeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(recognizeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + longRunningRecognizeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(longRunningRecognizeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.recognizeCallable = + callableFactory.createUnaryCallable( + recognizeTransportSettings, settings.recognizeSettings(), clientContext); + this.longRunningRecognizeCallable = + callableFactory.createUnaryCallable( + longRunningRecognizeTransportSettings, + settings.longRunningRecognizeSettings(), + clientContext); + this.longRunningRecognizeOperationCallable = + callableFactory.createOperationCallable( + longRunningRecognizeTransportSettings, + settings.longRunningRecognizeOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(recognizeMethodDescriptor); + methodDescriptors.add(longRunningRecognizeMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable recognizeCallable() { + return recognizeCallable; + } + + @Override + public UnaryCallable longRunningRecognizeCallable() { + return longRunningRecognizeCallable; + } + + @Override + public OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable() { + return longRunningRecognizeOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java new file mode 100644 index 000000000000..2adbabc73a2f --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java @@ -0,0 +1,75 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.RecognizeRequest; +import com.google.cloud.speech.v1p1beta1.RecognizeResponse; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Speech service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SpeechStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable recognizeCallable() { + throw new UnsupportedOperationException("Not implemented: recognizeCallable()"); + } + + public OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: longRunningRecognizeOperationCallable()"); + } + + public UnaryCallable longRunningRecognizeCallable() { + throw new UnsupportedOperationException("Not implemented: longRunningRecognizeCallable()"); + } + + public BidiStreamingCallable + streamingRecognizeCallable() { + throw new UnsupportedOperationException("Not implemented: streamingRecognizeCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStubSettings.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStubSettings.java new file mode 100644 index 000000000000..c8187b4bd3b9 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStubSettings.java @@ -0,0 +1,441 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.RecognizeRequest; +import com.google.cloud.speech.v1p1beta1.RecognizeResponse; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link SpeechStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (speech.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of recognize to 30 seconds: + * + *

{@code
+ * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SpeechStubSettings.Builder speechSettingsBuilder = SpeechStubSettings.newBuilder();
+ * speechSettingsBuilder
+ *     .recognizeSettings()
+ *     .setRetrySettings(
+ *         speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SpeechStubSettings speechSettings = speechSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class SpeechStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings recognizeSettings; + private final UnaryCallSettings + longRunningRecognizeSettings; + private final OperationCallSettings< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings; + private final StreamingCallSettings + streamingRecognizeSettings; + + /** Returns the object with the settings used for calls to recognize. */ + public UnaryCallSettings recognizeSettings() { + return recognizeSettings; + } + + /** Returns the object with the settings used for calls to longRunningRecognize. */ + public UnaryCallSettings longRunningRecognizeSettings() { + return longRunningRecognizeSettings; + } + + /** Returns the object with the settings used for calls to longRunningRecognize. */ + public OperationCallSettings< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings() { + return longRunningRecognizeOperationSettings; + } + + /** Returns the object with the settings used for calls to streamingRecognize. */ + public StreamingCallSettings + streamingRecognizeSettings() { + return streamingRecognizeSettings; + } + + public SpeechStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSpeechStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSpeechStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "speech.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "speech.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SpeechStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SpeechStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SpeechStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + recognizeSettings = settingsBuilder.recognizeSettings().build(); + longRunningRecognizeSettings = settingsBuilder.longRunningRecognizeSettings().build(); + longRunningRecognizeOperationSettings = + settingsBuilder.longRunningRecognizeOperationSettings().build(); + streamingRecognizeSettings = settingsBuilder.streamingRecognizeSettings().build(); + } + + /** Builder for SpeechStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder recognizeSettings; + private final UnaryCallSettings.Builder + longRunningRecognizeSettings; + private final OperationCallSettings.Builder< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings; + private final StreamingCallSettings.Builder< + StreamingRecognizeRequest, StreamingRecognizeResponse> + streamingRecognizeSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000000L)) + .setTotalTimeout(Duration.ofMillis(5000000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000000L)) + .setTotalTimeout(Duration.ofMillis(5000000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + recognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + longRunningRecognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + longRunningRecognizeOperationSettings = OperationCallSettings.newBuilder(); + streamingRecognizeSettings = StreamingCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + recognizeSettings, longRunningRecognizeSettings); + initDefaults(this); + } + + protected Builder(SpeechStubSettings settings) { + super(settings); + + recognizeSettings = settings.recognizeSettings.toBuilder(); + longRunningRecognizeSettings = settings.longRunningRecognizeSettings.toBuilder(); + longRunningRecognizeOperationSettings = + settings.longRunningRecognizeOperationSettings.toBuilder(); + streamingRecognizeSettings = settings.streamingRecognizeSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + recognizeSettings, longRunningRecognizeSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .recognizeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .longRunningRecognizeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .longRunningRecognizeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + LongRunningRecognizeResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + LongRunningRecognizeMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to recognize. */ + public UnaryCallSettings.Builder recognizeSettings() { + return recognizeSettings; + } + + /** Returns the builder for the settings used for calls to longRunningRecognize. */ + public UnaryCallSettings.Builder + longRunningRecognizeSettings() { + return longRunningRecognizeSettings; + } + + /** Returns the builder for the settings used for calls to longRunningRecognize. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings() { + return longRunningRecognizeOperationSettings; + } + + /** Returns the builder for the settings used for calls to streamingRecognize. */ + public StreamingCallSettings.Builder + streamingRecognizeSettings() { + return streamingRecognizeSettings; + } + + @Override + public SpeechStubSettings build() throws IOException { + return new SpeechStubSettings(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientHttpJsonTest.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientHttpJsonTest.java new file mode 100644 index 000000000000..0b485e3a8bbc --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientHttpJsonTest.java @@ -0,0 +1,940 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.speech.v1p1beta1.stub.HttpJsonAdaptationStub; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AdaptationClientHttpJsonTest { + private static MockHttpService mockService; + private static AdaptationClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonAdaptationStub.getMethodDescriptors(), AdaptationSettings.getDefaultEndpoint()); + AdaptationSettings settings = + AdaptationSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + AdaptationSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AdaptationClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createPhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + + PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createPhraseSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPhraseSetTest2() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + + PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createPhraseSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockService.addResponse(expectedResponse); + + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + + PhraseSet actualResponse = client.getPhraseSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getPhraseSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + client.getPhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPhraseSetTest2() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; + + PhraseSet actualResponse = client.getPhraseSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getPhraseSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; + client.getPhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPhraseSetTest() throws Exception { + PhraseSet responsesElement = PhraseSet.newBuilder().build(); + ListPhraseSetResponse expectedResponse = + ListPhraseSetResponse.newBuilder() + .setNextPageToken("") + .addAllPhraseSets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listPhraseSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listPhraseSet(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPhraseSetTest2() throws Exception { + PhraseSet responsesElement = PhraseSet.newBuilder().build(); + ListPhraseSetResponse expectedResponse = + ListPhraseSetResponse.newBuilder() + .setNextPageToken("") + .addAllPhraseSets(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listPhraseSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listPhraseSet(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updatePhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockService.addResponse(expectedResponse); + + PhraseSet phraseSet = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + PhraseSet actualResponse = client.updatePhraseSet(phraseSet, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updatePhraseSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PhraseSet phraseSet = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updatePhraseSet(phraseSet, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePhraseSetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + + client.deletePhraseSet(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deletePhraseSetExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + client.deletePhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePhraseSetTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; + + client.deletePhraseSet(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deletePhraseSetExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; + client.deletePhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + + CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createCustomClassExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + client.createCustomClass(parent, customClass, customClassId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createCustomClassTest2() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + + CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createCustomClassExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + client.createCustomClass(parent, customClass, customClassId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + + CustomClass actualResponse = client.getCustomClass(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getCustomClassExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + client.getCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomClassTest2() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; + + CustomClass actualResponse = client.getCustomClass(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getCustomClassExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; + client.getCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomClassesTest() throws Exception { + CustomClass responsesElement = CustomClass.newBuilder().build(); + ListCustomClassesResponse expectedResponse = + ListCustomClassesResponse.newBuilder() + .setNextPageToken("") + .addAllCustomClasses(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listCustomClassesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listCustomClasses(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomClassesTest2() throws Exception { + CustomClass responsesElement = CustomClass.newBuilder().build(); + ListCustomClassesResponse expectedResponse = + ListCustomClassesResponse.newBuilder() + .setNextPageToken("") + .addAllCustomClasses(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listCustomClassesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listCustomClasses(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + CustomClass customClass = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + CustomClass actualResponse = client.updateCustomClass(customClass, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateCustomClassExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomClass customClass = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateCustomClass(customClass, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCustomClassTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + + client.deleteCustomClass(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteCustomClassExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + client.deleteCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCustomClassTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; + + client.deleteCustomClass(name); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteCustomClassExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; + client.deleteCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java new file mode 100644 index 000000000000..91bc9ae371e7 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java @@ -0,0 +1,826 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; +import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AdaptationClientTest { + private static MockAdaptation mockAdaptation; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AdaptationClient client; + + @BeforeClass + public static void startStaticServer() { + mockAdaptation = new MockAdaptation(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockAdaptation)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AdaptationSettings settings = + AdaptationSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AdaptationClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createPhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + + PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePhraseSetRequest actualRequest = ((CreatePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); + Assert.assertEquals(phraseSetId, actualRequest.getPhraseSetId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPhraseSetTest2() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String parent = "parent-995424086"; + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + + PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePhraseSetRequest actualRequest = ((CreatePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); + Assert.assertEquals(phraseSetId, actualRequest.getPhraseSetId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPhraseSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String parent = "parent-995424086"; + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + client.createPhraseSet(parent, phraseSet, phraseSetId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + + PhraseSet actualResponse = client.getPhraseSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPhraseSetRequest actualRequest = ((GetPhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + client.getPhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPhraseSetTest2() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String name = "name3373707"; + + PhraseSet actualResponse = client.getPhraseSet(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPhraseSetRequest actualRequest = ((GetPhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPhraseSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String name = "name3373707"; + client.getPhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPhraseSetTest() throws Exception { + PhraseSet responsesElement = PhraseSet.newBuilder().build(); + ListPhraseSetResponse expectedResponse = + ListPhraseSetResponse.newBuilder() + .setNextPageToken("") + .addAllPhraseSets(Arrays.asList(responsesElement)) + .build(); + mockAdaptation.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPhraseSetRequest actualRequest = ((ListPhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listPhraseSet(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPhraseSetTest2() throws Exception { + PhraseSet responsesElement = PhraseSet.newBuilder().build(); + ListPhraseSetResponse expectedResponse = + ListPhraseSetResponse.newBuilder() + .setNextPageToken("") + .addAllPhraseSets(Arrays.asList(responsesElement)) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPhraseSetRequest actualRequest = ((ListPhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPhraseSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String parent = "parent-995424086"; + client.listPhraseSet(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updatePhraseSetTest() throws Exception { + PhraseSet expectedResponse = + PhraseSet.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .addAllPhrases(new ArrayList()) + .setBoost(93922211) + .build(); + mockAdaptation.addResponse(expectedResponse); + + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + PhraseSet actualResponse = client.updatePhraseSet(phraseSet, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdatePhraseSetRequest actualRequest = ((UpdatePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updatePhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updatePhraseSet(phraseSet, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePhraseSetTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAdaptation.addResponse(expectedResponse); + + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + + client.deletePhraseSet(name); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePhraseSetRequest actualRequest = ((DeletePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePhraseSetExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + client.deletePhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePhraseSetTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAdaptation.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deletePhraseSet(name); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePhraseSetRequest actualRequest = ((DeletePhraseSetRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePhraseSetExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String name = "name3373707"; + client.deletePhraseSet(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + + CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateCustomClassRequest actualRequest = ((CreateCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(customClass, actualRequest.getCustomClass()); + Assert.assertEquals(customClassId, actualRequest.getCustomClassId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createCustomClassExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + client.createCustomClass(parent, customClass, customClassId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createCustomClassTest2() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String parent = "parent-995424086"; + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + + CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateCustomClassRequest actualRequest = ((CreateCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(customClass, actualRequest.getCustomClass()); + Assert.assertEquals(customClassId, actualRequest.getCustomClassId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createCustomClassExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String parent = "parent-995424086"; + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + client.createCustomClass(parent, customClass, customClassId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + + CustomClass actualResponse = client.getCustomClass(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCustomClassRequest actualRequest = ((GetCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCustomClassExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + client.getCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCustomClassTest2() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String name = "name3373707"; + + CustomClass actualResponse = client.getCustomClass(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCustomClassRequest actualRequest = ((GetCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCustomClassExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String name = "name3373707"; + client.getCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomClassesTest() throws Exception { + CustomClass responsesElement = CustomClass.newBuilder().build(); + ListCustomClassesResponse expectedResponse = + ListCustomClassesResponse.newBuilder() + .setNextPageToken("") + .addAllCustomClasses(Arrays.asList(responsesElement)) + .build(); + mockAdaptation.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCustomClassesRequest actualRequest = ((ListCustomClassesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCustomClassesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listCustomClasses(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listCustomClassesTest2() throws Exception { + CustomClass responsesElement = CustomClass.newBuilder().build(); + ListCustomClassesResponse expectedResponse = + ListCustomClassesResponse.newBuilder() + .setNextPageToken("") + .addAllCustomClasses(Arrays.asList(responsesElement)) + .build(); + mockAdaptation.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCustomClassesRequest actualRequest = ((ListCustomClassesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listCustomClassesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String parent = "parent-995424086"; + client.listCustomClasses(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateCustomClassTest() throws Exception { + CustomClass expectedResponse = + CustomClass.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .setCustomClassId("customClassId1871032322") + .addAllItems(new ArrayList()) + .build(); + mockAdaptation.addResponse(expectedResponse); + + CustomClass customClass = CustomClass.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + CustomClass actualResponse = client.updateCustomClass(customClass, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCustomClassRequest actualRequest = ((UpdateCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(customClass, actualRequest.getCustomClass()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateCustomClassExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + CustomClass customClass = CustomClass.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateCustomClass(customClass, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCustomClassTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAdaptation.addResponse(expectedResponse); + + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + + client.deleteCustomClass(name); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteCustomClassRequest actualRequest = ((DeleteCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteCustomClassExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + client.deleteCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteCustomClassTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAdaptation.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteCustomClass(name); + + List actualRequests = mockAdaptation.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteCustomClassRequest actualRequest = ((DeleteCustomClassRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteCustomClassExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAdaptation.addException(exception); + + try { + String name = "name3373707"; + client.deleteCustomClass(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java new file mode 100644 index 000000000000..6126bd88d543 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java @@ -0,0 +1,59 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAdaptation implements MockGrpcService { + private final MockAdaptationImpl serviceImpl; + + public MockAdaptation() { + serviceImpl = new MockAdaptationImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java new file mode 100644 index 000000000000..33a5d0e237e4 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java @@ -0,0 +1,272 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.speech.v1p1beta1.AdaptationGrpc.AdaptationImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAdaptationImpl extends AdaptationImplBase { + private List requests; + private Queue responses; + + public MockAdaptationImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createPhraseSet( + CreatePhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PhraseSet) { + requests.add(request); + responseObserver.onNext(((PhraseSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreatePhraseSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PhraseSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getPhraseSet( + GetPhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PhraseSet) { + requests.add(request); + responseObserver.onNext(((PhraseSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetPhraseSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PhraseSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listPhraseSet( + ListPhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListPhraseSetResponse) { + requests.add(request); + responseObserver.onNext(((ListPhraseSetResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListPhraseSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListPhraseSetResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updatePhraseSet( + UpdatePhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof PhraseSet) { + requests.add(request); + responseObserver.onNext(((PhraseSet) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdatePhraseSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + PhraseSet.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deletePhraseSet( + DeletePhraseSetRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeletePhraseSet, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createCustomClass( + CreateCustomClassRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CustomClass) { + requests.add(request); + responseObserver.onNext(((CustomClass) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateCustomClass, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CustomClass.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCustomClass( + GetCustomClassRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CustomClass) { + requests.add(request); + responseObserver.onNext(((CustomClass) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetCustomClass, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CustomClass.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listCustomClasses( + ListCustomClassesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListCustomClassesResponse) { + requests.add(request); + responseObserver.onNext(((ListCustomClassesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListCustomClasses, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListCustomClassesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCustomClass( + UpdateCustomClassRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CustomClass) { + requests.add(request); + responseObserver.onNext(((CustomClass) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateCustomClass, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CustomClass.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteCustomClass( + DeleteCustomClassRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteCustomClass, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java new file mode 100644 index 000000000000..559055355ecd --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java @@ -0,0 +1,59 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSpeech implements MockGrpcService { + private final MockSpeechImpl serviceImpl; + + public MockSpeech() { + serviceImpl = new MockSpeechImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java new file mode 100644 index 000000000000..e5f058a3132a --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java @@ -0,0 +1,140 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.speech.v1p1beta1.SpeechGrpc.SpeechImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockSpeechImpl extends SpeechImplBase { + private List requests; + private Queue responses; + + public MockSpeechImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void recognize( + RecognizeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RecognizeResponse) { + requests.add(request); + responseObserver.onNext(((RecognizeResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Recognize, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + RecognizeResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void longRunningRecognize( + LongRunningRecognizeRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method LongRunningRecognize, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver streamingRecognize( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(StreamingRecognizeRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof StreamingRecognizeResponse) { + responseObserver.onNext(((StreamingRecognizeResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StreamingRecognize, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamingRecognizeResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientHttpJsonTest.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientHttpJsonTest.java new file mode 100644 index 000000000000..565f69611631 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientHttpJsonTest.java @@ -0,0 +1,186 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.speech.v1p1beta1.stub.HttpJsonSpeechStub; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Duration; +import com.google.rpc.Status; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SpeechClientHttpJsonTest { + private static MockHttpService mockService; + private static SpeechClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonSpeechStub.getMethodDescriptors(), SpeechSettings.getDefaultEndpoint()); + SpeechSettings settings = + SpeechSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + SpeechSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SpeechClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void recognizeTest() throws Exception { + RecognizeResponse expectedResponse = + RecognizeResponse.newBuilder() + .addAllResults(new ArrayList()) + .setTotalBilledTime(Duration.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + + RecognizeResponse actualResponse = client.recognize(config, audio); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void recognizeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + client.recognize(config, audio); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void longRunningRecognizeTest() throws Exception { + LongRunningRecognizeResponse expectedResponse = + LongRunningRecognizeResponse.newBuilder() + .addAllResults(new ArrayList()) + .setTotalBilledTime(Duration.newBuilder().build()) + .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) + .setOutputError(Status.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("longRunningRecognizeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + + LongRunningRecognizeResponse actualResponse = + client.longRunningRecognizeAsync(config, audio).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void longRunningRecognizeExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + client.longRunningRecognizeAsync(config, audio).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void streamingRecognizeUnsupportedMethodTest() throws Exception { + // The streamingRecognize() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java new file mode 100644 index 000000000000..47c54e81eed9 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java @@ -0,0 +1,234 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Duration; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SpeechClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockSpeech mockSpeech; + private LocalChannelProvider channelProvider; + private SpeechClient client; + + @BeforeClass + public static void startStaticServer() { + mockSpeech = new MockSpeech(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockSpeech)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + SpeechSettings settings = + SpeechSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = SpeechClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void recognizeTest() throws Exception { + RecognizeResponse expectedResponse = + RecognizeResponse.newBuilder() + .addAllResults(new ArrayList()) + .setTotalBilledTime(Duration.newBuilder().build()) + .build(); + mockSpeech.addResponse(expectedResponse); + + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + + RecognizeResponse actualResponse = client.recognize(config, audio); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSpeech.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RecognizeRequest actualRequest = ((RecognizeRequest) actualRequests.get(0)); + + Assert.assertEquals(config, actualRequest.getConfig()); + Assert.assertEquals(audio, actualRequest.getAudio()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void recognizeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSpeech.addException(exception); + + try { + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + client.recognize(config, audio); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void longRunningRecognizeTest() throws Exception { + LongRunningRecognizeResponse expectedResponse = + LongRunningRecognizeResponse.newBuilder() + .addAllResults(new ArrayList()) + .setTotalBilledTime(Duration.newBuilder().build()) + .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) + .setOutputError(Status.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("longRunningRecognizeTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockSpeech.addResponse(resultOperation); + + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + + LongRunningRecognizeResponse actualResponse = + client.longRunningRecognizeAsync(config, audio).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSpeech.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LongRunningRecognizeRequest actualRequest = + ((LongRunningRecognizeRequest) actualRequests.get(0)); + + Assert.assertEquals(config, actualRequest.getConfig()); + Assert.assertEquals(audio, actualRequest.getAudio()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void longRunningRecognizeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSpeech.addException(exception); + + try { + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + client.longRunningRecognizeAsync(config, audio).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void streamingRecognizeTest() throws Exception { + StreamingRecognizeResponse expectedResponse = + StreamingRecognizeResponse.newBuilder() + .setError(Status.newBuilder().build()) + .addAllResults(new ArrayList()) + .setTotalBilledTime(Duration.newBuilder().build()) + .build(); + mockSpeech.addResponse(expectedResponse); + StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamingRecognizeCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void streamingRecognizeExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSpeech.addException(exception); + StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.streamingRecognizeCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java b/owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java new file mode 100644 index 000000000000..e41d203e7109 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java @@ -0,0 +1,1085 @@ +package com.google.cloud.speech.v1p1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + *
+ * Service that implements Google Cloud Speech Adaptation API.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class AdaptationGrpc { + + private AdaptationGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.speech.v1p1beta1.Adaptation"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getCreatePhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreatePhraseSet", + requestType = com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.PhraseSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreatePhraseSetMethod() { + io.grpc.MethodDescriptor getCreatePhraseSetMethod; + if ((getCreatePhraseSetMethod = AdaptationGrpc.getCreatePhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getCreatePhraseSetMethod = AdaptationGrpc.getCreatePhraseSetMethod) == null) { + AdaptationGrpc.getCreatePhraseSetMethod = getCreatePhraseSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreatePhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("CreatePhraseSet")) + .build(); + } + } + } + return getCreatePhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetPhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetPhraseSet", + requestType = com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.PhraseSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetPhraseSetMethod() { + io.grpc.MethodDescriptor getGetPhraseSetMethod; + if ((getGetPhraseSetMethod = AdaptationGrpc.getGetPhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getGetPhraseSetMethod = AdaptationGrpc.getGetPhraseSetMethod) == null) { + AdaptationGrpc.getGetPhraseSetMethod = getGetPhraseSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("GetPhraseSet")) + .build(); + } + } + } + return getGetPhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor getListPhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListPhraseSet", + requestType = com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListPhraseSetMethod() { + io.grpc.MethodDescriptor getListPhraseSetMethod; + if ((getListPhraseSetMethod = AdaptationGrpc.getListPhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getListPhraseSetMethod = AdaptationGrpc.getListPhraseSetMethod) == null) { + AdaptationGrpc.getListPhraseSetMethod = getListPhraseSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("ListPhraseSet")) + .build(); + } + } + } + return getListPhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor getUpdatePhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdatePhraseSet", + requestType = com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.PhraseSet.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getUpdatePhraseSetMethod() { + io.grpc.MethodDescriptor getUpdatePhraseSetMethod; + if ((getUpdatePhraseSetMethod = AdaptationGrpc.getUpdatePhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getUpdatePhraseSetMethod = AdaptationGrpc.getUpdatePhraseSetMethod) == null) { + AdaptationGrpc.getUpdatePhraseSetMethod = getUpdatePhraseSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdatePhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("UpdatePhraseSet")) + .build(); + } + } + } + return getUpdatePhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeletePhraseSetMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeletePhraseSet", + requestType = com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeletePhraseSetMethod() { + io.grpc.MethodDescriptor getDeletePhraseSetMethod; + if ((getDeletePhraseSetMethod = AdaptationGrpc.getDeletePhraseSetMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getDeletePhraseSetMethod = AdaptationGrpc.getDeletePhraseSetMethod) == null) { + AdaptationGrpc.getDeletePhraseSetMethod = getDeletePhraseSetMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeletePhraseSet")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("DeletePhraseSet")) + .build(); + } + } + } + return getDeletePhraseSetMethod; + } + + private static volatile io.grpc.MethodDescriptor getCreateCustomClassMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateCustomClass", + requestType = com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.CustomClass.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getCreateCustomClassMethod() { + io.grpc.MethodDescriptor getCreateCustomClassMethod; + if ((getCreateCustomClassMethod = AdaptationGrpc.getCreateCustomClassMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getCreateCustomClassMethod = AdaptationGrpc.getCreateCustomClassMethod) == null) { + AdaptationGrpc.getCreateCustomClassMethod = getCreateCustomClassMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCustomClass")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("CreateCustomClass")) + .build(); + } + } + } + return getCreateCustomClassMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetCustomClassMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCustomClass", + requestType = com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.CustomClass.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetCustomClassMethod() { + io.grpc.MethodDescriptor getGetCustomClassMethod; + if ((getGetCustomClassMethod = AdaptationGrpc.getGetCustomClassMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getGetCustomClassMethod = AdaptationGrpc.getGetCustomClassMethod) == null) { + AdaptationGrpc.getGetCustomClassMethod = getGetCustomClassMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCustomClass")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("GetCustomClass")) + .build(); + } + } + } + return getGetCustomClassMethod; + } + + private static volatile io.grpc.MethodDescriptor getListCustomClassesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListCustomClasses", + requestType = com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListCustomClassesMethod() { + io.grpc.MethodDescriptor getListCustomClassesMethod; + if ((getListCustomClassesMethod = AdaptationGrpc.getListCustomClassesMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getListCustomClassesMethod = AdaptationGrpc.getListCustomClassesMethod) == null) { + AdaptationGrpc.getListCustomClassesMethod = getListCustomClassesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCustomClasses")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("ListCustomClasses")) + .build(); + } + } + } + return getListCustomClassesMethod; + } + + private static volatile io.grpc.MethodDescriptor getUpdateCustomClassMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCustomClass", + requestType = com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.CustomClass.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getUpdateCustomClassMethod() { + io.grpc.MethodDescriptor getUpdateCustomClassMethod; + if ((getUpdateCustomClassMethod = AdaptationGrpc.getUpdateCustomClassMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getUpdateCustomClassMethod = AdaptationGrpc.getUpdateCustomClassMethod) == null) { + AdaptationGrpc.getUpdateCustomClassMethod = getUpdateCustomClassMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCustomClass")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("UpdateCustomClass")) + .build(); + } + } + } + return getUpdateCustomClassMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteCustomClassMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCustomClass", + requestType = com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteCustomClassMethod() { + io.grpc.MethodDescriptor getDeleteCustomClassMethod; + if ((getDeleteCustomClassMethod = AdaptationGrpc.getDeleteCustomClassMethod) == null) { + synchronized (AdaptationGrpc.class) { + if ((getDeleteCustomClassMethod = AdaptationGrpc.getDeleteCustomClassMethod) == null) { + AdaptationGrpc.getDeleteCustomClassMethod = getDeleteCustomClassMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCustomClass")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("DeleteCustomClass")) + .build(); + } + } + } + return getDeleteCustomClassMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static AdaptationStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AdaptationStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationStub(channel, callOptions); + } + }; + return AdaptationStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AdaptationBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AdaptationBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationBlockingStub(channel, callOptions); + } + }; + return AdaptationBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static AdaptationFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AdaptationFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationFutureStub(channel, callOptions); + } + }; + return AdaptationFutureStub.newStub(factory, channel); + } + + /** + *
+   * Service that implements Google Cloud Speech Adaptation API.
+   * 
+ */ + public static abstract class AdaptationImplBase implements io.grpc.BindableService { + + /** + *
+     * Create a set of phrase hints. Each item in the set can be a single word or
+     * a multi-word phrase. The items in the PhraseSet are favored by the
+     * recognition model when you send a call that includes the PhraseSet.
+     * 
+ */ + public void createPhraseSet(com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreatePhraseSetMethod(), responseObserver); + } + + /** + *
+     * Get a phrase set.
+     * 
+ */ + public void getPhraseSet(com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPhraseSetMethod(), responseObserver); + } + + /** + *
+     * List phrase sets.
+     * 
+ */ + public void listPhraseSet(com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListPhraseSetMethod(), responseObserver); + } + + /** + *
+     * Update a phrase set.
+     * 
+ */ + public void updatePhraseSet(com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdatePhraseSetMethod(), responseObserver); + } + + /** + *
+     * Delete a phrase set.
+     * 
+ */ + public void deletePhraseSet(com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeletePhraseSetMethod(), responseObserver); + } + + /** + *
+     * Create a custom class.
+     * 
+ */ + public void createCustomClass(com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateCustomClassMethod(), responseObserver); + } + + /** + *
+     * Get a custom class.
+     * 
+ */ + public void getCustomClass(com.google.cloud.speech.v1p1beta1.GetCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetCustomClassMethod(), responseObserver); + } + + /** + *
+     * List custom classes.
+     * 
+ */ + public void listCustomClasses(com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListCustomClassesMethod(), responseObserver); + } + + /** + *
+     * Update a custom class.
+     * 
+ */ + public void updateCustomClass(com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateCustomClassMethod(), responseObserver); + } + + /** + *
+     * Delete a custom class.
+     * 
+ */ + public void deleteCustomClass(com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteCustomClassMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreatePhraseSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet>( + this, METHODID_CREATE_PHRASE_SET))) + .addMethod( + getGetPhraseSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet>( + this, METHODID_GET_PHRASE_SET))) + .addMethod( + getListPhraseSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest, + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse>( + this, METHODID_LIST_PHRASE_SET))) + .addMethod( + getUpdatePhraseSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest, + com.google.cloud.speech.v1p1beta1.PhraseSet>( + this, METHODID_UPDATE_PHRASE_SET))) + .addMethod( + getDeletePhraseSetMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_PHRASE_SET))) + .addMethod( + getCreateCustomClassMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass>( + this, METHODID_CREATE_CUSTOM_CLASS))) + .addMethod( + getGetCustomClassMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass>( + this, METHODID_GET_CUSTOM_CLASS))) + .addMethod( + getListCustomClassesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest, + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse>( + this, METHODID_LIST_CUSTOM_CLASSES))) + .addMethod( + getUpdateCustomClassMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest, + com.google.cloud.speech.v1p1beta1.CustomClass>( + this, METHODID_UPDATE_CUSTOM_CLASS))) + .addMethod( + getDeleteCustomClassMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_CUSTOM_CLASS))) + .build(); + } + } + + /** + *
+   * Service that implements Google Cloud Speech Adaptation API.
+   * 
+ */ + public static final class AdaptationStub extends io.grpc.stub.AbstractAsyncStub { + private AdaptationStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AdaptationStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationStub(channel, callOptions); + } + + /** + *
+     * Create a set of phrase hints. Each item in the set can be a single word or
+     * a multi-word phrase. The items in the PhraseSet are favored by the
+     * recognition model when you send a call that includes the PhraseSet.
+     * 
+ */ + public void createPhraseSet(com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreatePhraseSetMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Get a phrase set.
+     * 
+ */ + public void getPhraseSet(com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetPhraseSetMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * List phrase sets.
+     * 
+ */ + public void listPhraseSet(com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListPhraseSetMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Update a phrase set.
+     * 
+ */ + public void updatePhraseSet(com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdatePhraseSetMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Delete a phrase set.
+     * 
+ */ + public void deletePhraseSet(com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeletePhraseSetMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Create a custom class.
+     * 
+ */ + public void createCustomClass(com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateCustomClassMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Get a custom class.
+     * 
+ */ + public void getCustomClass(com.google.cloud.speech.v1p1beta1.GetCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetCustomClassMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * List custom classes.
+     * 
+ */ + public void listCustomClasses(com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListCustomClassesMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Update a custom class.
+     * 
+ */ + public void updateCustomClass(com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateCustomClassMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Delete a custom class.
+     * 
+ */ + public void deleteCustomClass(com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteCustomClassMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * Service that implements Google Cloud Speech Adaptation API.
+   * 
+ */ + public static final class AdaptationBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private AdaptationBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AdaptationBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationBlockingStub(channel, callOptions); + } + + /** + *
+     * Create a set of phrase hints. Each item in the set can be a single word or
+     * a multi-word phrase. The items in the PhraseSet are favored by the
+     * recognition model when you send a call that includes the PhraseSet.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.PhraseSet createPhraseSet(com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreatePhraseSetMethod(), getCallOptions(), request); + } + + /** + *
+     * Get a phrase set.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet(com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetPhraseSetMethod(), getCallOptions(), request); + } + + /** + *
+     * List phrase sets.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse listPhraseSet(com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListPhraseSetMethod(), getCallOptions(), request); + } + + /** + *
+     * Update a phrase set.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.PhraseSet updatePhraseSet(com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdatePhraseSetMethod(), getCallOptions(), request); + } + + /** + *
+     * Delete a phrase set.
+     * 
+ */ + public com.google.protobuf.Empty deletePhraseSet(com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeletePhraseSetMethod(), getCallOptions(), request); + } + + /** + *
+     * Create a custom class.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.CustomClass createCustomClass(com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateCustomClassMethod(), getCallOptions(), request); + } + + /** + *
+     * Get a custom class.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass(com.google.cloud.speech.v1p1beta1.GetCustomClassRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetCustomClassMethod(), getCallOptions(), request); + } + + /** + *
+     * List custom classes.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse listCustomClasses(com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListCustomClassesMethod(), getCallOptions(), request); + } + + /** + *
+     * Update a custom class.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.CustomClass updateCustomClass(com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateCustomClassMethod(), getCallOptions(), request); + } + + /** + *
+     * Delete a custom class.
+     * 
+ */ + public com.google.protobuf.Empty deleteCustomClass(com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteCustomClassMethod(), getCallOptions(), request); + } + } + + /** + *
+   * Service that implements Google Cloud Speech Adaptation API.
+   * 
+ */ + public static final class AdaptationFutureStub extends io.grpc.stub.AbstractFutureStub { + private AdaptationFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AdaptationFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AdaptationFutureStub(channel, callOptions); + } + + /** + *
+     * Create a set of phrase hints. Each item in the set can be a single word or
+     * a multi-word phrase. The items in the PhraseSet are favored by the
+     * recognition model when you send a call that includes the PhraseSet.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createPhraseSet( + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreatePhraseSetMethod(), getCallOptions()), request); + } + + /** + *
+     * Get a phrase set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getPhraseSet( + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetPhraseSetMethod(), getCallOptions()), request); + } + + /** + *
+     * List phrase sets.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listPhraseSet( + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListPhraseSetMethod(), getCallOptions()), request); + } + + /** + *
+     * Update a phrase set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updatePhraseSet( + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdatePhraseSetMethod(), getCallOptions()), request); + } + + /** + *
+     * Delete a phrase set.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deletePhraseSet( + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeletePhraseSetMethod(), getCallOptions()), request); + } + + /** + *
+     * Create a custom class.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createCustomClass( + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateCustomClassMethod(), getCallOptions()), request); + } + + /** + *
+     * Get a custom class.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getCustomClass( + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetCustomClassMethod(), getCallOptions()), request); + } + + /** + *
+     * List custom classes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listCustomClasses( + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListCustomClassesMethod(), getCallOptions()), request); + } + + /** + *
+     * Update a custom class.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateCustomClass( + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateCustomClassMethod(), getCallOptions()), request); + } + + /** + *
+     * Delete a custom class.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteCustomClass( + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteCustomClassMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_PHRASE_SET = 0; + private static final int METHODID_GET_PHRASE_SET = 1; + private static final int METHODID_LIST_PHRASE_SET = 2; + private static final int METHODID_UPDATE_PHRASE_SET = 3; + private static final int METHODID_DELETE_PHRASE_SET = 4; + private static final int METHODID_CREATE_CUSTOM_CLASS = 5; + private static final int METHODID_GET_CUSTOM_CLASS = 6; + private static final int METHODID_LIST_CUSTOM_CLASSES = 7; + private static final int METHODID_UPDATE_CUSTOM_CLASS = 8; + private static final int METHODID_DELETE_CUSTOM_CLASS = 9; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AdaptationImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AdaptationImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_PHRASE_SET: + serviceImpl.createPhraseSet((com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_PHRASE_SET: + serviceImpl.getPhraseSet((com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_PHRASE_SET: + serviceImpl.listPhraseSet((com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_PHRASE_SET: + serviceImpl.updatePhraseSet((com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_PHRASE_SET: + serviceImpl.deletePhraseSet((com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_CUSTOM_CLASS: + serviceImpl.createCustomClass((com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_CUSTOM_CLASS: + serviceImpl.getCustomClass((com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_CUSTOM_CLASSES: + serviceImpl.listCustomClasses((com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_CUSTOM_CLASS: + serviceImpl.updateCustomClass((com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CUSTOM_CLASS: + serviceImpl.deleteCustomClass((com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class AdaptationBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AdaptationBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Adaptation"); + } + } + + private static final class AdaptationFileDescriptorSupplier + extends AdaptationBaseDescriptorSupplier { + AdaptationFileDescriptorSupplier() {} + } + + private static final class AdaptationMethodDescriptorSupplier + extends AdaptationBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AdaptationMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (AdaptationGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AdaptationFileDescriptorSupplier()) + .addMethod(getCreatePhraseSetMethod()) + .addMethod(getGetPhraseSetMethod()) + .addMethod(getListPhraseSetMethod()) + .addMethod(getUpdatePhraseSetMethod()) + .addMethod(getDeletePhraseSetMethod()) + .addMethod(getCreateCustomClassMethod()) + .addMethod(getGetCustomClassMethod()) + .addMethod(getListCustomClassesMethod()) + .addMethod(getUpdateCustomClassMethod()) + .addMethod(getDeleteCustomClassMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java b/owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java new file mode 100644 index 000000000000..5879fdc4465f --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java @@ -0,0 +1,479 @@ +package com.google.cloud.speech.v1p1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + *
+ * Service that implements Google Cloud Speech API.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/speech/v1p1beta1/cloud_speech.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class SpeechGrpc { + + private SpeechGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.speech.v1p1beta1.Speech"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getRecognizeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Recognize", + requestType = com.google.cloud.speech.v1p1beta1.RecognizeRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.RecognizeResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getRecognizeMethod() { + io.grpc.MethodDescriptor getRecognizeMethod; + if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { + synchronized (SpeechGrpc.class) { + if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { + SpeechGrpc.getRecognizeMethod = getRecognizeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Recognize")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.RecognizeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.RecognizeResponse.getDefaultInstance())) + .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("Recognize")) + .build(); + } + } + } + return getRecognizeMethod; + } + + private static volatile io.grpc.MethodDescriptor getLongRunningRecognizeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "LongRunningRecognize", + requestType = com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getLongRunningRecognizeMethod() { + io.grpc.MethodDescriptor getLongRunningRecognizeMethod; + if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { + synchronized (SpeechGrpc.class) { + if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { + SpeechGrpc.getLongRunningRecognizeMethod = getLongRunningRecognizeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "LongRunningRecognize")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("LongRunningRecognize")) + .build(); + } + } + } + return getLongRunningRecognizeMethod; + } + + private static volatile io.grpc.MethodDescriptor getStreamingRecognizeMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamingRecognize", + requestType = com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.class, + responseType = com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor getStreamingRecognizeMethod() { + io.grpc.MethodDescriptor getStreamingRecognizeMethod; + if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { + synchronized (SpeechGrpc.class) { + if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { + SpeechGrpc.getStreamingRecognizeMethod = getStreamingRecognizeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamingRecognize")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.getDefaultInstance())) + .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("StreamingRecognize")) + .build(); + } + } + } + return getStreamingRecognizeMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static SpeechStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SpeechStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SpeechStub(channel, callOptions); + } + }; + return SpeechStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static SpeechBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SpeechBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SpeechBlockingStub(channel, callOptions); + } + }; + return SpeechBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static SpeechFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SpeechFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SpeechFutureStub(channel, callOptions); + } + }; + return SpeechFutureStub.newStub(factory, channel); + } + + /** + *
+   * Service that implements Google Cloud Speech API.
+   * 
+ */ + public static abstract class SpeechImplBase implements io.grpc.BindableService { + + /** + *
+     * Performs synchronous speech recognition: receive results after all audio
+     * has been sent and processed.
+     * 
+ */ + public void recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRecognizeMethod(), responseObserver); + } + + /** + *
+     * Performs asynchronous speech recognition: receive results via the
+     * google.longrunning.Operations interface. Returns either an
+     * `Operation.error` or an `Operation.response` which contains
+     * a `LongRunningRecognizeResponse` message.
+     * For more information on asynchronous speech recognition, see the
+     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
+     * 
+ */ + public void longRunningRecognize(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getLongRunningRecognizeMethod(), responseObserver); + } + + /** + *
+     * Performs bidirectional streaming speech recognition: receive results while
+     * sending audio. This method is only available via the gRPC API (not REST).
+     * 
+ */ + public io.grpc.stub.StreamObserver streamingRecognize( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamingRecognizeMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getRecognizeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.RecognizeRequest, + com.google.cloud.speech.v1p1beta1.RecognizeResponse>( + this, METHODID_RECOGNIZE))) + .addMethod( + getLongRunningRecognizeMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest, + com.google.longrunning.Operation>( + this, METHODID_LONG_RUNNING_RECOGNIZE))) + .addMethod( + getStreamingRecognizeMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest, + com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse>( + this, METHODID_STREAMING_RECOGNIZE))) + .build(); + } + } + + /** + *
+   * Service that implements Google Cloud Speech API.
+   * 
+ */ + public static final class SpeechStub extends io.grpc.stub.AbstractAsyncStub { + private SpeechStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SpeechStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SpeechStub(channel, callOptions); + } + + /** + *
+     * Performs synchronous speech recognition: receive results after all audio
+     * has been sent and processed.
+     * 
+ */ + public void recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRecognizeMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Performs asynchronous speech recognition: receive results via the
+     * google.longrunning.Operations interface. Returns either an
+     * `Operation.error` or an `Operation.response` which contains
+     * a `LongRunningRecognizeResponse` message.
+     * For more information on asynchronous speech recognition, see the
+     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
+     * 
+ */ + public void longRunningRecognize(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Performs bidirectional streaming speech recognition: receive results while
+     * sending audio. This method is only available via the gRPC API (not REST).
+     * 
+ */ + public io.grpc.stub.StreamObserver streamingRecognize( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getStreamingRecognizeMethod(), getCallOptions()), responseObserver); + } + } + + /** + *
+   * Service that implements Google Cloud Speech API.
+   * 
+ */ + public static final class SpeechBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private SpeechBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SpeechBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SpeechBlockingStub(channel, callOptions); + } + + /** + *
+     * Performs synchronous speech recognition: receive results after all audio
+     * has been sent and processed.
+     * 
+ */ + public com.google.cloud.speech.v1p1beta1.RecognizeResponse recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRecognizeMethod(), getCallOptions(), request); + } + + /** + *
+     * Performs asynchronous speech recognition: receive results via the
+     * google.longrunning.Operations interface. Returns either an
+     * `Operation.error` or an `Operation.response` which contains
+     * a `LongRunningRecognizeResponse` message.
+     * For more information on asynchronous speech recognition, see the
+     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
+     * 
+ */ + public com.google.longrunning.Operation longRunningRecognize(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getLongRunningRecognizeMethod(), getCallOptions(), request); + } + } + + /** + *
+   * Service that implements Google Cloud Speech API.
+   * 
+ */ + public static final class SpeechFutureStub extends io.grpc.stub.AbstractFutureStub { + private SpeechFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SpeechFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SpeechFutureStub(channel, callOptions); + } + + /** + *
+     * Performs synchronous speech recognition: receive results after all audio
+     * has been sent and processed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture recognize( + com.google.cloud.speech.v1p1beta1.RecognizeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRecognizeMethod(), getCallOptions()), request); + } + + /** + *
+     * Performs asynchronous speech recognition: receive results via the
+     * google.longrunning.Operations interface. Returns either an
+     * `Operation.error` or an `Operation.response` which contains
+     * a `LongRunningRecognizeResponse` message.
+     * For more information on asynchronous speech recognition, see the
+     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture longRunningRecognize( + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_RECOGNIZE = 0; + private static final int METHODID_LONG_RUNNING_RECOGNIZE = 1; + private static final int METHODID_STREAMING_RECOGNIZE = 2; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final SpeechImplBase serviceImpl; + private final int methodId; + + MethodHandlers(SpeechImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_RECOGNIZE: + serviceImpl.recognize((com.google.cloud.speech.v1p1beta1.RecognizeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LONG_RUNNING_RECOGNIZE: + serviceImpl.longRunningRecognize((com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_STREAMING_RECOGNIZE: + return (io.grpc.stub.StreamObserver) serviceImpl.streamingRecognize( + (io.grpc.stub.StreamObserver) responseObserver); + default: + throw new AssertionError(); + } + } + } + + private static abstract class SpeechBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + SpeechBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Speech"); + } + } + + private static final class SpeechFileDescriptorSupplier + extends SpeechBaseDescriptorSupplier { + SpeechFileDescriptorSupplier() {} + } + + private static final class SpeechMethodDescriptorSupplier + extends SpeechBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + SpeechMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (SpeechGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new SpeechFileDescriptorSupplier()) + .addMethod(getRecognizeMethod()) + .addMethod(getLongRunningRecognizeMethod()) + .addMethod(getStreamingRecognizeMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java new file mode 100644 index 000000000000..8abd54116fdb --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java @@ -0,0 +1,1060 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Message sent by the client for the `CreateCustomClass` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.CreateCustomClassRequest} + */ +public final class CreateCustomClassRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) + CreateCustomClassRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateCustomClassRequest.newBuilder() to construct. + private CreateCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateCustomClassRequest() { + parent_ = ""; + customClassId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CreateCustomClassRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateCustomClassRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + customClassId_ = s; + break; + } + case 26: { + com.google.cloud.speech.v1p1beta1.CustomClass.Builder subBuilder = null; + if (customClass_ != null) { + subBuilder = customClass_.toBuilder(); + } + customClass_ = input.readMessage(com.google.cloud.speech.v1p1beta1.CustomClass.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(customClass_); + customClass_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent resource where this custom class will be created. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent resource where this custom class will be created. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_CLASS_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object customClassId_; + /** + *
+   * Required. The ID to use for the custom class, which will become the final
+   * component of the custom class' resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClassId. + */ + @java.lang.Override + public java.lang.String getCustomClassId() { + java.lang.Object ref = customClassId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customClassId_ = s; + return s; + } + } + /** + *
+   * Required. The ID to use for the custom class, which will become the final
+   * component of the custom class' resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for customClassId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCustomClassIdBytes() { + java.lang.Object ref = customClassId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + customClassId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_CLASS_FIELD_NUMBER = 3; + private com.google.cloud.speech.v1p1beta1.CustomClass customClass_; + /** + *
+   * Required. The custom class to create.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the customClass field is set. + */ + @java.lang.Override + public boolean hasCustomClass() { + return customClass_ != null; + } + /** + *
+   * Required. The custom class to create.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClass. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass() { + return customClass_ == null ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() : customClass_; + } + /** + *
+   * Required. The custom class to create.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder() { + return getCustomClass(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, customClassId_); + } + if (customClass_ != null) { + output.writeMessage(3, getCustomClass()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, customClassId_); + } + if (customClass_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getCustomClass()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest other = (com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (!getCustomClassId() + .equals(other.getCustomClassId())) return false; + if (hasCustomClass() != other.hasCustomClass()) return false; + if (hasCustomClass()) { + if (!getCustomClass() + .equals(other.getCustomClass())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + CUSTOM_CLASS_ID_FIELD_NUMBER; + hash = (53 * hash) + getCustomClassId().hashCode(); + if (hasCustomClass()) { + hash = (37 * hash) + CUSTOM_CLASS_FIELD_NUMBER; + hash = (53 * hash) + getCustomClass().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `CreateCustomClass` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.CreateCustomClassRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + customClassId_ = ""; + + if (customClassBuilder_ == null) { + customClass_ = null; + } else { + customClass_ = null; + customClassBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest build() { + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest result = new com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest(this); + result.parent_ = parent_; + result.customClassId_ = customClassId_; + if (customClassBuilder_ == null) { + result.customClass_ = customClass_; + } else { + result.customClass_ = customClassBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getCustomClassId().isEmpty()) { + customClassId_ = other.customClassId_; + onChanged(); + } + if (other.hasCustomClass()) { + mergeCustomClass(other.getCustomClass()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent resource where this custom class will be created. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent resource where this custom class will be created. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent resource where this custom class will be created. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource where this custom class will be created. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource where this custom class will be created. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object customClassId_ = ""; + /** + *
+     * Required. The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClassId. + */ + public java.lang.String getCustomClassId() { + java.lang.Object ref = customClassId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customClassId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for customClassId. + */ + public com.google.protobuf.ByteString + getCustomClassIdBytes() { + java.lang.Object ref = customClassId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + customClassId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param value The customClassId to set. + * @return This builder for chaining. + */ + public Builder setCustomClassId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + customClassId_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearCustomClassId() { + + customClassId_ = getDefaultInstance().getCustomClassId(); + onChanged(); + return this; + } + /** + *
+     * Required. The ID to use for the custom class, which will become the final
+     * component of the custom class' resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for customClassId to set. + * @return This builder for chaining. + */ + public Builder setCustomClassIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + customClassId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.speech.v1p1beta1.CustomClass customClass_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> customClassBuilder_; + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the customClass field is set. + */ + public boolean hasCustomClass() { + return customClassBuilder_ != null || customClass_ != null; + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClass. + */ + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass() { + if (customClassBuilder_ == null) { + return customClass_ == null ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() : customClass_; + } else { + return customClassBuilder_.getMessage(); + } + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setCustomClass(com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customClass_ = value; + onChanged(); + } else { + customClassBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setCustomClass( + com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassBuilder_ == null) { + customClass_ = builderForValue.build(); + onChanged(); + } else { + customClassBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeCustomClass(com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassBuilder_ == null) { + if (customClass_ != null) { + customClass_ = + com.google.cloud.speech.v1p1beta1.CustomClass.newBuilder(customClass_).mergeFrom(value).buildPartial(); + } else { + customClass_ = value; + } + onChanged(); + } else { + customClassBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearCustomClass() { + if (customClassBuilder_ == null) { + customClass_ = null; + onChanged(); + } else { + customClass_ = null; + customClassBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassBuilder() { + + onChanged(); + return getCustomClassFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder() { + if (customClassBuilder_ != null) { + return customClassBuilder_.getMessageOrBuilder(); + } else { + return customClass_ == null ? + com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() : customClass_; + } + } + /** + *
+     * Required. The custom class to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> + getCustomClassFieldBuilder() { + if (customClassBuilder_ == null) { + customClassBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( + getCustomClass(), + getParentForChildren(), + isClean()); + customClass_ = null; + } + return customClassBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) + private static final com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateCustomClassRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateCustomClassRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java new file mode 100644 index 000000000000..a042d191704a --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java @@ -0,0 +1,94 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface CreateCustomClassRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent resource where this custom class will be created. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent resource where this custom class will be created. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Required. The ID to use for the custom class, which will become the final
+   * component of the custom class' resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClassId. + */ + java.lang.String getCustomClassId(); + /** + *
+   * Required. The ID to use for the custom class, which will become the final
+   * component of the custom class' resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for customClassId. + */ + com.google.protobuf.ByteString + getCustomClassIdBytes(); + + /** + *
+   * Required. The custom class to create.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the customClass field is set. + */ + boolean hasCustomClass(); + /** + *
+   * Required. The custom class to create.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClass. + */ + com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass(); + /** + *
+   * Required. The custom class to create.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java new file mode 100644 index 000000000000..c4450fceb5eb --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java @@ -0,0 +1,1060 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Message sent by the client for the `CreatePhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} + */ +public final class CreatePhraseSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) + CreatePhraseSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreatePhraseSetRequest.newBuilder() to construct. + private CreatePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreatePhraseSetRequest() { + parent_ = ""; + phraseSetId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CreatePhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreatePhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + phraseSetId_ = s; + break; + } + case 26: { + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder subBuilder = null; + if (phraseSet_ != null) { + subBuilder = phraseSet_.toBuilder(); + } + phraseSet_ = input.readMessage(com.google.cloud.speech.v1p1beta1.PhraseSet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(phraseSet_); + phraseSet_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent resource where this phrase set will be created. Format:
+   * `projects/{project}/locations/{location}/phraseSets`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent resource where this phrase set will be created. Format:
+   * `projects/{project}/locations/{location}/phraseSets`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PHRASE_SET_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object phraseSetId_; + /** + *
+   * Required. The ID to use for the phrase set, which will become the final
+   * component of the phrase set's resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSetId. + */ + @java.lang.Override + public java.lang.String getPhraseSetId() { + java.lang.Object ref = phraseSetId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + phraseSetId_ = s; + return s; + } + } + /** + *
+   * Required. The ID to use for the phrase set, which will become the final
+   * component of the phrase set's resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for phraseSetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPhraseSetIdBytes() { + java.lang.Object ref = phraseSetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + phraseSetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PHRASE_SET_FIELD_NUMBER = 3; + private com.google.cloud.speech.v1p1beta1.PhraseSet phraseSet_; + /** + *
+   * Required. The phrase set to create.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the phraseSet field is set. + */ + @java.lang.Override + public boolean hasPhraseSet() { + return phraseSet_ != null; + } + /** + *
+   * Required. The phrase set to create.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSet. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet() { + return phraseSet_ == null ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() : phraseSet_; + } + /** + *
+   * Required. The phrase set to create.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder() { + return getPhraseSet(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(phraseSetId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, phraseSetId_); + } + if (phraseSet_ != null) { + output.writeMessage(3, getPhraseSet()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(phraseSetId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, phraseSetId_); + } + if (phraseSet_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getPhraseSet()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest other = (com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (!getPhraseSetId() + .equals(other.getPhraseSetId())) return false; + if (hasPhraseSet() != other.hasPhraseSet()) return false; + if (hasPhraseSet()) { + if (!getPhraseSet() + .equals(other.getPhraseSet())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PHRASE_SET_ID_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSetId().hashCode(); + if (hasPhraseSet()) { + hash = (37 * hash) + PHRASE_SET_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSet().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `CreatePhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + phraseSetId_ = ""; + + if (phraseSetBuilder_ == null) { + phraseSet_ = null; + } else { + phraseSet_ = null; + phraseSetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest build() { + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest result = new com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest(this); + result.parent_ = parent_; + result.phraseSetId_ = phraseSetId_; + if (phraseSetBuilder_ == null) { + result.phraseSet_ = phraseSet_; + } else { + result.phraseSet_ = phraseSetBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPhraseSetId().isEmpty()) { + phraseSetId_ = other.phraseSetId_; + onChanged(); + } + if (other.hasPhraseSet()) { + mergePhraseSet(other.getPhraseSet()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent resource where this phrase set will be created. Format:
+     * `projects/{project}/locations/{location}/phraseSets`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent resource where this phrase set will be created. Format:
+     * `projects/{project}/locations/{location}/phraseSets`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent resource where this phrase set will be created. Format:
+     * `projects/{project}/locations/{location}/phraseSets`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource where this phrase set will be created. Format:
+     * `projects/{project}/locations/{location}/phraseSets`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent resource where this phrase set will be created. Format:
+     * `projects/{project}/locations/{location}/phraseSets`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object phraseSetId_ = ""; + /** + *
+     * Required. The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSetId. + */ + public java.lang.String getPhraseSetId() { + java.lang.Object ref = phraseSetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + phraseSetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for phraseSetId. + */ + public com.google.protobuf.ByteString + getPhraseSetIdBytes() { + java.lang.Object ref = phraseSetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + phraseSetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param value The phraseSetId to set. + * @return This builder for chaining. + */ + public Builder setPhraseSetId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + phraseSetId_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearPhraseSetId() { + + phraseSetId_ = getDefaultInstance().getPhraseSetId(); + onChanged(); + return this; + } + /** + *
+     * Required. The ID to use for the phrase set, which will become the final
+     * component of the phrase set's resource name.
+     * This value should restrict to letters, numbers, and hyphens, with the first
+     * character a letter, the last a letter or a number, and be 4-63 characters.
+     * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for phraseSetId to set. + * @return This builder for chaining. + */ + public Builder setPhraseSetIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + phraseSetId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.speech.v1p1beta1.PhraseSet phraseSet_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> phraseSetBuilder_; + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the phraseSet field is set. + */ + public boolean hasPhraseSet() { + return phraseSetBuilder_ != null || phraseSet_ != null; + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSet. + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet() { + if (phraseSetBuilder_ == null) { + return phraseSet_ == null ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() : phraseSet_; + } else { + return phraseSetBuilder_.getMessage(); + } + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPhraseSet(com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + phraseSet_ = value; + onChanged(); + } else { + phraseSetBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPhraseSet( + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetBuilder_ == null) { + phraseSet_ = builderForValue.build(); + onChanged(); + } else { + phraseSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergePhraseSet(com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetBuilder_ == null) { + if (phraseSet_ != null) { + phraseSet_ = + com.google.cloud.speech.v1p1beta1.PhraseSet.newBuilder(phraseSet_).mergeFrom(value).buildPartial(); + } else { + phraseSet_ = value; + } + onChanged(); + } else { + phraseSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearPhraseSet() { + if (phraseSetBuilder_ == null) { + phraseSet_ = null; + onChanged(); + } else { + phraseSet_ = null; + phraseSetBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder getPhraseSetBuilder() { + + onChanged(); + return getPhraseSetFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder() { + if (phraseSetBuilder_ != null) { + return phraseSetBuilder_.getMessageOrBuilder(); + } else { + return phraseSet_ == null ? + com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() : phraseSet_; + } + } + /** + *
+     * Required. The phrase set to create.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> + getPhraseSetFieldBuilder() { + if (phraseSetBuilder_ == null) { + phraseSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder>( + getPhraseSet(), + getParentForChildren(), + isClean()); + phraseSet_ = null; + } + return phraseSetBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) + private static final com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreatePhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreatePhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java new file mode 100644 index 000000000000..e21aaa6f933a --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java @@ -0,0 +1,94 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface CreatePhraseSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent resource where this phrase set will be created. Format:
+   * `projects/{project}/locations/{location}/phraseSets`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent resource where this phrase set will be created. Format:
+   * `projects/{project}/locations/{location}/phraseSets`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Required. The ID to use for the phrase set, which will become the final
+   * component of the phrase set's resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSetId. + */ + java.lang.String getPhraseSetId(); + /** + *
+   * Required. The ID to use for the phrase set, which will become the final
+   * component of the phrase set's resource name.
+   * This value should restrict to letters, numbers, and hyphens, with the first
+   * character a letter, the last a letter or a number, and be 4-63 characters.
+   * 
+ * + * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for phraseSetId. + */ + com.google.protobuf.ByteString + getPhraseSetIdBytes(); + + /** + *
+   * Required. The phrase set to create.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the phraseSet field is set. + */ + boolean hasPhraseSet(); + /** + *
+   * Required. The phrase set to create.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSet. + */ + com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet(); + /** + *
+   * Required. The phrase set to create.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java new file mode 100644 index 000000000000..5ffa435fe8f2 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java @@ -0,0 +1,1829 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/resource.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * A set of words or phrases that represents a common concept likely to appear
+ * in your audio, for example a list of passenger ship names. CustomClass items
+ * can be substituted into placeholders that you set in PhraseSet phrases.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.CustomClass} + */ +public final class CustomClass extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.CustomClass) + CustomClassOrBuilder { +private static final long serialVersionUID = 0L; + // Use CustomClass.newBuilder() to construct. + private CustomClass(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CustomClass() { + name_ = ""; + customClassId_ = ""; + items_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CustomClass(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CustomClass( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + customClassId_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + items_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.CustomClass.class, com.google.cloud.speech.v1p1beta1.CustomClass.Builder.class); + } + + public interface ClassItemOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The class item's value.
+     * 
+ * + * string value = 1; + * @return The value. + */ + java.lang.String getValue(); + /** + *
+     * The class item's value.
+     * 
+ * + * string value = 1; + * @return The bytes for value. + */ + com.google.protobuf.ByteString + getValueBytes(); + } + /** + *
+   * An item of the class.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.CustomClass.ClassItem} + */ + public static final class ClassItem extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) + ClassItemOrBuilder { + private static final long serialVersionUID = 0L; + // Use ClassItem.newBuilder() to construct. + private ClassItem(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ClassItem() { + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ClassItem(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ClassItem( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.class, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private volatile java.lang.Object value_; + /** + *
+     * The class item's value.
+     * 
+ * + * string value = 1; + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + *
+     * The class item's value.
+     * 
+ * + * string value = 1; + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem other = (com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem) obj; + + if (!getValue() + .equals(other.getValue())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * An item of the class.
+     * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.CustomClass.ClassItem} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.class, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + value_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem build() { + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem buildPartial() { + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem result = new com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem(this); + result.value_ = value_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem other) { + if (other == com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.getDefaultInstance()) return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object value_ = ""; + /** + *
+       * The class item's value.
+       * 
+ * + * string value = 1; + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The class item's value.
+       * 
+ * + * string value = 1; + * @return The bytes for value. + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The class item's value.
+       * 
+ * + * string value = 1; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + *
+       * The class item's value.
+       * 
+ * + * string value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + *
+       * The class item's value.
+       * 
+ * + * string value = 1; + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) + private static final com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem(); + } + + public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ClassItem parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClassItem(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the custom class.
+   * 
+ * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The resource name of the custom class.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_CLASS_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object customClassId_; + /** + *
+   * If this custom class is a resource, the custom_class_id is the resource id
+   * of the CustomClass. Case sensitive.
+   * 
+ * + * string custom_class_id = 2; + * @return The customClassId. + */ + @java.lang.Override + public java.lang.String getCustomClassId() { + java.lang.Object ref = customClassId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customClassId_ = s; + return s; + } + } + /** + *
+   * If this custom class is a resource, the custom_class_id is the resource id
+   * of the CustomClass. Case sensitive.
+   * 
+ * + * string custom_class_id = 2; + * @return The bytes for customClassId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getCustomClassIdBytes() { + java.lang.Object ref = customClassId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + customClassId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 3; + private java.util.List items_; + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getItems(int index) { + return items_.get(index); + } + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( + int index) { + return items_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, customClassId_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(3, items_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, customClassId_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, items_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.CustomClass)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.CustomClass other = (com.google.cloud.speech.v1p1beta1.CustomClass) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getCustomClassId() + .equals(other.getCustomClassId())) return false; + if (!getItemsList() + .equals(other.getItemsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + CUSTOM_CLASS_ID_FIELD_NUMBER; + hash = (53 * hash) + getCustomClassId().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.CustomClass prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A set of words or phrases that represents a common concept likely to appear
+   * in your audio, for example a list of passenger ship names. CustomClass items
+   * can be substituted into placeholders that you set in PhraseSet phrases.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.CustomClass} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.CustomClass) + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.CustomClass.class, com.google.cloud.speech.v1p1beta1.CustomClass.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.CustomClass.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getItemsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + customClassId_ = ""; + + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + itemsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass build() { + com.google.cloud.speech.v1p1beta1.CustomClass result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass buildPartial() { + com.google.cloud.speech.v1p1beta1.CustomClass result = new com.google.cloud.speech.v1p1beta1.CustomClass(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.customClassId_ = customClassId_; + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.CustomClass) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.CustomClass)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.CustomClass other) { + if (other == com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getCustomClassId().isEmpty()) { + customClassId_ = other.customClassId_; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + itemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getItemsFieldBuilder() : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.CustomClass parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.CustomClass) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the custom class.
+     * 
+ * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name of the custom class.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name of the custom class.
+     * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name of the custom class.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the custom class.
+     * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object customClassId_ = ""; + /** + *
+     * If this custom class is a resource, the custom_class_id is the resource id
+     * of the CustomClass. Case sensitive.
+     * 
+ * + * string custom_class_id = 2; + * @return The customClassId. + */ + public java.lang.String getCustomClassId() { + java.lang.Object ref = customClassId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customClassId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * If this custom class is a resource, the custom_class_id is the resource id
+     * of the CustomClass. Case sensitive.
+     * 
+ * + * string custom_class_id = 2; + * @return The bytes for customClassId. + */ + public com.google.protobuf.ByteString + getCustomClassIdBytes() { + java.lang.Object ref = customClassId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + customClassId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * If this custom class is a resource, the custom_class_id is the resource id
+     * of the CustomClass. Case sensitive.
+     * 
+ * + * string custom_class_id = 2; + * @param value The customClassId to set. + * @return This builder for chaining. + */ + public Builder setCustomClassId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + customClassId_ = value; + onChanged(); + return this; + } + /** + *
+     * If this custom class is a resource, the custom_class_id is the resource id
+     * of the CustomClass. Case sensitive.
+     * 
+ * + * string custom_class_id = 2; + * @return This builder for chaining. + */ + public Builder clearCustomClassId() { + + customClassId_ = getDefaultInstance().getCustomClassId(); + onChanged(); + return this; + } + /** + *
+     * If this custom class is a resource, the custom_class_id is the resource id
+     * of the CustomClass. Case sensitive.
+     * 
+ * + * string custom_class_id = 2; + * @param value The bytes for customClassId to set. + * @return This builder for chaining. + */ + public Builder setCustomClassIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + customClassId_ = value; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder> itemsBuilder_; + + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public Builder setItems( + int index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public Builder setItems( + int index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public Builder addItems(com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public Builder addItems( + int index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public Builder addItems( + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public Builder addItems( + int index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder getItemsBuilder( + int index) { + return getItemsFieldBuilder().getBuilder(index); + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( + int index) { + if (itemsBuilder_ == null) { + return items_.get(index); } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder addItemsBuilder() { + return getItemsFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.getDefaultInstance()); + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder addItemsBuilder( + int index) { + return getItemsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.getDefaultInstance()); + } + /** + *
+     * A collection of class items.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + public java.util.List + getItemsBuilderList() { + return getItemsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder>( + items_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + items_ = null; + } + return itemsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.CustomClass) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.CustomClass) + private static final com.google.cloud.speech.v1p1beta1.CustomClass DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.CustomClass(); + } + + public static com.google.cloud.speech.v1p1beta1.CustomClass getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomClass parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CustomClass(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java new file mode 100644 index 000000000000..cf53d502e2b5 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java @@ -0,0 +1,227 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class CustomClassName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CUSTOM_CLASS = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/customClasses/{custom_class}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String customClass; + + @Deprecated + protected CustomClassName() { + project = null; + location = null; + customClass = null; + } + + private CustomClassName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + customClass = Preconditions.checkNotNull(builder.getCustomClass()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCustomClass() { + return customClass; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CustomClassName of(String project, String location, String customClass) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCustomClass(customClass) + .build(); + } + + public static String format(String project, String location, String customClass) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCustomClass(customClass) + .build() + .toString(); + } + + public static CustomClassName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CUSTOM_CLASS.validatedMatch( + formattedString, "CustomClassName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("custom_class")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (CustomClassName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CUSTOM_CLASS.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (customClass != null) { + fieldMapBuilder.put("custom_class", customClass); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CUSTOM_CLASS.instantiate( + "project", project, "location", location, "custom_class", customClass); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CustomClassName that = ((CustomClassName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.customClass, that.customClass); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(customClass); + return h; + } + + /** Builder for projects/{project}/locations/{location}/customClasses/{custom_class}. */ + public static class Builder { + private String project; + private String location; + private String customClass; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCustomClass() { + return customClass; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCustomClass(String customClass) { + this.customClass = customClass; + return this; + } + + private Builder(CustomClassName customClassName) { + this.project = customClassName.project; + this.location = customClassName.location; + this.customClass = customClassName.customClass; + } + + public CustomClassName build() { + return new CustomClassName(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java new file mode 100644 index 000000000000..5a2383a9cef5 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java @@ -0,0 +1,95 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/resource.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface CustomClassOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.CustomClass) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the custom class.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the custom class.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * If this custom class is a resource, the custom_class_id is the resource id
+   * of the CustomClass. Case sensitive.
+   * 
+ * + * string custom_class_id = 2; + * @return The customClassId. + */ + java.lang.String getCustomClassId(); + /** + *
+   * If this custom class is a resource, the custom_class_id is the resource id
+   * of the CustomClass. Case sensitive.
+   * 
+ * + * string custom_class_id = 2; + * @return The bytes for customClassId. + */ + com.google.protobuf.ByteString + getCustomClassIdBytes(); + + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + java.util.List + getItemsList(); + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getItems(int index); + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + int getItemsCount(); + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + java.util.List + getItemsOrBuilderList(); + /** + *
+   * A collection of class items.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; + */ + com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( + int index); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java new file mode 100644 index 000000000000..8ee08778b649 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java @@ -0,0 +1,637 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Message sent by the client for the `DeleteCustomClass` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} + */ +public final class DeleteCustomClassRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) + DeleteCustomClassRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteCustomClassRequest.newBuilder() to construct. + private DeleteCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteCustomClassRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeleteCustomClassRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteCustomClassRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The name of the custom class to delete. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The name of the custom class to delete. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest other = (com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `DeleteCustomClass` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest build() { + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest result = new com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The name of the custom class to delete. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The name of the custom class to delete. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The name of the custom class to delete. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The name of the custom class to delete. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The name of the custom class to delete. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) + private static final com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteCustomClassRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteCustomClassRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java new file mode 100644 index 000000000000..477f46c0e2f8 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface DeleteCustomClassRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The name of the custom class to delete. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Required. The name of the custom class to delete. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java new file mode 100644 index 000000000000..998916bf5c15 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java @@ -0,0 +1,602 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Message sent by the client for the `DeletePhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} + */ +public final class DeletePhraseSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) + DeletePhraseSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeletePhraseSetRequest.newBuilder() to construct. + private DeletePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeletePhraseSetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeletePhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeletePhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The name of the phrase set to delete. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The name of the phrase set to delete. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest other = (com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `DeletePhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest build() { + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest result = new com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The name of the phrase set to delete. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The name of the phrase set to delete. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The name of the phrase set to delete. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The name of the phrase set to delete. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The name of the phrase set to delete. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) + private static final com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeletePhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeletePhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java new file mode 100644 index 000000000000..246c425ca97f --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface DeletePhraseSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The name of the phrase set to delete. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Required. The name of the phrase set to delete. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java new file mode 100644 index 000000000000..9d6b0d7907f8 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java @@ -0,0 +1,602 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Message sent by the client for the `GetCustomClass` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.GetCustomClassRequest} + */ +public final class GetCustomClassRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.GetCustomClassRequest) + GetCustomClassRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetCustomClassRequest.newBuilder() to construct. + private GetCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetCustomClassRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetCustomClassRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetCustomClassRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The name of the custom class to retrieve. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The name of the custom class to retrieve. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.GetCustomClassRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest other = (com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.GetCustomClassRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `GetCustomClass` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.GetCustomClassRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.GetCustomClassRequest) + com.google.cloud.speech.v1p1beta1.GetCustomClassRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetCustomClassRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetCustomClassRequest build() { + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetCustomClassRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest result = new com.google.cloud.speech.v1p1beta1.GetCustomClassRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.GetCustomClassRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.GetCustomClassRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The name of the custom class to retrieve. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The name of the custom class to retrieve. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The name of the custom class to retrieve. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The name of the custom class to retrieve. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The name of the custom class to retrieve. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.GetCustomClassRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.GetCustomClassRequest) + private static final com.google.cloud.speech.v1p1beta1.GetCustomClassRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.GetCustomClassRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCustomClassRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetCustomClassRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetCustomClassRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java new file mode 100644 index 000000000000..721b97fda97f --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface GetCustomClassRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.GetCustomClassRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The name of the custom class to retrieve. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Required. The name of the custom class to retrieve. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java new file mode 100644 index 000000000000..e479df0420af --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java @@ -0,0 +1,637 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Message sent by the client for the `GetPhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.GetPhraseSetRequest} + */ +public final class GetPhraseSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) + GetPhraseSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetPhraseSetRequest.newBuilder() to construct. + private GetPhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetPhraseSetRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetPhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetPhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. The name of the phrase set to retrieve. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Required. The name of the phrase set to retrieve. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest other = (com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `GetPhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.GetPhraseSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest build() { + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest result = new com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. The name of the phrase set to retrieve. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The name of the phrase set to retrieve. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The name of the phrase set to retrieve. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The name of the phrase set to retrieve. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. The name of the phrase set to retrieve. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) + private static final com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetPhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetPhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java new file mode 100644 index 000000000000..b5ad6ae0036f --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface GetPhraseSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The name of the phrase set to retrieve. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * Required. The name of the phrase set to retrieve. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java new file mode 100644 index 000000000000..6a67c3edf078 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java @@ -0,0 +1,916 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Message sent by the client for the `ListCustomClasses` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListCustomClassesRequest} + */ +public final class ListCustomClassesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) + ListCustomClassesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListCustomClassesRequest.newBuilder() to construct. + private ListCustomClassesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListCustomClassesRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListCustomClassesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListCustomClassesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.class, com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent, which owns this collection of custom classes. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent, which owns this collection of custom classes. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of custom classes to return. The service may return
+   * fewer than this value. If unspecified, at most 50 custom classes will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * A page token, received from a previous `ListCustomClass` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListCustomClass` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * A page token, received from a previous `ListCustomClass` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListCustomClass` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest other = (com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `ListCustomClasses` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListCustomClassesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.class, com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest build() { + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest result = new com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent, which owns this collection of custom classes. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent, which owns this collection of custom classes. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent, which owns this collection of custom classes. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent, which owns this collection of custom classes. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent, which owns this collection of custom classes. Format:
+     * `projects/{project}/locations/{location}/customClasses`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * The maximum number of custom classes to return. The service may return
+     * fewer than this value. If unspecified, at most 50 custom classes will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of custom classes to return. The service may return
+     * fewer than this value. If unspecified, at most 50 custom classes will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of custom classes to return. The service may return
+     * fewer than this value. If unspecified, at most 50 custom classes will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * A page token, received from a previous `ListCustomClass` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListCustomClass` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) + private static final com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCustomClassesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCustomClassesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java new file mode 100644 index 000000000000..e83c2e601a5a --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java @@ -0,0 +1,80 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface ListCustomClassesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent, which owns this collection of custom classes. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent, which owns this collection of custom classes. Format:
+   * `projects/{project}/locations/{location}/customClasses`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of custom classes to return. The service may return
+   * fewer than this value. If unspecified, at most 50 custom classes will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * A page token, received from a previous `ListCustomClass` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListCustomClass` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * A page token, received from a previous `ListCustomClass` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListCustomClass` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java new file mode 100644 index 000000000000..ebef3078cb54 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java @@ -0,0 +1,1045 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Message returned to the client by the `ListCustomClasses` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListCustomClassesResponse} + */ +public final class ListCustomClassesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) + ListCustomClassesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListCustomClassesResponse.newBuilder() to construct. + private ListCustomClassesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListCustomClassesResponse() { + customClasses_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListCustomClassesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListCustomClassesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + customClasses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + customClasses_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.CustomClass.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + customClasses_ = java.util.Collections.unmodifiableList(customClasses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.class, com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.Builder.class); + } + + public static final int CUSTOM_CLASSES_FIELD_NUMBER = 1; + private java.util.List customClasses_; + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public java.util.List getCustomClassesList() { + return customClasses_; + } + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public java.util.List + getCustomClassesOrBuilderList() { + return customClasses_; + } + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public int getCustomClassesCount() { + return customClasses_.size(); + } + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { + return customClasses_.get(index); + } + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index) { + return customClasses_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < customClasses_.size(); i++) { + output.writeMessage(1, customClasses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < customClasses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, customClasses_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse other = (com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse) obj; + + if (!getCustomClassesList() + .equals(other.getCustomClassesList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCustomClassesCount() > 0) { + hash = (37 * hash) + CUSTOM_CLASSES_FIELD_NUMBER; + hash = (53 * hash) + getCustomClassesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message returned to the client by the `ListCustomClasses` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListCustomClassesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.class, com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getCustomClassesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (customClassesBuilder_ == null) { + customClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + customClassesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse build() { + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse buildPartial() { + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse result = new com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse(this); + int from_bitField0_ = bitField0_; + if (customClassesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + customClasses_ = java.util.Collections.unmodifiableList(customClasses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.customClasses_ = customClasses_; + } else { + result.customClasses_ = customClassesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse other) { + if (other == com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.getDefaultInstance()) return this; + if (customClassesBuilder_ == null) { + if (!other.customClasses_.isEmpty()) { + if (customClasses_.isEmpty()) { + customClasses_ = other.customClasses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCustomClassesIsMutable(); + customClasses_.addAll(other.customClasses_); + } + onChanged(); + } + } else { + if (!other.customClasses_.isEmpty()) { + if (customClassesBuilder_.isEmpty()) { + customClassesBuilder_.dispose(); + customClassesBuilder_ = null; + customClasses_ = other.customClasses_; + bitField0_ = (bitField0_ & ~0x00000001); + customClassesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getCustomClassesFieldBuilder() : null; + } else { + customClassesBuilder_.addAllMessages(other.customClasses_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List customClasses_ = + java.util.Collections.emptyList(); + private void ensureCustomClassesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + customClasses_ = new java.util.ArrayList(customClasses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> customClassesBuilder_; + + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public java.util.List getCustomClassesList() { + if (customClassesBuilder_ == null) { + return java.util.Collections.unmodifiableList(customClasses_); + } else { + return customClassesBuilder_.getMessageList(); + } + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public int getCustomClassesCount() { + if (customClassesBuilder_ == null) { + return customClasses_.size(); + } else { + return customClassesBuilder_.getCount(); + } + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { + if (customClassesBuilder_ == null) { + return customClasses_.get(index); + } else { + return customClassesBuilder_.getMessage(index); + } + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder setCustomClasses( + int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.set(index, value); + onChanged(); + } else { + customClassesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder setCustomClasses( + int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.set(index, builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder addCustomClasses(com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.add(value); + onChanged(); + } else { + customClassesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder addCustomClasses( + int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.add(index, value); + onChanged(); + } else { + customClassesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder addCustomClasses( + com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.add(builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder addCustomClasses( + int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.add(index, builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder addAllCustomClasses( + java.lang.Iterable values) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, customClasses_); + onChanged(); + } else { + customClassesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder clearCustomClasses() { + if (customClassesBuilder_ == null) { + customClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + customClassesBuilder_.clear(); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public Builder removeCustomClasses(int index) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.remove(index); + onChanged(); + } else { + customClassesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassesBuilder( + int index) { + return getCustomClassesFieldBuilder().getBuilder(index); + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index) { + if (customClassesBuilder_ == null) { + return customClasses_.get(index); } else { + return customClassesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public java.util.List + getCustomClassesOrBuilderList() { + if (customClassesBuilder_ != null) { + return customClassesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(customClasses_); + } + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder() { + return getCustomClassesFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()); + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder( + int index) { + return getCustomClassesFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()); + } + /** + *
+     * The custom classes.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + public java.util.List + getCustomClassesBuilderList() { + return getCustomClassesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> + getCustomClassesFieldBuilder() { + if (customClassesBuilder_ == null) { + customClassesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( + customClasses_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + customClasses_ = null; + } + return customClassesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) + private static final com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse(); + } + + public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCustomClassesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCustomClassesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java new file mode 100644 index 000000000000..bb845e9819e6 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface ListCustomClassesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + java.util.List + getCustomClassesList(); + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index); + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + int getCustomClassesCount(); + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + java.util.List + getCustomClassesOrBuilderList(); + /** + *
+   * The custom classes.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; + */ + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index); + + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java new file mode 100644 index 000000000000..57facef81cd3 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java @@ -0,0 +1,916 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Message sent by the client for the `ListPhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListPhraseSetRequest} + */ +public final class ListPhraseSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) + ListPhraseSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListPhraseSetRequest.newBuilder() to construct. + private ListPhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListPhraseSetRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListPhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListPhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The parent, which owns this collection of phrase set. Format:
+   * `projects/{project}/locations/{location}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The parent, which owns this collection of phrase set. Format:
+   * `projects/{project}/locations/{location}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of phrase sets to return. The service may return
+   * fewer than this value. If unspecified, at most 50 phrase sets will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * A page token, received from a previous `ListPhraseSet` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListPhraseSet` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * A page token, received from a previous `ListPhraseSet` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListPhraseSet` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest other = (com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) obj; + + if (!getParent() + .equals(other.getParent())) return false; + if (getPageSize() + != other.getPageSize()) return false; + if (!getPageToken() + .equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `ListPhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListPhraseSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest build() { + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest result = new com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The parent, which owns this collection of phrase set. Format:
+     * `projects/{project}/locations/{location}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The parent, which owns this collection of phrase set. Format:
+     * `projects/{project}/locations/{location}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The parent, which owns this collection of phrase set. Format:
+     * `projects/{project}/locations/{location}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The parent, which owns this collection of phrase set. Format:
+     * `projects/{project}/locations/{location}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The parent, which owns this collection of phrase set. Format:
+     * `projects/{project}/locations/{location}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * The maximum number of phrase sets to return. The service may return
+     * fewer than this value. If unspecified, at most 50 phrase sets will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of phrase sets to return. The service may return
+     * fewer than this value. If unspecified, at most 50 phrase sets will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of phrase sets to return. The service may return
+     * fewer than this value. If unspecified, at most 50 phrase sets will be
+     * returned. The maximum value is 1000; values above 1000 will be coerced to
+     * 1000.
+     * 
+ * + * int32 page_size = 2; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * A page token, received from a previous `ListPhraseSet` call.
+     * Provide this to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListPhraseSet` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) + private static final com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java new file mode 100644 index 000000000000..1f93fa365224 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java @@ -0,0 +1,80 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface ListPhraseSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The parent, which owns this collection of phrase set. Format:
+   * `projects/{project}/locations/{location}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The parent. + */ + java.lang.String getParent(); + /** + *
+   * Required. The parent, which owns this collection of phrase set. Format:
+   * `projects/{project}/locations/{location}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * @return The bytes for parent. + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of phrase sets to return. The service may return
+   * fewer than this value. If unspecified, at most 50 phrase sets will be
+   * returned. The maximum value is 1000; values above 1000 will be coerced to
+   * 1000.
+   * 
+ * + * int32 page_size = 2; + * @return The pageSize. + */ + int getPageSize(); + + /** + *
+   * A page token, received from a previous `ListPhraseSet` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListPhraseSet` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + *
+   * A page token, received from a previous `ListPhraseSet` call.
+   * Provide this to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListPhraseSet` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java new file mode 100644 index 000000000000..5a8f05764335 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java @@ -0,0 +1,1045 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Message returned to the client by the `ListPhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListPhraseSetResponse} + */ +public final class ListPhraseSetResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) + ListPhraseSetResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListPhraseSetResponse.newBuilder() to construct. + private ListPhraseSetResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListPhraseSetResponse() { + phraseSets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListPhraseSetResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListPhraseSetResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + phraseSets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + phraseSets_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.PhraseSet.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.class, com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.Builder.class); + } + + public static final int PHRASE_SETS_FIELD_NUMBER = 1; + private java.util.List phraseSets_; + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public java.util.List getPhraseSetsList() { + return phraseSets_; + } + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public java.util.List + getPhraseSetsOrBuilderList() { + return phraseSets_; + } + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public int getPhraseSetsCount() { + return phraseSets_.size(); + } + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index) { + return phraseSets_.get(index); + } + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder( + int index) { + return phraseSets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < phraseSets_.size(); i++) { + output.writeMessage(1, phraseSets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < phraseSets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, phraseSets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse other = (com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse) obj; + + if (!getPhraseSetsList() + .equals(other.getPhraseSetsList())) return false; + if (!getNextPageToken() + .equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPhraseSetsCount() > 0) { + hash = (37 * hash) + PHRASE_SETS_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSetsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message returned to the client by the `ListPhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.ListPhraseSetResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.class, com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPhraseSetsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (phraseSetsBuilder_ == null) { + phraseSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + phraseSetsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse build() { + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse buildPartial() { + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse result = new com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse(this); + int from_bitField0_ = bitField0_; + if (phraseSetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.phraseSets_ = phraseSets_; + } else { + result.phraseSets_ = phraseSetsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse other) { + if (other == com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.getDefaultInstance()) return this; + if (phraseSetsBuilder_ == null) { + if (!other.phraseSets_.isEmpty()) { + if (phraseSets_.isEmpty()) { + phraseSets_ = other.phraseSets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePhraseSetsIsMutable(); + phraseSets_.addAll(other.phraseSets_); + } + onChanged(); + } + } else { + if (!other.phraseSets_.isEmpty()) { + if (phraseSetsBuilder_.isEmpty()) { + phraseSetsBuilder_.dispose(); + phraseSetsBuilder_ = null; + phraseSets_ = other.phraseSets_; + bitField0_ = (bitField0_ & ~0x00000001); + phraseSetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPhraseSetsFieldBuilder() : null; + } else { + phraseSetsBuilder_.addAllMessages(other.phraseSets_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List phraseSets_ = + java.util.Collections.emptyList(); + private void ensurePhraseSetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + phraseSets_ = new java.util.ArrayList(phraseSets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> phraseSetsBuilder_; + + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public java.util.List getPhraseSetsList() { + if (phraseSetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(phraseSets_); + } else { + return phraseSetsBuilder_.getMessageList(); + } + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public int getPhraseSetsCount() { + if (phraseSetsBuilder_ == null) { + return phraseSets_.size(); + } else { + return phraseSetsBuilder_.getCount(); + } + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index) { + if (phraseSetsBuilder_ == null) { + return phraseSets_.get(index); + } else { + return phraseSetsBuilder_.getMessage(index); + } + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder setPhraseSets( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.set(index, value); + onChanged(); + } else { + phraseSetsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder setPhraseSets( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.set(index, builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets(com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.add(value); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.add(index, value); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.add(builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.add(index, builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addAllPhraseSets( + java.lang.Iterable values) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, phraseSets_); + onChanged(); + } else { + phraseSetsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder clearPhraseSets() { + if (phraseSetsBuilder_ == null) { + phraseSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + phraseSetsBuilder_.clear(); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder removePhraseSets(int index) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.remove(index); + onChanged(); + } else { + phraseSetsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder getPhraseSetsBuilder( + int index) { + return getPhraseSetsFieldBuilder().getBuilder(index); + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder( + int index) { + if (phraseSetsBuilder_ == null) { + return phraseSets_.get(index); } else { + return phraseSetsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public java.util.List + getPhraseSetsOrBuilderList() { + if (phraseSetsBuilder_ != null) { + return phraseSetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(phraseSets_); + } + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder() { + return getPhraseSetsFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()); + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder( + int index) { + return getPhraseSetsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()); + } + /** + *
+     * The phrase set.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public java.util.List + getPhraseSetsBuilderList() { + return getPhraseSetsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> + getPhraseSetsFieldBuilder() { + if (phraseSetsBuilder_ == null) { + phraseSetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder>( + phraseSets_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + phraseSets_ = null; + } + return phraseSetsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) + private static final com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse(); + } + + public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListPhraseSetResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListPhraseSetResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java new file mode 100644 index 000000000000..7a24d1b77dc3 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface ListPhraseSetResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + java.util.List + getPhraseSetsList(); + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index); + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + int getPhraseSetsCount(); + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + java.util.List + getPhraseSetsOrBuilderList(); + /** + *
+   * The phrase set.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder( + int index); + + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java new file mode 100644 index 000000000000..ed13f4e9c4db --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java @@ -0,0 +1,192 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java new file mode 100644 index 000000000000..5dc34a20ed73 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java @@ -0,0 +1,1398 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Describes the progress of a long-running `LongRunningRecognize` call. It is
+ * included in the `metadata` field of the `Operation` returned by the
+ * `GetOperation` call of the `google::longrunning::Operations` service.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} + */ +public final class LongRunningRecognizeMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) + LongRunningRecognizeMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use LongRunningRecognizeMetadata.newBuilder() to construct. + private LongRunningRecognizeMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LongRunningRecognizeMetadata() { + uri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LongRunningRecognizeMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LongRunningRecognizeMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + progressPercent_ = input.readInt32(); + break; + } + case 18: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (lastUpdateTime_ != null) { + subBuilder = lastUpdateTime_.toBuilder(); + } + lastUpdateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(lastUpdateTime_); + lastUpdateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 42: { + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = input.readMessage(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.class, com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.Builder.class); + } + + public static final int PROGRESS_PERCENT_FIELD_NUMBER = 1; + private int progressPercent_; + /** + *
+   * Approximate percentage of audio processed thus far. Guaranteed to be 100
+   * when the audio is fully processed and the results are available.
+   * 
+ * + * int32 progress_percent = 1; + * @return The progressPercent. + */ + @java.lang.Override + public int getProgressPercent() { + return progressPercent_; + } + + public static final int START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp startTime_; + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int LAST_UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp lastUpdateTime_; + /** + *
+   * Time of the most recent processing update.
+   * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + * @return Whether the lastUpdateTime field is set. + */ + @java.lang.Override + public boolean hasLastUpdateTime() { + return lastUpdateTime_ != null; + } + /** + *
+   * Time of the most recent processing update.
+   * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + * @return The lastUpdateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getLastUpdateTime() { + return lastUpdateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lastUpdateTime_; + } + /** + *
+   * Time of the most recent processing update.
+   * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { + return getLastUpdateTime(); + } + + public static final int URI_FIELD_NUMBER = 4; + private volatile java.lang.Object uri_; + /** + *
+   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+   * as byte content.
+   * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + *
+   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+   * as byte content.
+   * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 5; + private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; + /** + *
+   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + *
+   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { + return outputConfig_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } + /** + *
+   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (progressPercent_ != 0) { + output.writeInt32(1, progressPercent_); + } + if (startTime_ != null) { + output.writeMessage(2, getStartTime()); + } + if (lastUpdateTime_ != null) { + output.writeMessage(3, getLastUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, uri_); + } + if (outputConfig_ != null) { + output.writeMessage(5, getOutputConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (progressPercent_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, progressPercent_); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getStartTime()); + } + if (lastUpdateTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getLastUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, uri_); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getOutputConfig()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata other = (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) obj; + + if (getProgressPercent() + != other.getProgressPercent()) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime() + .equals(other.getStartTime())) return false; + } + if (hasLastUpdateTime() != other.hasLastUpdateTime()) return false; + if (hasLastUpdateTime()) { + if (!getLastUpdateTime() + .equals(other.getLastUpdateTime())) return false; + } + if (!getUri() + .equals(other.getUri())) return false; + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig() + .equals(other.getOutputConfig())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PROGRESS_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getProgressPercent(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasLastUpdateTime()) { + hash = (37 * hash) + LAST_UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getLastUpdateTime().hashCode(); + } + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Describes the progress of a long-running `LongRunningRecognize` call. It is
+   * included in the `metadata` field of the `Operation` returned by the
+   * `GetOperation` call of the `google::longrunning::Operations` service.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.class, com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + progressPercent_ = 0; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (lastUpdateTimeBuilder_ == null) { + lastUpdateTime_ = null; + } else { + lastUpdateTime_ = null; + lastUpdateTimeBuilder_ = null; + } + uri_ = ""; + + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata build() { + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata buildPartial() { + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata result = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata(this); + result.progressPercent_ = progressPercent_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (lastUpdateTimeBuilder_ == null) { + result.lastUpdateTime_ = lastUpdateTime_; + } else { + result.lastUpdateTime_ = lastUpdateTimeBuilder_.build(); + } + result.uri_ = uri_; + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata other) { + if (other == com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.getDefaultInstance()) return this; + if (other.getProgressPercent() != 0) { + setProgressPercent(other.getProgressPercent()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasLastUpdateTime()) { + mergeLastUpdateTime(other.getLastUpdateTime()); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int progressPercent_ ; + /** + *
+     * Approximate percentage of audio processed thus far. Guaranteed to be 100
+     * when the audio is fully processed and the results are available.
+     * 
+ * + * int32 progress_percent = 1; + * @return The progressPercent. + */ + @java.lang.Override + public int getProgressPercent() { + return progressPercent_; + } + /** + *
+     * Approximate percentage of audio processed thus far. Guaranteed to be 100
+     * when the audio is fully processed and the results are available.
+     * 
+ * + * int32 progress_percent = 1; + * @param value The progressPercent to set. + * @return This builder for chaining. + */ + public Builder setProgressPercent(int value) { + + progressPercent_ = value; + onChanged(); + return this; + } + /** + *
+     * Approximate percentage of audio processed thus far. Guaranteed to be 100
+     * when the audio is fully processed and the results are available.
+     * 
+ * + * int32 progress_percent = 1; + * @return This builder for chaining. + */ + public Builder clearProgressPercent() { + + progressPercent_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder setStartTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getStartTime(), + getParentForChildren(), + isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp lastUpdateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> lastUpdateTimeBuilder_; + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + * @return Whether the lastUpdateTime field is set. + */ + public boolean hasLastUpdateTime() { + return lastUpdateTimeBuilder_ != null || lastUpdateTime_ != null; + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + * @return The lastUpdateTime. + */ + public com.google.protobuf.Timestamp getLastUpdateTime() { + if (lastUpdateTimeBuilder_ == null) { + return lastUpdateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lastUpdateTime_; + } else { + return lastUpdateTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + public Builder setLastUpdateTime(com.google.protobuf.Timestamp value) { + if (lastUpdateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lastUpdateTime_ = value; + onChanged(); + } else { + lastUpdateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + public Builder setLastUpdateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (lastUpdateTimeBuilder_ == null) { + lastUpdateTime_ = builderForValue.build(); + onChanged(); + } else { + lastUpdateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + public Builder mergeLastUpdateTime(com.google.protobuf.Timestamp value) { + if (lastUpdateTimeBuilder_ == null) { + if (lastUpdateTime_ != null) { + lastUpdateTime_ = + com.google.protobuf.Timestamp.newBuilder(lastUpdateTime_).mergeFrom(value).buildPartial(); + } else { + lastUpdateTime_ = value; + } + onChanged(); + } else { + lastUpdateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + public Builder clearLastUpdateTime() { + if (lastUpdateTimeBuilder_ == null) { + lastUpdateTime_ = null; + onChanged(); + } else { + lastUpdateTime_ = null; + lastUpdateTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getLastUpdateTimeBuilder() { + + onChanged(); + return getLastUpdateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { + if (lastUpdateTimeBuilder_ != null) { + return lastUpdateTimeBuilder_.getMessageOrBuilder(); + } else { + return lastUpdateTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : lastUpdateTime_; + } + } + /** + *
+     * Time of the most recent processing update.
+     * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getLastUpdateTimeFieldBuilder() { + if (lastUpdateTimeBuilder_ == null) { + lastUpdateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getLastUpdateTime(), + getParentForChildren(), + isClean()); + lastUpdateTime_ = null; + } + return lastUpdateTimeBuilder_; + } + + private java.lang.Object uri_ = ""; + /** + *
+     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+     * as byte content.
+     * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+     * as byte content.
+     * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+     * as byte content.
+     * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+     * as byte content.
+     * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + *
+     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+     * as byte content.
+     * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> outputConfigBuilder_; + /** + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The outputConfig. + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder setOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder setOutputConfig( + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder mergeOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null ? + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } + } + /** + *
+     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder>( + getOutputConfig(), + getParentForChildren(), + isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) + private static final com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata(); + } + + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LongRunningRecognizeMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LongRunningRecognizeMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java new file mode 100644 index 000000000000..2e4b54cbc0f0 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java @@ -0,0 +1,123 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface LongRunningRecognizeMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Approximate percentage of audio processed thus far. Guaranteed to be 100
+   * when the audio is fully processed and the results are available.
+   * 
+ * + * int32 progress_percent = 1; + * @return The progressPercent. + */ + int getProgressPercent(); + + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + *
+   * Time of the most recent processing update.
+   * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + * @return Whether the lastUpdateTime field is set. + */ + boolean hasLastUpdateTime(); + /** + *
+   * Time of the most recent processing update.
+   * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + * @return The lastUpdateTime. + */ + com.google.protobuf.Timestamp getLastUpdateTime(); + /** + *
+   * Time of the most recent processing update.
+   * 
+ * + * .google.protobuf.Timestamp last_update_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder(); + + /** + *
+   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+   * as byte content.
+   * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The uri. + */ + java.lang.String getUri(); + /** + *
+   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
+   * as byte content.
+   * 
+ * + * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for uri. + */ + com.google.protobuf.ByteString + getUriBytes(); + + /** + *
+   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + *
+   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The outputConfig. + */ + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig(); + /** + *
+   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java new file mode 100644 index 000000000000..74993a44d467 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java @@ -0,0 +1,1151 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * The top-level message sent by the client for the `LongRunningRecognize`
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} + */ +public final class LongRunningRecognizeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) + LongRunningRecognizeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use LongRunningRecognizeRequest.newBuilder() to construct. + private LongRunningRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LongRunningRecognizeRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LongRunningRecognizeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LongRunningRecognizeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder subBuilder = null; + if (config_ != null) { + subBuilder = config_.toBuilder(); + } + config_ = input.readMessage(com.google.cloud.speech.v1p1beta1.RecognitionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(config_); + config_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder subBuilder = null; + if (audio_ != null) { + subBuilder = audio_.toBuilder(); + } + audio_ = input.readMessage(com.google.cloud.speech.v1p1beta1.RecognitionAudio.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(audio_); + audio_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = input.readMessage(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.class, com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.Builder.class); + } + + public static final int CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return config_ != null; + } + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { + return config_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; + } + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { + return getConfig(); + } + + public static final int AUDIO_FIELD_NUMBER = 2; + private com.google.cloud.speech.v1p1beta1.RecognitionAudio audio_; + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the audio field is set. + */ + @java.lang.Override + public boolean hasAudio() { + return audio_ != null; + } + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The audio. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio() { + return audio_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() : audio_; + } + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { + return getAudio(); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; + /** + *
+   * Optional. Specifies an optional destination for the recognition results.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + *
+   * Optional. Specifies an optional destination for the recognition results.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { + return outputConfig_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } + /** + *
+   * Optional. Specifies an optional destination for the recognition results.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (config_ != null) { + output.writeMessage(1, getConfig()); + } + if (audio_ != null) { + output.writeMessage(2, getAudio()); + } + if (outputConfig_ != null) { + output.writeMessage(4, getOutputConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (config_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getConfig()); + } + if (audio_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getAudio()); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getOutputConfig()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest other = (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) obj; + + if (hasConfig() != other.hasConfig()) return false; + if (hasConfig()) { + if (!getConfig() + .equals(other.getConfig())) return false; + } + if (hasAudio() != other.hasAudio()) return false; + if (hasAudio()) { + if (!getAudio() + .equals(other.getAudio())) return false; + } + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig() + .equals(other.getOutputConfig())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + if (hasAudio()) { + hash = (37 * hash) + AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getAudio().hashCode(); + } + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The top-level message sent by the client for the `LongRunningRecognize`
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.class, com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (configBuilder_ == null) { + config_ = null; + } else { + config_ = null; + configBuilder_ = null; + } + if (audioBuilder_ == null) { + audio_ = null; + } else { + audio_ = null; + audioBuilder_ = null; + } + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest build() { + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest result = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest(this); + if (configBuilder_ == null) { + result.config_ = config_; + } else { + result.config_ = configBuilder_.build(); + } + if (audioBuilder_ == null) { + result.audio_ = audio_; + } else { + result.audio_ = audioBuilder_.build(); + } + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.getDefaultInstance()) return this; + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + if (other.hasAudio()) { + mergeAudio(other.getAudio()); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> configBuilder_; + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + public boolean hasConfig() { + return configBuilder_ != null || config_ != null; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { + if (configBuilder_ == null) { + return config_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig( + com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { + if (configBuilder_ == null) { + if (config_ != null) { + config_ = + com.google.cloud.speech.v1p1beta1.RecognitionConfig.newBuilder(config_).mergeFrom(value).buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + configBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + config_ = null; + onChanged(); + } else { + config_ = null; + configBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder getConfigBuilder() { + + onChanged(); + return getConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null ? + com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; + } + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder>( + getConfig(), + getParentForChildren(), + isClean()); + config_ = null; + } + return configBuilder_; + } + + private com.google.cloud.speech.v1p1beta1.RecognitionAudio audio_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionAudio, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder> audioBuilder_; + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the audio field is set. + */ + public boolean hasAudio() { + return audioBuilder_ != null || audio_ != null; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The audio. + */ + public com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio() { + if (audioBuilder_ == null) { + return audio_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() : audio_; + } else { + return audioBuilder_.getMessage(); + } + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setAudio(com.google.cloud.speech.v1p1beta1.RecognitionAudio value) { + if (audioBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + audio_ = value; + onChanged(); + } else { + audioBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setAudio( + com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder builderForValue) { + if (audioBuilder_ == null) { + audio_ = builderForValue.build(); + onChanged(); + } else { + audioBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeAudio(com.google.cloud.speech.v1p1beta1.RecognitionAudio value) { + if (audioBuilder_ == null) { + if (audio_ != null) { + audio_ = + com.google.cloud.speech.v1p1beta1.RecognitionAudio.newBuilder(audio_).mergeFrom(value).buildPartial(); + } else { + audio_ = value; + } + onChanged(); + } else { + audioBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearAudio() { + if (audioBuilder_ == null) { + audio_ = null; + onChanged(); + } else { + audio_ = null; + audioBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder getAudioBuilder() { + + onChanged(); + return getAudioFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { + if (audioBuilder_ != null) { + return audioBuilder_.getMessageOrBuilder(); + } else { + return audio_ == null ? + com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() : audio_; + } + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionAudio, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder> + getAudioFieldBuilder() { + if (audioBuilder_ == null) { + audioBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionAudio, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder>( + getAudio(), + getParentForChildren(), + isClean()); + audio_ = null; + } + return audioBuilder_; + } + + private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> outputConfigBuilder_; + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return The outputConfig. + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setOutputConfig( + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder mergeOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null ? + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } + } + /** + *
+     * Optional. Specifies an optional destination for the recognition results.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder>( + getOutputConfig(), + getParentForChildren(), + isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) + private static final com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LongRunningRecognizeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LongRunningRecognizeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequestOrBuilder.java new file mode 100644 index 000000000000..5a5a7bb3a28f --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequestOrBuilder.java @@ -0,0 +1,93 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface LongRunningRecognizeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + boolean hasConfig(); + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig(); + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder(); + + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the audio field is set. + */ + boolean hasAudio(); + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The audio. + */ + com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio(); + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder(); + + /** + *
+   * Optional. Specifies an optional destination for the recognition results.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + *
+   * Optional. Specifies an optional destination for the recognition results.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return The outputConfig. + */ + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig(); + /** + *
+   * Optional. Specifies an optional destination for the recognition results.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java new file mode 100644 index 000000000000..ef5d878c5e04 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java @@ -0,0 +1,1611 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * The only message returned to the client by the `LongRunningRecognize` method.
+ * It contains the result as zero or more sequential `SpeechRecognitionResult`
+ * messages. It is included in the `result.response` field of the `Operation`
+ * returned by the `GetOperation` call of the `google::longrunning::Operations`
+ * service.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} + */ +public final class LongRunningRecognizeResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) + LongRunningRecognizeResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use LongRunningRecognizeResponse.newBuilder() to construct. + private LongRunningRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LongRunningRecognizeResponse() { + results_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LongRunningRecognizeResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LongRunningRecognizeResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + results_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.parser(), extensionRegistry)); + break; + } + case 26: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (totalBilledTime_ != null) { + subBuilder = totalBilledTime_.toBuilder(); + } + totalBilledTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(totalBilledTime_); + totalBilledTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = input.readMessage(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + com.google.rpc.Status.Builder subBuilder = null; + if (outputError_ != null) { + subBuilder = outputError_.toBuilder(); + } + outputError_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputError_); + outputError_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.class, com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.Builder.class); + } + + public static final int RESULTS_FIELD_NUMBER = 2; + private java.util.List results_; + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public java.util.List getResultsList() { + return results_; + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public java.util.List + getResultsOrBuilderList() { + return results_; + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index) { + return results_.get(index); + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( + int index) { + return results_.get(index); + } + + public static final int TOTAL_BILLED_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Duration totalBilledTime_; + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return Whether the totalBilledTime field is set. + */ + @java.lang.Override + public boolean hasTotalBilledTime() { + return totalBilledTime_ != null; + } + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return The totalBilledTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getTotalBilledTime() { + return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { + return getTotalBilledTime(); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 6; + private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; + /** + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { + return outputConfig_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } + /** + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + public static final int OUTPUT_ERROR_FIELD_NUMBER = 7; + private com.google.rpc.Status outputError_; + /** + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + * @return Whether the outputError field is set. + */ + @java.lang.Override + public boolean hasOutputError() { + return outputError_ != null; + } + /** + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + * @return The outputError. + */ + @java.lang.Override + public com.google.rpc.Status getOutputError() { + return outputError_ == null ? com.google.rpc.Status.getDefaultInstance() : outputError_; + } + /** + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { + return getOutputError(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(2, results_.get(i)); + } + if (totalBilledTime_ != null) { + output.writeMessage(3, getTotalBilledTime()); + } + if (outputConfig_ != null) { + output.writeMessage(6, getOutputConfig()); + } + if (outputError_ != null) { + output.writeMessage(7, getOutputError()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, results_.get(i)); + } + if (totalBilledTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getTotalBilledTime()); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getOutputConfig()); + } + if (outputError_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getOutputError()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse other = (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) obj; + + if (!getResultsList() + .equals(other.getResultsList())) return false; + if (hasTotalBilledTime() != other.hasTotalBilledTime()) return false; + if (hasTotalBilledTime()) { + if (!getTotalBilledTime() + .equals(other.getTotalBilledTime())) return false; + } + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig() + .equals(other.getOutputConfig())) return false; + } + if (hasOutputError() != other.hasOutputError()) return false; + if (hasOutputError()) { + if (!getOutputError() + .equals(other.getOutputError())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + if (hasTotalBilledTime()) { + hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; + hash = (53 * hash) + getTotalBilledTime().hashCode(); + } + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + if (hasOutputError()) { + hash = (37 * hash) + OUTPUT_ERROR_FIELD_NUMBER; + hash = (53 * hash) + getOutputError().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The only message returned to the client by the `LongRunningRecognize` method.
+   * It contains the result as zero or more sequential `SpeechRecognitionResult`
+   * messages. It is included in the `result.response` field of the `Operation`
+   * returned by the `GetOperation` call of the `google::longrunning::Operations`
+   * service.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.class, com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resultsBuilder_.clear(); + } + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = null; + } else { + totalBilledTime_ = null; + totalBilledTimeBuilder_ = null; + } + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + if (outputErrorBuilder_ == null) { + outputError_ = null; + } else { + outputError_ = null; + outputErrorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse build() { + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse buildPartial() { + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse result = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse(this); + int from_bitField0_ = bitField0_; + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + if (totalBilledTimeBuilder_ == null) { + result.totalBilledTime_ = totalBilledTime_; + } else { + result.totalBilledTime_ = totalBilledTimeBuilder_.build(); + } + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + if (outputErrorBuilder_ == null) { + result.outputError_ = outputError_; + } else { + result.outputError_ = outputErrorBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse other) { + if (other == com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.getDefaultInstance()) return this; + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResultsFieldBuilder() : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (other.hasTotalBilledTime()) { + mergeTotalBilledTime(other.getTotalBilledTime()); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + if (other.hasOutputError()) { + mergeOutputError(other.getOutputError()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List results_ = + java.util.Collections.emptyList(); + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> resultsBuilder_; + + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public java.util.List getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder setResults( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder setResults( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder addResults(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder addResults( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder addResults( + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder addResults( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder addAllResults( + java.lang.Iterable values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( + int index) { + if (resultsBuilder_ == null) { + return results_.get(index); } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public java.util.List + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResultsBuilder() { + return getResultsFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()); + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()); + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder>( + results_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private com.google.protobuf.Duration totalBilledTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalBilledTimeBuilder_; + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return Whether the totalBilledTime field is set. + */ + public boolean hasTotalBilledTime() { + return totalBilledTimeBuilder_ != null || totalBilledTime_ != null; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return The totalBilledTime. + */ + public com.google.protobuf.Duration getTotalBilledTime() { + if (totalBilledTimeBuilder_ == null) { + return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } else { + return totalBilledTimeBuilder_.getMessage(); + } + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder setTotalBilledTime(com.google.protobuf.Duration value) { + if (totalBilledTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + totalBilledTime_ = value; + onChanged(); + } else { + totalBilledTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder setTotalBilledTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = builderForValue.build(); + onChanged(); + } else { + totalBilledTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder mergeTotalBilledTime(com.google.protobuf.Duration value) { + if (totalBilledTimeBuilder_ == null) { + if (totalBilledTime_ != null) { + totalBilledTime_ = + com.google.protobuf.Duration.newBuilder(totalBilledTime_).mergeFrom(value).buildPartial(); + } else { + totalBilledTime_ = value; + } + onChanged(); + } else { + totalBilledTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder clearTotalBilledTime() { + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = null; + onChanged(); + } else { + totalBilledTime_ = null; + totalBilledTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public com.google.protobuf.Duration.Builder getTotalBilledTimeBuilder() { + + onChanged(); + return getTotalBilledTimeFieldBuilder().getBuilder(); + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { + if (totalBilledTimeBuilder_ != null) { + return totalBilledTimeBuilder_.getMessageOrBuilder(); + } else { + return totalBilledTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getTotalBilledTimeFieldBuilder() { + if (totalBilledTimeBuilder_ == null) { + totalBilledTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getTotalBilledTime(), + getParentForChildren(), + isClean()); + totalBilledTime_ = null; + } + return totalBilledTimeBuilder_; + } + + private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> outputConfigBuilder_; + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + * @return The outputConfig. + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + public Builder setOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + public Builder setOutputConfig( + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + public Builder mergeOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null ? + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; + } + } + /** + *
+     * Original output config if present in the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder>( + getOutputConfig(), + getParentForChildren(), + isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + private com.google.rpc.Status outputError_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> outputErrorBuilder_; + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + * @return Whether the outputError field is set. + */ + public boolean hasOutputError() { + return outputErrorBuilder_ != null || outputError_ != null; + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + * @return The outputError. + */ + public com.google.rpc.Status getOutputError() { + if (outputErrorBuilder_ == null) { + return outputError_ == null ? com.google.rpc.Status.getDefaultInstance() : outputError_; + } else { + return outputErrorBuilder_.getMessage(); + } + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public Builder setOutputError(com.google.rpc.Status value) { + if (outputErrorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputError_ = value; + onChanged(); + } else { + outputErrorBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public Builder setOutputError( + com.google.rpc.Status.Builder builderForValue) { + if (outputErrorBuilder_ == null) { + outputError_ = builderForValue.build(); + onChanged(); + } else { + outputErrorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public Builder mergeOutputError(com.google.rpc.Status value) { + if (outputErrorBuilder_ == null) { + if (outputError_ != null) { + outputError_ = + com.google.rpc.Status.newBuilder(outputError_).mergeFrom(value).buildPartial(); + } else { + outputError_ = value; + } + onChanged(); + } else { + outputErrorBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public Builder clearOutputError() { + if (outputErrorBuilder_ == null) { + outputError_ = null; + onChanged(); + } else { + outputError_ = null; + outputErrorBuilder_ = null; + } + + return this; + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public com.google.rpc.Status.Builder getOutputErrorBuilder() { + + onChanged(); + return getOutputErrorFieldBuilder().getBuilder(); + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { + if (outputErrorBuilder_ != null) { + return outputErrorBuilder_.getMessageOrBuilder(); + } else { + return outputError_ == null ? + com.google.rpc.Status.getDefaultInstance() : outputError_; + } + } + /** + *
+     * If the transcript output fails this field contains the relevant error.
+     * 
+ * + * .google.rpc.Status output_error = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getOutputErrorFieldBuilder() { + if (outputErrorBuilder_ == null) { + outputErrorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getOutputError(), + getParentForChildren(), + isClean()); + outputError_ = null; + } + return outputErrorBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) + private static final com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse(); + } + + public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LongRunningRecognizeResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LongRunningRecognizeResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java new file mode 100644 index 000000000000..f6b5867cee72 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java @@ -0,0 +1,139 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface LongRunningRecognizeResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + java.util.List + getResultsList(); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + int getResultsCount(); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + java.util.List + getResultsOrBuilderList(); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( + int index); + + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return Whether the totalBilledTime field is set. + */ + boolean hasTotalBilledTime(); + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return The totalBilledTime. + */ + com.google.protobuf.Duration getTotalBilledTime(); + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); + + /** + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + * @return The outputConfig. + */ + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig(); + /** + *
+   * Original output config if present in the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; + */ + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder(); + + /** + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + * @return Whether the outputError field is set. + */ + boolean hasOutputError(); + /** + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + * @return The outputError. + */ + com.google.rpc.Status getOutputError(); + /** + *
+   * If the transcript output fails this field contains the relevant error.
+   * 
+ * + * .google.rpc.Status output_error = 7; + */ + com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSet.java new file mode 100644 index 000000000000..4e71340fc388 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSet.java @@ -0,0 +1,1944 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/resource.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Provides "hints" to the speech recognizer to favor specific words and phrases
+ * in the results.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet} + */ +public final class PhraseSet extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.PhraseSet) + PhraseSetOrBuilder { +private static final long serialVersionUID = 0L; + // Use PhraseSet.newBuilder() to construct. + private PhraseSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PhraseSet() { + name_ = ""; + phrases_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PhraseSet(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PhraseSet( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + phrases_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + phrases_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.parser(), extensionRegistry)); + break; + } + case 37: { + + boost_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + phrases_ = java.util.Collections.unmodifiableList(phrases_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.PhraseSet.class, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder.class); + } + + public interface PhraseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The phrase itself.
+     * 
+ * + * string value = 1; + * @return The value. + */ + java.lang.String getValue(); + /** + *
+     * The phrase itself.
+     * 
+ * + * string value = 1; + * @return The bytes for value. + */ + com.google.protobuf.ByteString + getValueBytes(); + + /** + *
+     * Hint Boost. Overrides the boost set at the phrase set level.
+     * Positive value will increase the probability that a specific phrase will
+     * be recognized over other similar sounding phrases. The higher the boost,
+     * the higher the chance of false positive recognition as well. Negative
+     * boost will simply be ignored. Though `boost` can accept a wide range of
+     * positive values, most use cases are best served
+     * with values between 0 and 20. We recommend using a binary search approach
+     * to finding the optimal value for your use case. Speech recognition
+     * will skip PhraseSets with a boost value of 0.
+     * 
+ * + * float boost = 2; + * @return The boost. + */ + float getBoost(); + } + /** + *
+   * A phrases containing words and phrase "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also include pre-built or custom classes containing groups
+   * of words that represent common concepts that occur in natural language. For
+   * example, rather than providing a phrase hint for every month of the
+   * year (e.g. "i was born in january", "i was born in febuary", ...), use the
+   * pre-built `$MONTH` class improves the likelihood of correctly transcribing
+   * audio that includes months (e.g. "i was born in $month").
+   * To refer to pre-built classes, use the class' symbol prepended with `$`
+   * e.g. `$MONTH`. To refer to custom classes that were defined inline in the
+   * request, set the class's `custom_class_id` to a string unique to all class
+   * resources and inline classes. Then use the class' id wrapped in $`{...}`
+   * e.g. "${my-months}". To refer to custom classes resources, use the class'
+   * id wrapped in `${}` (e.g. `${my-months}`).
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
+   * `eu` location value.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet.Phrase} + */ + public static final class Phrase extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) + PhraseOrBuilder { + private static final long serialVersionUID = 0L; + // Use Phrase.newBuilder() to construct. + private Phrase(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Phrase() { + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Phrase(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Phrase( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + case 21: { + + boost_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.class, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private volatile java.lang.Object value_; + /** + *
+     * The phrase itself.
+     * 
+ * + * string value = 1; + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + *
+     * The phrase itself.
+     * 
+ * + * string value = 1; + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BOOST_FIELD_NUMBER = 2; + private float boost_; + /** + *
+     * Hint Boost. Overrides the boost set at the phrase set level.
+     * Positive value will increase the probability that a specific phrase will
+     * be recognized over other similar sounding phrases. The higher the boost,
+     * the higher the chance of false positive recognition as well. Negative
+     * boost will simply be ignored. Though `boost` can accept a wide range of
+     * positive values, most use cases are best served
+     * with values between 0 and 20. We recommend using a binary search approach
+     * to finding the optimal value for your use case. Speech recognition
+     * will skip PhraseSets with a boost value of 0.
+     * 
+ * + * float boost = 2; + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + output.writeFloat(2, boost_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, boost_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase other = (com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) obj; + + if (!getValue() + .equals(other.getValue())) return false; + if (java.lang.Float.floatToIntBits(getBoost()) + != java.lang.Float.floatToIntBits( + other.getBoost())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (37 * hash) + BOOST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getBoost()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * A phrases containing words and phrase "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also include pre-built or custom classes containing groups
+     * of words that represent common concepts that occur in natural language. For
+     * example, rather than providing a phrase hint for every month of the
+     * year (e.g. "i was born in january", "i was born in febuary", ...), use the
+     * pre-built `$MONTH` class improves the likelihood of correctly transcribing
+     * audio that includes months (e.g. "i was born in $month").
+     * To refer to pre-built classes, use the class' symbol prepended with `$`
+     * e.g. `$MONTH`. To refer to custom classes that were defined inline in the
+     * request, set the class's `custom_class_id` to a string unique to all class
+     * resources and inline classes. Then use the class' id wrapped in $`{...}`
+     * e.g. "${my-months}". To refer to custom classes resources, use the class'
+     * id wrapped in `${}` (e.g. `${my-months}`).
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
+     * `eu` location value.
+     * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet.Phrase} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) + com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.class, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + value_ = ""; + + boost_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase build() { + com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase buildPartial() { + com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase result = new com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase(this); + result.value_ = value_; + result.boost_ = boost_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase other) { + if (other == com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance()) return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object value_ = ""; + /** + *
+       * The phrase itself.
+       * 
+ * + * string value = 1; + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The phrase itself.
+       * 
+ * + * string value = 1; + * @return The bytes for value. + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The phrase itself.
+       * 
+ * + * string value = 1; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + *
+       * The phrase itself.
+       * 
+ * + * string value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + *
+       * The phrase itself.
+       * 
+ * + * string value = 1; + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + + private float boost_ ; + /** + *
+       * Hint Boost. Overrides the boost set at the phrase set level.
+       * Positive value will increase the probability that a specific phrase will
+       * be recognized over other similar sounding phrases. The higher the boost,
+       * the higher the chance of false positive recognition as well. Negative
+       * boost will simply be ignored. Though `boost` can accept a wide range of
+       * positive values, most use cases are best served
+       * with values between 0 and 20. We recommend using a binary search approach
+       * to finding the optimal value for your use case. Speech recognition
+       * will skip PhraseSets with a boost value of 0.
+       * 
+ * + * float boost = 2; + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + /** + *
+       * Hint Boost. Overrides the boost set at the phrase set level.
+       * Positive value will increase the probability that a specific phrase will
+       * be recognized over other similar sounding phrases. The higher the boost,
+       * the higher the chance of false positive recognition as well. Negative
+       * boost will simply be ignored. Though `boost` can accept a wide range of
+       * positive values, most use cases are best served
+       * with values between 0 and 20. We recommend using a binary search approach
+       * to finding the optimal value for your use case. Speech recognition
+       * will skip PhraseSets with a boost value of 0.
+       * 
+ * + * float boost = 2; + * @param value The boost to set. + * @return This builder for chaining. + */ + public Builder setBoost(float value) { + + boost_ = value; + onChanged(); + return this; + } + /** + *
+       * Hint Boost. Overrides the boost set at the phrase set level.
+       * Positive value will increase the probability that a specific phrase will
+       * be recognized over other similar sounding phrases. The higher the boost,
+       * the higher the chance of false positive recognition as well. Negative
+       * boost will simply be ignored. Though `boost` can accept a wide range of
+       * positive values, most use cases are best served
+       * with values between 0 and 20. We recommend using a binary search approach
+       * to finding the optimal value for your use case. Speech recognition
+       * will skip PhraseSets with a boost value of 0.
+       * 
+ * + * float boost = 2; + * @return This builder for chaining. + */ + public Builder clearBoost() { + + boost_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) + private static final com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase(); + } + + public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Phrase parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Phrase(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The resource name of the phrase set.
+   * 
+ * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The resource name of the phrase set.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PHRASES_FIELD_NUMBER = 2; + private java.util.List phrases_; + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + @java.lang.Override + public java.util.List getPhrasesList() { + return phrases_; + } + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + @java.lang.Override + public java.util.List + getPhrasesOrBuilderList() { + return phrases_; + } + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + @java.lang.Override + public int getPhrasesCount() { + return phrases_.size(); + } + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getPhrases(int index) { + return phrases_.get(index); + } + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( + int index) { + return phrases_.get(index); + } + + public static final int BOOST_FIELD_NUMBER = 4; + private float boost_; + /** + *
+   * Hint Boost. Positive value will increase the probability that a specific
+   * phrase will be recognized over other similar sounding phrases. The higher
+   * the boost, the higher the chance of false positive recognition as well.
+   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+   * enabled, so negative boost will simply be ignored. Though `boost` can
+   * accept a wide range of positive values, most use cases are best served with
+   * values between 0 (exclusive) and 20. We recommend using a binary search
+   * approach to finding the optimal value for your use case. Speech recognition
+   * will skip PhraseSets with a boost value of 0.
+   * 
+ * + * float boost = 4; + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < phrases_.size(); i++) { + output.writeMessage(2, phrases_.get(i)); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + output.writeFloat(4, boost_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < phrases_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, phrases_.get(i)); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, boost_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.PhraseSet)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.PhraseSet other = (com.google.cloud.speech.v1p1beta1.PhraseSet) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getPhrasesList() + .equals(other.getPhrasesList())) return false; + if (java.lang.Float.floatToIntBits(getBoost()) + != java.lang.Float.floatToIntBits( + other.getBoost())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getPhrasesCount() > 0) { + hash = (37 * hash) + PHRASES_FIELD_NUMBER; + hash = (53 * hash) + getPhrasesList().hashCode(); + } + hash = (37 * hash) + BOOST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getBoost()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.PhraseSet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Provides "hints" to the speech recognizer to favor specific words and phrases
+   * in the results.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.PhraseSet) + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.PhraseSet.class, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.PhraseSet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPhrasesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (phrasesBuilder_ == null) { + phrases_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + phrasesBuilder_.clear(); + } + boost_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet build() { + com.google.cloud.speech.v1p1beta1.PhraseSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet buildPartial() { + com.google.cloud.speech.v1p1beta1.PhraseSet result = new com.google.cloud.speech.v1p1beta1.PhraseSet(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (phrasesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + phrases_ = java.util.Collections.unmodifiableList(phrases_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.phrases_ = phrases_; + } else { + result.phrases_ = phrasesBuilder_.build(); + } + result.boost_ = boost_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.PhraseSet) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.PhraseSet)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.PhraseSet other) { + if (other == com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (phrasesBuilder_ == null) { + if (!other.phrases_.isEmpty()) { + if (phrases_.isEmpty()) { + phrases_ = other.phrases_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePhrasesIsMutable(); + phrases_.addAll(other.phrases_); + } + onChanged(); + } + } else { + if (!other.phrases_.isEmpty()) { + if (phrasesBuilder_.isEmpty()) { + phrasesBuilder_.dispose(); + phrasesBuilder_ = null; + phrases_ = other.phrases_; + bitField0_ = (bitField0_ & ~0x00000001); + phrasesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPhrasesFieldBuilder() : null; + } else { + phrasesBuilder_.addAllMessages(other.phrases_); + } + } + } + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.PhraseSet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.PhraseSet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * The resource name of the phrase set.
+     * 
+ * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource name of the phrase set.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource name of the phrase set.
+     * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource name of the phrase set.
+     * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The resource name of the phrase set.
+     * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.util.List phrases_ = + java.util.Collections.emptyList(); + private void ensurePhrasesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + phrases_ = new java.util.ArrayList(phrases_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder, com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder> phrasesBuilder_; + + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public java.util.List getPhrasesList() { + if (phrasesBuilder_ == null) { + return java.util.Collections.unmodifiableList(phrases_); + } else { + return phrasesBuilder_.getMessageList(); + } + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public int getPhrasesCount() { + if (phrasesBuilder_ == null) { + return phrases_.size(); + } else { + return phrasesBuilder_.getCount(); + } + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getPhrases(int index) { + if (phrasesBuilder_ == null) { + return phrases_.get(index); + } else { + return phrasesBuilder_.getMessage(index); + } + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public Builder setPhrases( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value) { + if (phrasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhrasesIsMutable(); + phrases_.set(index, value); + onChanged(); + } else { + phrasesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public Builder setPhrases( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue) { + if (phrasesBuilder_ == null) { + ensurePhrasesIsMutable(); + phrases_.set(index, builderForValue.build()); + onChanged(); + } else { + phrasesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public Builder addPhrases(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value) { + if (phrasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhrasesIsMutable(); + phrases_.add(value); + onChanged(); + } else { + phrasesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public Builder addPhrases( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value) { + if (phrasesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhrasesIsMutable(); + phrases_.add(index, value); + onChanged(); + } else { + phrasesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public Builder addPhrases( + com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue) { + if (phrasesBuilder_ == null) { + ensurePhrasesIsMutable(); + phrases_.add(builderForValue.build()); + onChanged(); + } else { + phrasesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public Builder addPhrases( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue) { + if (phrasesBuilder_ == null) { + ensurePhrasesIsMutable(); + phrases_.add(index, builderForValue.build()); + onChanged(); + } else { + phrasesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public Builder addAllPhrases( + java.lang.Iterable values) { + if (phrasesBuilder_ == null) { + ensurePhrasesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, phrases_); + onChanged(); + } else { + phrasesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public Builder clearPhrases() { + if (phrasesBuilder_ == null) { + phrases_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + phrasesBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public Builder removePhrases(int index) { + if (phrasesBuilder_ == null) { + ensurePhrasesIsMutable(); + phrases_.remove(index); + onChanged(); + } else { + phrasesBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder getPhrasesBuilder( + int index) { + return getPhrasesFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( + int index) { + if (phrasesBuilder_ == null) { + return phrases_.get(index); } else { + return phrasesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public java.util.List + getPhrasesOrBuilderList() { + if (phrasesBuilder_ != null) { + return phrasesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(phrases_); + } + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder addPhrasesBuilder() { + return getPhrasesFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance()); + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder addPhrasesBuilder( + int index) { + return getPhrasesFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance()); + } + /** + *
+     * A list of word and phrases.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + public java.util.List + getPhrasesBuilderList() { + return getPhrasesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder, com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder> + getPhrasesFieldBuilder() { + if (phrasesBuilder_ == null) { + phrasesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder, com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder>( + phrases_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + phrases_ = null; + } + return phrasesBuilder_; + } + + private float boost_ ; + /** + *
+     * Hint Boost. Positive value will increase the probability that a specific
+     * phrase will be recognized over other similar sounding phrases. The higher
+     * the boost, the higher the chance of false positive recognition as well.
+     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+     * enabled, so negative boost will simply be ignored. Though `boost` can
+     * accept a wide range of positive values, most use cases are best served with
+     * values between 0 (exclusive) and 20. We recommend using a binary search
+     * approach to finding the optimal value for your use case. Speech recognition
+     * will skip PhraseSets with a boost value of 0.
+     * 
+ * + * float boost = 4; + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + /** + *
+     * Hint Boost. Positive value will increase the probability that a specific
+     * phrase will be recognized over other similar sounding phrases. The higher
+     * the boost, the higher the chance of false positive recognition as well.
+     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+     * enabled, so negative boost will simply be ignored. Though `boost` can
+     * accept a wide range of positive values, most use cases are best served with
+     * values between 0 (exclusive) and 20. We recommend using a binary search
+     * approach to finding the optimal value for your use case. Speech recognition
+     * will skip PhraseSets with a boost value of 0.
+     * 
+ * + * float boost = 4; + * @param value The boost to set. + * @return This builder for chaining. + */ + public Builder setBoost(float value) { + + boost_ = value; + onChanged(); + return this; + } + /** + *
+     * Hint Boost. Positive value will increase the probability that a specific
+     * phrase will be recognized over other similar sounding phrases. The higher
+     * the boost, the higher the chance of false positive recognition as well.
+     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+     * enabled, so negative boost will simply be ignored. Though `boost` can
+     * accept a wide range of positive values, most use cases are best served with
+     * values between 0 (exclusive) and 20. We recommend using a binary search
+     * approach to finding the optimal value for your use case. Speech recognition
+     * will skip PhraseSets with a boost value of 0.
+     * 
+ * + * float boost = 4; + * @return This builder for chaining. + */ + public Builder clearBoost() { + + boost_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.PhraseSet) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.PhraseSet) + private static final com.google.cloud.speech.v1p1beta1.PhraseSet DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.PhraseSet(); + } + + public static com.google.cloud.speech.v1p1beta1.PhraseSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PhraseSet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PhraseSet(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetName.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetName.java new file mode 100644 index 000000000000..aaea055bf1b8 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetName.java @@ -0,0 +1,223 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class PhraseSetName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_PHRASE_SET = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/phraseSets/{phrase_set}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String phraseSet; + + @Deprecated + protected PhraseSetName() { + project = null; + location = null; + phraseSet = null; + } + + private PhraseSetName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + phraseSet = Preconditions.checkNotNull(builder.getPhraseSet()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPhraseSet() { + return phraseSet; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PhraseSetName of(String project, String location, String phraseSet) { + return newBuilder().setProject(project).setLocation(location).setPhraseSet(phraseSet).build(); + } + + public static String format(String project, String location, String phraseSet) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setPhraseSet(phraseSet) + .build() + .toString(); + } + + public static PhraseSetName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_PHRASE_SET.validatedMatch( + formattedString, "PhraseSetName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("phrase_set")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (PhraseSetName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_PHRASE_SET.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (phraseSet != null) { + fieldMapBuilder.put("phrase_set", phraseSet); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_PHRASE_SET.instantiate( + "project", project, "location", location, "phrase_set", phraseSet); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + PhraseSetName that = ((PhraseSetName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.phraseSet, that.phraseSet); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(phraseSet); + return h; + } + + /** Builder for projects/{project}/locations/{location}/phraseSets/{phrase_set}. */ + public static class Builder { + private String project; + private String location; + private String phraseSet; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPhraseSet() { + return phraseSet; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setPhraseSet(String phraseSet) { + this.phraseSet = phraseSet; + return this; + } + + private Builder(PhraseSetName phraseSetName) { + this.project = phraseSetName.project; + this.location = phraseSetName.location; + this.phraseSet = phraseSetName.phraseSet; + } + + public PhraseSetName build() { + return new PhraseSetName(this); + } + } +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetOrBuilder.java new file mode 100644 index 000000000000..1ed61ed52826 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetOrBuilder.java @@ -0,0 +1,91 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/resource.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface PhraseSetOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.PhraseSet) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource name of the phrase set.
+   * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+   * The resource name of the phrase set.
+   * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + java.util.List + getPhrasesList(); + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getPhrases(int index); + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + int getPhrasesCount(); + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + java.util.List + getPhrasesOrBuilderList(); + /** + *
+   * A list of word and phrases.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; + */ + com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( + int index); + + /** + *
+   * Hint Boost. Positive value will increase the probability that a specific
+   * phrase will be recognized over other similar sounding phrases. The higher
+   * the boost, the higher the chance of false positive recognition as well.
+   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+   * enabled, so negative boost will simply be ignored. Though `boost` can
+   * accept a wide range of positive values, most use cases are best served with
+   * values between 0 (exclusive) and 20. We recommend using a binary search
+   * approach to finding the optimal value for your use case. Speech recognition
+   * will skip PhraseSets with a boost value of 0.
+   * 
+ * + * float boost = 4; + * @return The boost. + */ + float getBoost(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudio.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudio.java new file mode 100644 index 000000000000..fe2a09446dbd --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudio.java @@ -0,0 +1,906 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Contains audio data in the encoding specified in the `RecognitionConfig`.
+ * Either `content` or `uri` must be supplied. Supplying both or neither
+ * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
+ * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionAudio} + */ +public final class RecognitionAudio extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognitionAudio) + RecognitionAudioOrBuilder { +private static final long serialVersionUID = 0L; + // Use RecognitionAudio.newBuilder() to construct. + private RecognitionAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RecognitionAudio() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RecognitionAudio(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RecognitionAudio( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + audioSource_ = input.readBytes(); + audioSourceCase_ = 1; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + audioSourceCase_ = 2; + audioSource_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.RecognitionAudio.class, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder.class); + } + + private int audioSourceCase_ = 0; + private java.lang.Object audioSource_; + public enum AudioSourceCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CONTENT(1), + URI(2), + AUDIOSOURCE_NOT_SET(0); + private final int value; + private AudioSourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AudioSourceCase valueOf(int value) { + return forNumber(value); + } + + public static AudioSourceCase forNumber(int value) { + switch (value) { + case 1: return CONTENT; + case 2: return URI; + case 0: return AUDIOSOURCE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public AudioSourceCase + getAudioSourceCase() { + return AudioSourceCase.forNumber( + audioSourceCase_); + } + + public static final int CONTENT_FIELD_NUMBER = 1; + /** + *
+   * The audio data bytes encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation, whereas JSON representations use base64.
+   * 
+ * + * bytes content = 1; + * @return Whether the content field is set. + */ + @java.lang.Override + public boolean hasContent() { + return audioSourceCase_ == 1; + } + /** + *
+   * The audio data bytes encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation, whereas JSON representations use base64.
+   * 
+ * + * bytes content = 1; + * @return The content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContent() { + if (audioSourceCase_ == 1) { + return (com.google.protobuf.ByteString) audioSource_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int URI_FIELD_NUMBER = 2; + /** + *
+   * URI that points to a file that contains audio data bytes as specified in
+   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+   * Currently, only Google Cloud Storage URIs are
+   * supported, which must be specified in the following format:
+   * `gs://bucket_name/object_name` (other URI formats return
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+   * 
+ * + * string uri = 2; + * @return Whether the uri field is set. + */ + public boolean hasUri() { + return audioSourceCase_ == 2; + } + /** + *
+   * URI that points to a file that contains audio data bytes as specified in
+   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+   * Currently, only Google Cloud Storage URIs are
+   * supported, which must be specified in the following format:
+   * `gs://bucket_name/object_name` (other URI formats return
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+   * 
+ * + * string uri = 2; + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (audioSourceCase_ == 2) { + ref = audioSource_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (audioSourceCase_ == 2) { + audioSource_ = s; + } + return s; + } + } + /** + *
+   * URI that points to a file that contains audio data bytes as specified in
+   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+   * Currently, only Google Cloud Storage URIs are
+   * supported, which must be specified in the following format:
+   * `gs://bucket_name/object_name` (other URI formats return
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+   * 
+ * + * string uri = 2; + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = ""; + if (audioSourceCase_ == 2) { + ref = audioSource_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (audioSourceCase_ == 2) { + audioSource_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (audioSourceCase_ == 1) { + output.writeBytes( + 1, (com.google.protobuf.ByteString) audioSource_); + } + if (audioSourceCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, audioSource_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (audioSourceCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 1, (com.google.protobuf.ByteString) audioSource_); + } + if (audioSourceCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, audioSource_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.RecognitionAudio)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.RecognitionAudio other = (com.google.cloud.speech.v1p1beta1.RecognitionAudio) obj; + + if (!getAudioSourceCase().equals(other.getAudioSourceCase())) return false; + switch (audioSourceCase_) { + case 1: + if (!getContent() + .equals(other.getContent())) return false; + break; + case 2: + if (!getUri() + .equals(other.getUri())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (audioSourceCase_) { + case 1: + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + break; + case 2: + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.RecognitionAudio prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Contains audio data in the encoding specified in the `RecognitionConfig`.
+   * Either `content` or `uri` must be supplied. Supplying both or neither
+   * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
+   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionAudio} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognitionAudio) + com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.RecognitionAudio.class, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.RecognitionAudio.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + audioSourceCase_ = 0; + audioSource_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionAudio getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionAudio build() { + com.google.cloud.speech.v1p1beta1.RecognitionAudio result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionAudio buildPartial() { + com.google.cloud.speech.v1p1beta1.RecognitionAudio result = new com.google.cloud.speech.v1p1beta1.RecognitionAudio(this); + if (audioSourceCase_ == 1) { + result.audioSource_ = audioSource_; + } + if (audioSourceCase_ == 2) { + result.audioSource_ = audioSource_; + } + result.audioSourceCase_ = audioSourceCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.RecognitionAudio) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognitionAudio)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognitionAudio other) { + if (other == com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance()) return this; + switch (other.getAudioSourceCase()) { + case CONTENT: { + setContent(other.getContent()); + break; + } + case URI: { + audioSourceCase_ = 2; + audioSource_ = other.audioSource_; + onChanged(); + break; + } + case AUDIOSOURCE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.RecognitionAudio parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.RecognitionAudio) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int audioSourceCase_ = 0; + private java.lang.Object audioSource_; + public AudioSourceCase + getAudioSourceCase() { + return AudioSourceCase.forNumber( + audioSourceCase_); + } + + public Builder clearAudioSource() { + audioSourceCase_ = 0; + audioSource_ = null; + onChanged(); + return this; + } + + + /** + *
+     * The audio data bytes encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation, whereas JSON representations use base64.
+     * 
+ * + * bytes content = 1; + * @return Whether the content field is set. + */ + public boolean hasContent() { + return audioSourceCase_ == 1; + } + /** + *
+     * The audio data bytes encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation, whereas JSON representations use base64.
+     * 
+ * + * bytes content = 1; + * @return The content. + */ + public com.google.protobuf.ByteString getContent() { + if (audioSourceCase_ == 1) { + return (com.google.protobuf.ByteString) audioSource_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
+     * The audio data bytes encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation, whereas JSON representations use base64.
+     * 
+ * + * bytes content = 1; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + audioSourceCase_ = 1; + audioSource_ = value; + onChanged(); + return this; + } + /** + *
+     * The audio data bytes encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation, whereas JSON representations use base64.
+     * 
+ * + * bytes content = 1; + * @return This builder for chaining. + */ + public Builder clearContent() { + if (audioSourceCase_ == 1) { + audioSourceCase_ = 0; + audioSource_ = null; + onChanged(); + } + return this; + } + + /** + *
+     * URI that points to a file that contains audio data bytes as specified in
+     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+     * Currently, only Google Cloud Storage URIs are
+     * supported, which must be specified in the following format:
+     * `gs://bucket_name/object_name` (other URI formats return
+     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+     * 
+ * + * string uri = 2; + * @return Whether the uri field is set. + */ + @java.lang.Override + public boolean hasUri() { + return audioSourceCase_ == 2; + } + /** + *
+     * URI that points to a file that contains audio data bytes as specified in
+     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+     * Currently, only Google Cloud Storage URIs are
+     * supported, which must be specified in the following format:
+     * `gs://bucket_name/object_name` (other URI formats return
+     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+     * 
+ * + * string uri = 2; + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (audioSourceCase_ == 2) { + ref = audioSource_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (audioSourceCase_ == 2) { + audioSource_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * URI that points to a file that contains audio data bytes as specified in
+     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+     * Currently, only Google Cloud Storage URIs are
+     * supported, which must be specified in the following format:
+     * `gs://bucket_name/object_name` (other URI formats return
+     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+     * 
+ * + * string uri = 2; + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = ""; + if (audioSourceCase_ == 2) { + ref = audioSource_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (audioSourceCase_ == 2) { + audioSource_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * URI that points to a file that contains audio data bytes as specified in
+     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+     * Currently, only Google Cloud Storage URIs are
+     * supported, which must be specified in the following format:
+     * `gs://bucket_name/object_name` (other URI formats return
+     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+     * 
+ * + * string uri = 2; + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + audioSourceCase_ = 2; + audioSource_ = value; + onChanged(); + return this; + } + /** + *
+     * URI that points to a file that contains audio data bytes as specified in
+     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+     * Currently, only Google Cloud Storage URIs are
+     * supported, which must be specified in the following format:
+     * `gs://bucket_name/object_name` (other URI formats return
+     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+     * 
+ * + * string uri = 2; + * @return This builder for chaining. + */ + public Builder clearUri() { + if (audioSourceCase_ == 2) { + audioSourceCase_ = 0; + audioSource_ = null; + onChanged(); + } + return this; + } + /** + *
+     * URI that points to a file that contains audio data bytes as specified in
+     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+     * Currently, only Google Cloud Storage URIs are
+     * supported, which must be specified in the following format:
+     * `gs://bucket_name/object_name` (other URI formats return
+     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+     * 
+ * + * string uri = 2; + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + audioSourceCase_ = 2; + audioSource_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.RecognitionAudio) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognitionAudio) + private static final com.google.cloud.speech.v1p1beta1.RecognitionAudio DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognitionAudio(); + } + + public static com.google.cloud.speech.v1p1beta1.RecognitionAudio getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecognitionAudio parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecognitionAudio(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionAudio getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudioOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudioOrBuilder.java new file mode 100644 index 000000000000..6127a94e206c --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudioOrBuilder.java @@ -0,0 +1,81 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface RecognitionAudioOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognitionAudio) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The audio data bytes encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation, whereas JSON representations use base64.
+   * 
+ * + * bytes content = 1; + * @return Whether the content field is set. + */ + boolean hasContent(); + /** + *
+   * The audio data bytes encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation, whereas JSON representations use base64.
+   * 
+ * + * bytes content = 1; + * @return The content. + */ + com.google.protobuf.ByteString getContent(); + + /** + *
+   * URI that points to a file that contains audio data bytes as specified in
+   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+   * Currently, only Google Cloud Storage URIs are
+   * supported, which must be specified in the following format:
+   * `gs://bucket_name/object_name` (other URI formats return
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+   * 
+ * + * string uri = 2; + * @return Whether the uri field is set. + */ + boolean hasUri(); + /** + *
+   * URI that points to a file that contains audio data bytes as specified in
+   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+   * Currently, only Google Cloud Storage URIs are
+   * supported, which must be specified in the following format:
+   * `gs://bucket_name/object_name` (other URI formats return
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+   * 
+ * + * string uri = 2; + * @return The uri. + */ + java.lang.String getUri(); + /** + *
+   * URI that points to a file that contains audio data bytes as specified in
+   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
+   * Currently, only Google Cloud Storage URIs are
+   * supported, which must be specified in the following format:
+   * `gs://bucket_name/object_name` (other URI formats return
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
+   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+   * 
+ * + * string uri = 2; + * @return The bytes for uri. + */ + com.google.protobuf.ByteString + getUriBytes(); + + public com.google.cloud.speech.v1p1beta1.RecognitionAudio.AudioSourceCase getAudioSourceCase(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java new file mode 100644 index 000000000000..7acf02511c20 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java @@ -0,0 +1,5330 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Provides information to the recognizer that specifies how to process the
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionConfig} + */ +public final class RecognitionConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognitionConfig) + RecognitionConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use RecognitionConfig.newBuilder() to construct. + private RecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RecognitionConfig() { + encoding_ = 0; + languageCode_ = ""; + alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + speechContexts_ = java.util.Collections.emptyList(); + model_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RecognitionConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RecognitionConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + encoding_ = rawValue; + break; + } + case 16: { + + sampleRateHertz_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + case 32: { + + maxAlternatives_ = input.readInt32(); + break; + } + case 40: { + + profanityFilter_ = input.readBool(); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + speechContexts_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + speechContexts_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.SpeechContext.parser(), extensionRegistry)); + break; + } + case 56: { + + audioChannelCount_ = input.readInt32(); + break; + } + case 64: { + + enableWordTimeOffsets_ = input.readBool(); + break; + } + case 74: { + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder subBuilder = null; + if (metadata_ != null) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = input.readMessage(com.google.cloud.speech.v1p1beta1.RecognitionMetadata.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = subBuilder.buildPartial(); + } + + break; + } + case 88: { + + enableAutomaticPunctuation_ = input.readBool(); + break; + } + case 96: { + + enableSeparateRecognitionPerChannel_ = input.readBool(); + break; + } + case 106: { + java.lang.String s = input.readStringRequireUtf8(); + + model_ = s; + break; + } + case 112: { + + useEnhanced_ = input.readBool(); + break; + } + case 120: { + + enableWordConfidence_ = input.readBool(); + break; + } + case 128: { + + enableSpeakerDiarization_ = input.readBool(); + break; + } + case 136: { + + diarizationSpeakerCount_ = input.readInt32(); + break; + } + case 146: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + alternativeLanguageCodes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + alternativeLanguageCodes_.add(s); + break; + } + case 154: { + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder subBuilder = null; + if (diarizationConfig_ != null) { + subBuilder = diarizationConfig_.toBuilder(); + } + diarizationConfig_ = input.readMessage(com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(diarizationConfig_); + diarizationConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 162: { + com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder subBuilder = null; + if (adaptation_ != null) { + subBuilder = adaptation_.toBuilder(); + } + adaptation_ = input.readMessage(com.google.cloud.speech.v1p1beta1.SpeechAdaptation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(adaptation_); + adaptation_ = subBuilder.buildPartial(); + } + + break; + } + case 178: { + com.google.protobuf.BoolValue.Builder subBuilder = null; + if (enableSpokenPunctuation_ != null) { + subBuilder = enableSpokenPunctuation_.toBuilder(); + } + enableSpokenPunctuation_ = input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(enableSpokenPunctuation_); + enableSpokenPunctuation_ = subBuilder.buildPartial(); + } + + break; + } + case 186: { + com.google.protobuf.BoolValue.Builder subBuilder = null; + if (enableSpokenEmojis_ != null) { + subBuilder = enableSpokenEmojis_.toBuilder(); + } + enableSpokenEmojis_ = input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(enableSpokenEmojis_); + enableSpokenEmojis_ = subBuilder.buildPartial(); + } + + break; + } + case 194: { + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder subBuilder = null; + if (transcriptNormalization_ != null) { + subBuilder = transcriptNormalization_.toBuilder(); + } + transcriptNormalization_ = input.readMessage(com.google.cloud.speech.v1p1beta1.TranscriptNormalization.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(transcriptNormalization_); + transcriptNormalization_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); + } + if (((mutable_bitField0_ & 0x00000001) != 0)) { + alternativeLanguageCodes_ = alternativeLanguageCodes_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.RecognitionConfig.class, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder.class); + } + + /** + *
+   * The encoding of the audio data sent in the request.
+   * All encodings support only 1 channel (mono) audio, unless the
+   * `audio_channel_count` and `enable_separate_recognition_per_channel` fields
+   * are set.
+   * For best results, the audio source should be captured and transmitted using
+   * a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
+   * recognition can be reduced if lossy codecs are used to capture or transmit
+   * audio, particularly if background noise is present. Lossy codecs include
+   * `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`,
+   * and `WEBM_OPUS`.
+   * The `FLAC` and `WAV` audio file formats include a header that describes the
+   * included audio content. You can request recognition for `WAV` files that
+   * contain either `LINEAR16` or `MULAW` encoded audio.
+   * If you send `FLAC` or `WAV` audio file format in
+   * your request, you do not need to specify an `AudioEncoding`; the audio
+   * encoding format is determined from the file header. If you specify
+   * an `AudioEncoding` when you send  send `FLAC` or `WAV` audio, the
+   * encoding configuration must match the encoding described in the audio
+   * header; otherwise the request returns an
+   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code.
+   * 
+ * + * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding} + */ + public enum AudioEncoding + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Not specified.
+     * 
+ * + * ENCODING_UNSPECIFIED = 0; + */ + ENCODING_UNSPECIFIED(0), + /** + *
+     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
+     * 
+ * + * LINEAR16 = 1; + */ + LINEAR16(1), + /** + *
+     * `FLAC` (Free Lossless Audio
+     * Codec) is the recommended encoding because it is
+     * lossless--therefore recognition is not compromised--and
+     * requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
+     * encoding supports 16-bit and 24-bit samples, however, not all fields in
+     * `STREAMINFO` are supported.
+     * 
+ * + * FLAC = 2; + */ + FLAC(2), + /** + *
+     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
+     * 
+ * + * MULAW = 3; + */ + MULAW(3), + /** + *
+     * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
+     * 
+ * + * AMR = 4; + */ + AMR(4), + /** + *
+     * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
+     * 
+ * + * AMR_WB = 5; + */ + AMR_WB(5), + /** + *
+     * Opus encoded audio frames in Ogg container
+     * ([OggOpus](https://wiki.xiph.org/OggOpus)).
+     * `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
+     * 
+ * + * OGG_OPUS = 6; + */ + OGG_OPUS(6), + /** + *
+     * Although the use of lossy encodings is not recommended, if a very low
+     * bitrate encoding is required, `OGG_OPUS` is highly preferred over
+     * Speex encoding. The [Speex](https://speex.org/)  encoding supported by
+     * Cloud Speech API has a header byte in each block, as in MIME type
+     * `audio/x-speex-with-header-byte`.
+     * It is a variant of the RTP Speex encoding defined in
+     * [RFC 5574](https://tools.ietf.org/html/rfc5574).
+     * The stream is a sequence of blocks, one block per RTP packet. Each block
+     * starts with a byte containing the length of the block, in bytes, followed
+     * by one or more frames of Speex data, padded to an integral number of
+     * bytes (octets) as specified in RFC 5574. In other words, each RTP header
+     * is replaced with a single byte containing the block length. Only Speex
+     * wideband is supported. `sample_rate_hertz` must be 16000.
+     * 
+ * + * SPEEX_WITH_HEADER_BYTE = 7; + */ + SPEEX_WITH_HEADER_BYTE(7), + /** + *
+     * MP3 audio. MP3 encoding is a Beta feature and only available in
+     * v1p1beta1. Support all standard MP3 bitrates (which range from 32-320
+     * kbps). When using this encoding, `sample_rate_hertz` has to match the
+     * sample rate of the file being used.
+     * 
+ * + * MP3 = 8; + */ + MP3(8), + /** + *
+     * Opus encoded audio frames in WebM container
+     * ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be
+     * one of 8000, 12000, 16000, 24000, or 48000.
+     * 
+ * + * WEBM_OPUS = 9; + */ + WEBM_OPUS(9), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Not specified.
+     * 
+ * + * ENCODING_UNSPECIFIED = 0; + */ + public static final int ENCODING_UNSPECIFIED_VALUE = 0; + /** + *
+     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
+     * 
+ * + * LINEAR16 = 1; + */ + public static final int LINEAR16_VALUE = 1; + /** + *
+     * `FLAC` (Free Lossless Audio
+     * Codec) is the recommended encoding because it is
+     * lossless--therefore recognition is not compromised--and
+     * requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
+     * encoding supports 16-bit and 24-bit samples, however, not all fields in
+     * `STREAMINFO` are supported.
+     * 
+ * + * FLAC = 2; + */ + public static final int FLAC_VALUE = 2; + /** + *
+     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
+     * 
+ * + * MULAW = 3; + */ + public static final int MULAW_VALUE = 3; + /** + *
+     * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
+     * 
+ * + * AMR = 4; + */ + public static final int AMR_VALUE = 4; + /** + *
+     * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
+     * 
+ * + * AMR_WB = 5; + */ + public static final int AMR_WB_VALUE = 5; + /** + *
+     * Opus encoded audio frames in Ogg container
+     * ([OggOpus](https://wiki.xiph.org/OggOpus)).
+     * `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
+     * 
+ * + * OGG_OPUS = 6; + */ + public static final int OGG_OPUS_VALUE = 6; + /** + *
+     * Although the use of lossy encodings is not recommended, if a very low
+     * bitrate encoding is required, `OGG_OPUS` is highly preferred over
+     * Speex encoding. The [Speex](https://speex.org/)  encoding supported by
+     * Cloud Speech API has a header byte in each block, as in MIME type
+     * `audio/x-speex-with-header-byte`.
+     * It is a variant of the RTP Speex encoding defined in
+     * [RFC 5574](https://tools.ietf.org/html/rfc5574).
+     * The stream is a sequence of blocks, one block per RTP packet. Each block
+     * starts with a byte containing the length of the block, in bytes, followed
+     * by one or more frames of Speex data, padded to an integral number of
+     * bytes (octets) as specified in RFC 5574. In other words, each RTP header
+     * is replaced with a single byte containing the block length. Only Speex
+     * wideband is supported. `sample_rate_hertz` must be 16000.
+     * 
+ * + * SPEEX_WITH_HEADER_BYTE = 7; + */ + public static final int SPEEX_WITH_HEADER_BYTE_VALUE = 7; + /** + *
+     * MP3 audio. MP3 encoding is a Beta feature and only available in
+     * v1p1beta1. Support all standard MP3 bitrates (which range from 32-320
+     * kbps). When using this encoding, `sample_rate_hertz` has to match the
+     * sample rate of the file being used.
+     * 
+ * + * MP3 = 8; + */ + public static final int MP3_VALUE = 8; + /** + *
+     * Opus encoded audio frames in WebM container
+     * ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be
+     * one of 8000, 12000, 16000, 24000, or 48000.
+     * 
+ * + * WEBM_OPUS = 9; + */ + public static final int WEBM_OPUS_VALUE = 9; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AudioEncoding valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static AudioEncoding forNumber(int value) { + switch (value) { + case 0: return ENCODING_UNSPECIFIED; + case 1: return LINEAR16; + case 2: return FLAC; + case 3: return MULAW; + case 4: return AMR; + case 5: return AMR_WB; + case 6: return OGG_OPUS; + case 7: return SPEEX_WITH_HEADER_BYTE; + case 8: return MP3; + case 9: return WEBM_OPUS; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AudioEncoding> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AudioEncoding findValueByNumber(int number) { + return AudioEncoding.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final AudioEncoding[] VALUES = values(); + + public static AudioEncoding valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private AudioEncoding(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding) + } + + public static final int ENCODING_FIELD_NUMBER = 1; + private int encoding_; + /** + *
+   * Encoding of audio data sent in all `RecognitionAudio` messages.
+   * This field is optional for `FLAC` and `WAV` audio files and required
+   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; + * @return The enum numeric value on the wire for encoding. + */ + @java.lang.Override public int getEncodingValue() { + return encoding_; + } + /** + *
+   * Encoding of audio data sent in all `RecognitionAudio` messages.
+   * This field is optional for `FLAC` and `WAV` audio files and required
+   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; + * @return The encoding. + */ + @java.lang.Override public com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding getEncoding() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding result = com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.valueOf(encoding_); + return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.UNRECOGNIZED : result; + } + + public static final int SAMPLE_RATE_HERTZ_FIELD_NUMBER = 2; + private int sampleRateHertz_; + /** + *
+   * Sample rate in Hertz of the audio data sent in all
+   * `RecognitionAudio` messages. Valid values are: 8000-48000.
+   * 16000 is optimal. For best results, set the sampling rate of the audio
+   * source to 16000 Hz. If that's not possible, use the native sample rate of
+   * the audio source (instead of re-sampling).
+   * This field is optional for FLAC and WAV audio files, but is
+   * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+   * 
+ * + * int32 sample_rate_hertz = 2; + * @return The sampleRateHertz. + */ + @java.lang.Override + public int getSampleRateHertz() { + return sampleRateHertz_; + } + + public static final int AUDIO_CHANNEL_COUNT_FIELD_NUMBER = 7; + private int audioChannelCount_; + /** + *
+   * The number of channels in the input audio data.
+   * ONLY set this for MULTI-CHANNEL recognition.
+   * Valid values for LINEAR16 and FLAC are `1`-`8`.
+   * Valid values for OGG_OPUS are '1'-'254'.
+   * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
+   * If `0` or omitted, defaults to one channel (mono).
+   * Note: We only recognize the first channel by default.
+   * To perform independent recognition on each channel set
+   * `enable_separate_recognition_per_channel` to 'true'.
+   * 
+ * + * int32 audio_channel_count = 7; + * @return The audioChannelCount. + */ + @java.lang.Override + public int getAudioChannelCount() { + return audioChannelCount_; + } + + public static final int ENABLE_SEPARATE_RECOGNITION_PER_CHANNEL_FIELD_NUMBER = 12; + private boolean enableSeparateRecognitionPerChannel_; + /** + *
+   * This needs to be set to `true` explicitly and `audio_channel_count` > 1
+   * to get each channel recognized separately. The recognition result will
+   * contain a `channel_tag` field to state which channel that result belongs
+   * to. If this is not true, we will only recognize the first channel. The
+   * request is billed cumulatively for all channels recognized:
+   * `audio_channel_count` multiplied by the length of the audio.
+   * 
+ * + * bool enable_separate_recognition_per_channel = 12; + * @return The enableSeparateRecognitionPerChannel. + */ + @java.lang.Override + public boolean getEnableSeparateRecognitionPerChannel() { + return enableSeparateRecognitionPerChannel_; + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object languageCode_; + /** + *
+   * Required. The language of the supplied audio as a
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+   * Example: "en-US".
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes.
+   * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + *
+   * Required. The language of the supplied audio as a
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+   * Example: "en-US".
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes.
+   * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALTERNATIVE_LANGUAGE_CODES_FIELD_NUMBER = 18; + private com.google.protobuf.LazyStringList alternativeLanguageCodes_; + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @return A list containing the alternativeLanguageCodes. + */ + public com.google.protobuf.ProtocolStringList + getAlternativeLanguageCodesList() { + return alternativeLanguageCodes_; + } + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @return The count of alternativeLanguageCodes. + */ + public int getAlternativeLanguageCodesCount() { + return alternativeLanguageCodes_.size(); + } + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index of the element to return. + * @return The alternativeLanguageCodes at the given index. + */ + public java.lang.String getAlternativeLanguageCodes(int index) { + return alternativeLanguageCodes_.get(index); + } + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index of the value to return. + * @return The bytes of the alternativeLanguageCodes at the given index. + */ + public com.google.protobuf.ByteString + getAlternativeLanguageCodesBytes(int index) { + return alternativeLanguageCodes_.getByteString(index); + } + + public static final int MAX_ALTERNATIVES_FIELD_NUMBER = 4; + private int maxAlternatives_; + /** + *
+   * Maximum number of recognition hypotheses to be returned.
+   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
+   * within each `SpeechRecognitionResult`.
+   * The server may return fewer than `max_alternatives`.
+   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
+   * one. If omitted, will return a maximum of one.
+   * 
+ * + * int32 max_alternatives = 4; + * @return The maxAlternatives. + */ + @java.lang.Override + public int getMaxAlternatives() { + return maxAlternatives_; + } + + public static final int PROFANITY_FILTER_FIELD_NUMBER = 5; + private boolean profanityFilter_; + /** + *
+   * If set to `true`, the server will attempt to filter out
+   * profanities, replacing all but the initial character in each filtered word
+   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
+   * won't be filtered out.
+   * 
+ * + * bool profanity_filter = 5; + * @return The profanityFilter. + */ + @java.lang.Override + public boolean getProfanityFilter() { + return profanityFilter_; + } + + public static final int ADAPTATION_FIELD_NUMBER = 20; + private com.google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation_; + /** + *
+   * Speech adaptation configuration improves the accuracy of speech
+   * recognition. For more information, see the [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+   * documentation.
+   * When speech adaptation is set it supersedes the `speech_contexts` field.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + * @return Whether the adaptation field is set. + */ + @java.lang.Override + public boolean hasAdaptation() { + return adaptation_ != null; + } + /** + *
+   * Speech adaptation configuration improves the accuracy of speech
+   * recognition. For more information, see the [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+   * documentation.
+   * When speech adaptation is set it supersedes the `speech_contexts` field.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + * @return The adaptation. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptation getAdaptation() { + return adaptation_ == null ? com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance() : adaptation_; + } + /** + *
+   * Speech adaptation configuration improves the accuracy of speech
+   * recognition. For more information, see the [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+   * documentation.
+   * When speech adaptation is set it supersedes the `speech_contexts` field.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder getAdaptationOrBuilder() { + return getAdaptation(); + } + + public static final int TRANSCRIPT_NORMALIZATION_FIELD_NUMBER = 24; + private com.google.cloud.speech.v1p1beta1.TranscriptNormalization transcriptNormalization_; + /** + *
+   * Use transcription normalization to automatically replace parts of the
+   * transcript with phrases of your choosing. For StreamingRecognize, this
+   * normalization only applies to stable partial transcripts (stability > 0.8)
+   * and final transcripts.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + * @return Whether the transcriptNormalization field is set. + */ + @java.lang.Override + public boolean hasTranscriptNormalization() { + return transcriptNormalization_ != null; + } + /** + *
+   * Use transcription normalization to automatically replace parts of the
+   * transcript with phrases of your choosing. For StreamingRecognize, this
+   * normalization only applies to stable partial transcripts (stability > 0.8)
+   * and final transcripts.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + * @return The transcriptNormalization. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization getTranscriptNormalization() { + return transcriptNormalization_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptNormalization.getDefaultInstance() : transcriptNormalization_; + } + /** + *
+   * Use transcription normalization to automatically replace parts of the
+   * transcript with phrases of your choosing. For StreamingRecognize, this
+   * normalization only applies to stable partial transcripts (stability > 0.8)
+   * and final transcripts.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder getTranscriptNormalizationOrBuilder() { + return getTranscriptNormalization(); + } + + public static final int SPEECH_CONTEXTS_FIELD_NUMBER = 6; + private java.util.List speechContexts_; + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + @java.lang.Override + public java.util.List getSpeechContextsList() { + return speechContexts_; + } + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + @java.lang.Override + public java.util.List + getSpeechContextsOrBuilderList() { + return speechContexts_; + } + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + @java.lang.Override + public int getSpeechContextsCount() { + return speechContexts_.size(); + } + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechContext getSpeechContexts(int index) { + return speechContexts_.get(index); + } + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder getSpeechContextsOrBuilder( + int index) { + return speechContexts_.get(index); + } + + public static final int ENABLE_WORD_TIME_OFFSETS_FIELD_NUMBER = 8; + private boolean enableWordTimeOffsets_; + /** + *
+   * If `true`, the top result includes a list of words and
+   * the start and end time offsets (timestamps) for those words. If
+   * `false`, no word-level time offset information is returned. The default is
+   * `false`.
+   * 
+ * + * bool enable_word_time_offsets = 8; + * @return The enableWordTimeOffsets. + */ + @java.lang.Override + public boolean getEnableWordTimeOffsets() { + return enableWordTimeOffsets_; + } + + public static final int ENABLE_WORD_CONFIDENCE_FIELD_NUMBER = 15; + private boolean enableWordConfidence_; + /** + *
+   * If `true`, the top result includes a list of words and the
+   * confidence for those words. If `false`, no word-level confidence
+   * information is returned. The default is `false`.
+   * 
+ * + * bool enable_word_confidence = 15; + * @return The enableWordConfidence. + */ + @java.lang.Override + public boolean getEnableWordConfidence() { + return enableWordConfidence_; + } + + public static final int ENABLE_AUTOMATIC_PUNCTUATION_FIELD_NUMBER = 11; + private boolean enableAutomaticPunctuation_; + /** + *
+   * If 'true', adds punctuation to recognition result hypotheses.
+   * This feature is only available in select languages. Setting this for
+   * requests in other languages has no effect at all.
+   * The default 'false' value does not add punctuation to result hypotheses.
+   * 
+ * + * bool enable_automatic_punctuation = 11; + * @return The enableAutomaticPunctuation. + */ + @java.lang.Override + public boolean getEnableAutomaticPunctuation() { + return enableAutomaticPunctuation_; + } + + public static final int ENABLE_SPOKEN_PUNCTUATION_FIELD_NUMBER = 22; + private com.google.protobuf.BoolValue enableSpokenPunctuation_; + /** + *
+   * The spoken punctuation behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * e.g. command_and_search will enable spoken punctuation by default
+   * If 'true', replaces spoken punctuation with the corresponding symbols in
+   * the request. For example, "how are you question mark" becomes "how are
+   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+   * for support. If 'false', spoken punctuation is not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + * @return Whether the enableSpokenPunctuation field is set. + */ + @java.lang.Override + public boolean hasEnableSpokenPunctuation() { + return enableSpokenPunctuation_ != null; + } + /** + *
+   * The spoken punctuation behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * e.g. command_and_search will enable spoken punctuation by default
+   * If 'true', replaces spoken punctuation with the corresponding symbols in
+   * the request. For example, "how are you question mark" becomes "how are
+   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+   * for support. If 'false', spoken punctuation is not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + * @return The enableSpokenPunctuation. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnableSpokenPunctuation() { + return enableSpokenPunctuation_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenPunctuation_; + } + /** + *
+   * The spoken punctuation behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * e.g. command_and_search will enable spoken punctuation by default
+   * If 'true', replaces spoken punctuation with the corresponding symbols in
+   * the request. For example, "how are you question mark" becomes "how are
+   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+   * for support. If 'false', spoken punctuation is not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilder() { + return getEnableSpokenPunctuation(); + } + + public static final int ENABLE_SPOKEN_EMOJIS_FIELD_NUMBER = 23; + private com.google.protobuf.BoolValue enableSpokenEmojis_; + /** + *
+   * The spoken emoji behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * If 'true', adds spoken emoji formatting for the request. This will replace
+   * spoken emojis with the corresponding Unicode symbols in the final
+   * transcript. If 'false', spoken emojis are not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + * @return Whether the enableSpokenEmojis field is set. + */ + @java.lang.Override + public boolean hasEnableSpokenEmojis() { + return enableSpokenEmojis_ != null; + } + /** + *
+   * The spoken emoji behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * If 'true', adds spoken emoji formatting for the request. This will replace
+   * spoken emojis with the corresponding Unicode symbols in the final
+   * transcript. If 'false', spoken emojis are not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + * @return The enableSpokenEmojis. + */ + @java.lang.Override + public com.google.protobuf.BoolValue getEnableSpokenEmojis() { + return enableSpokenEmojis_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenEmojis_; + } + /** + *
+   * The spoken emoji behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * If 'true', adds spoken emoji formatting for the request. This will replace
+   * spoken emojis with the corresponding Unicode symbols in the final
+   * transcript. If 'false', spoken emojis are not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + @java.lang.Override + public com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder() { + return getEnableSpokenEmojis(); + } + + public static final int ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER = 16; + private boolean enableSpeakerDiarization_; + /** + *
+   * If 'true', enables speaker detection for each recognized word in
+   * the top alternative of the recognition result using a speaker_tag provided
+   * in the WordInfo.
+   * Note: Use diarization_config instead.
+   * 
+ * + * bool enable_speaker_diarization = 16 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378 + * @return The enableSpeakerDiarization. + */ + @java.lang.Override + @java.lang.Deprecated public boolean getEnableSpeakerDiarization() { + return enableSpeakerDiarization_; + } + + public static final int DIARIZATION_SPEAKER_COUNT_FIELD_NUMBER = 17; + private int diarizationSpeakerCount_; + /** + *
+   * If set, specifies the estimated number of speakers in the conversation.
+   * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
+   * Note: Use diarization_config instead.
+   * 
+ * + * int32 diarization_speaker_count = 17 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383 + * @return The diarizationSpeakerCount. + */ + @java.lang.Override + @java.lang.Deprecated public int getDiarizationSpeakerCount() { + return diarizationSpeakerCount_; + } + + public static final int DIARIZATION_CONFIG_FIELD_NUMBER = 19; + private com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarizationConfig_; + /** + *
+   * Config to enable speaker diarization and set additional
+   * parameters to make diarization better suited for your application.
+   * Note: When this is enabled, we send all the words from the beginning of the
+   * audio for the top alternative in every consecutive STREAMING responses.
+   * This is done in order to improve our speaker tags as our models learn to
+   * identify the speakers in the conversation over time.
+   * For non-streaming requests, the diarization results will be provided only
+   * in the top alternative of the FINAL SpeechRecognitionResult.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + * @return Whether the diarizationConfig field is set. + */ + @java.lang.Override + public boolean hasDiarizationConfig() { + return diarizationConfig_ != null; + } + /** + *
+   * Config to enable speaker diarization and set additional
+   * parameters to make diarization better suited for your application.
+   * Note: When this is enabled, we send all the words from the beginning of the
+   * audio for the top alternative in every consecutive STREAMING responses.
+   * This is done in order to improve our speaker tags as our models learn to
+   * identify the speakers in the conversation over time.
+   * For non-streaming requests, the diarization results will be provided only
+   * in the top alternative of the FINAL SpeechRecognitionResult.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + * @return The diarizationConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDiarizationConfig() { + return diarizationConfig_ == null ? com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance() : diarizationConfig_; + } + /** + *
+   * Config to enable speaker diarization and set additional
+   * parameters to make diarization better suited for your application.
+   * Note: When this is enabled, we send all the words from the beginning of the
+   * audio for the top alternative in every consecutive STREAMING responses.
+   * This is done in order to improve our speaker tags as our models learn to
+   * identify the speakers in the conversation over time.
+   * For non-streaming requests, the diarization results will be provided only
+   * in the top alternative of the FINAL SpeechRecognitionResult.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder() { + return getDiarizationConfig(); + } + + public static final int METADATA_FIELD_NUMBER = 9; + private com.google.cloud.speech.v1p1beta1.RecognitionMetadata metadata_; + /** + *
+   * Metadata regarding this request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + *
+   * Metadata regarding this request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + * @return The metadata. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionMetadata getMetadata() { + return metadata_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance() : metadata_; + } + /** + *
+   * Metadata regarding this request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + public static final int MODEL_FIELD_NUMBER = 13; + private volatile java.lang.Object model_; + /** + *
+   * Which model to select for the given request. Select the model
+   * best suited to your domain to get best results. If a model is not
+   * explicitly specified, then we auto-select a model based on the parameters
+   * in the RecognitionConfig.
+   * <table>
+   *   <tr>
+   *     <td><b>Model</b></td>
+   *     <td><b>Description</b></td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_long</code></td>
+   *     <td>Best for long form content like media or conversation.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_short</code></td>
+   *     <td>Best for short form content like commands or single shot directed
+   *     speech.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>command_and_search</code></td>
+   *     <td>Best for short queries such as voice commands or voice search.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>phone_call</code></td>
+   *     <td>Best for audio that originated from a phone call (typically
+   *     recorded at an 8khz sampling rate).</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>video</code></td>
+   *     <td>Best for audio that originated from video or includes multiple
+   *         speakers. Ideally the audio is recorded at a 16khz or greater
+   *         sampling rate. This is a premium model that costs more than the
+   *         standard rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>default</code></td>
+   *     <td>Best for audio that is not one of the specific audio models.
+   *         For example, long-form audio. Ideally the audio is high-fidelity,
+   *         recorded at a 16khz or greater sampling rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_conversation</code></td>
+   *     <td>Best for audio that originated from a conversation between a
+   *         medical provider and patient.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_dictation</code></td>
+   *     <td>Best for audio that originated from dictation notes by a medical
+   *         provider.</td>
+   *   </tr>
+   * </table>
+   * 
+ * + * string model = 13; + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } + } + /** + *
+   * Which model to select for the given request. Select the model
+   * best suited to your domain to get best results. If a model is not
+   * explicitly specified, then we auto-select a model based on the parameters
+   * in the RecognitionConfig.
+   * <table>
+   *   <tr>
+   *     <td><b>Model</b></td>
+   *     <td><b>Description</b></td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_long</code></td>
+   *     <td>Best for long form content like media or conversation.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_short</code></td>
+   *     <td>Best for short form content like commands or single shot directed
+   *     speech.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>command_and_search</code></td>
+   *     <td>Best for short queries such as voice commands or voice search.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>phone_call</code></td>
+   *     <td>Best for audio that originated from a phone call (typically
+   *     recorded at an 8khz sampling rate).</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>video</code></td>
+   *     <td>Best for audio that originated from video or includes multiple
+   *         speakers. Ideally the audio is recorded at a 16khz or greater
+   *         sampling rate. This is a premium model that costs more than the
+   *         standard rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>default</code></td>
+   *     <td>Best for audio that is not one of the specific audio models.
+   *         For example, long-form audio. Ideally the audio is high-fidelity,
+   *         recorded at a 16khz or greater sampling rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_conversation</code></td>
+   *     <td>Best for audio that originated from a conversation between a
+   *         medical provider and patient.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_dictation</code></td>
+   *     <td>Best for audio that originated from dictation notes by a medical
+   *         provider.</td>
+   *   </tr>
+   * </table>
+   * 
+ * + * string model = 13; + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USE_ENHANCED_FIELD_NUMBER = 14; + private boolean useEnhanced_; + /** + *
+   * Set to true to use an enhanced model for speech recognition.
+   * If `use_enhanced` is set to true and the `model` field is not set, then
+   * an appropriate enhanced model is chosen if an enhanced model exists for
+   * the audio.
+   * If `use_enhanced` is true and an enhanced version of the specified model
+   * does not exist, then the speech is recognized using the standard version
+   * of the specified model.
+   * 
+ * + * bool use_enhanced = 14; + * @return The useEnhanced. + */ + @java.lang.Override + public boolean getUseEnhanced() { + return useEnhanced_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (encoding_ != com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED.getNumber()) { + output.writeEnum(1, encoding_); + } + if (sampleRateHertz_ != 0) { + output.writeInt32(2, sampleRateHertz_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); + } + if (maxAlternatives_ != 0) { + output.writeInt32(4, maxAlternatives_); + } + if (profanityFilter_ != false) { + output.writeBool(5, profanityFilter_); + } + for (int i = 0; i < speechContexts_.size(); i++) { + output.writeMessage(6, speechContexts_.get(i)); + } + if (audioChannelCount_ != 0) { + output.writeInt32(7, audioChannelCount_); + } + if (enableWordTimeOffsets_ != false) { + output.writeBool(8, enableWordTimeOffsets_); + } + if (metadata_ != null) { + output.writeMessage(9, getMetadata()); + } + if (enableAutomaticPunctuation_ != false) { + output.writeBool(11, enableAutomaticPunctuation_); + } + if (enableSeparateRecognitionPerChannel_ != false) { + output.writeBool(12, enableSeparateRecognitionPerChannel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, model_); + } + if (useEnhanced_ != false) { + output.writeBool(14, useEnhanced_); + } + if (enableWordConfidence_ != false) { + output.writeBool(15, enableWordConfidence_); + } + if (enableSpeakerDiarization_ != false) { + output.writeBool(16, enableSpeakerDiarization_); + } + if (diarizationSpeakerCount_ != 0) { + output.writeInt32(17, diarizationSpeakerCount_); + } + for (int i = 0; i < alternativeLanguageCodes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, alternativeLanguageCodes_.getRaw(i)); + } + if (diarizationConfig_ != null) { + output.writeMessage(19, getDiarizationConfig()); + } + if (adaptation_ != null) { + output.writeMessage(20, getAdaptation()); + } + if (enableSpokenPunctuation_ != null) { + output.writeMessage(22, getEnableSpokenPunctuation()); + } + if (enableSpokenEmojis_ != null) { + output.writeMessage(23, getEnableSpokenEmojis()); + } + if (transcriptNormalization_ != null) { + output.writeMessage(24, getTranscriptNormalization()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (encoding_ != com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, encoding_); + } + if (sampleRateHertz_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, sampleRateHertz_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); + } + if (maxAlternatives_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, maxAlternatives_); + } + if (profanityFilter_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, profanityFilter_); + } + for (int i = 0; i < speechContexts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, speechContexts_.get(i)); + } + if (audioChannelCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, audioChannelCount_); + } + if (enableWordTimeOffsets_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, enableWordTimeOffsets_); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getMetadata()); + } + if (enableAutomaticPunctuation_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(11, enableAutomaticPunctuation_); + } + if (enableSeparateRecognitionPerChannel_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(12, enableSeparateRecognitionPerChannel_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, model_); + } + if (useEnhanced_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(14, useEnhanced_); + } + if (enableWordConfidence_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(15, enableWordConfidence_); + } + if (enableSpeakerDiarization_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(16, enableSpeakerDiarization_); + } + if (diarizationSpeakerCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(17, diarizationSpeakerCount_); + } + { + int dataSize = 0; + for (int i = 0; i < alternativeLanguageCodes_.size(); i++) { + dataSize += computeStringSizeNoTag(alternativeLanguageCodes_.getRaw(i)); + } + size += dataSize; + size += 2 * getAlternativeLanguageCodesList().size(); + } + if (diarizationConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(19, getDiarizationConfig()); + } + if (adaptation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(20, getAdaptation()); + } + if (enableSpokenPunctuation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(22, getEnableSpokenPunctuation()); + } + if (enableSpokenEmojis_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(23, getEnableSpokenEmojis()); + } + if (transcriptNormalization_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(24, getTranscriptNormalization()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.RecognitionConfig)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.RecognitionConfig other = (com.google.cloud.speech.v1p1beta1.RecognitionConfig) obj; + + if (encoding_ != other.encoding_) return false; + if (getSampleRateHertz() + != other.getSampleRateHertz()) return false; + if (getAudioChannelCount() + != other.getAudioChannelCount()) return false; + if (getEnableSeparateRecognitionPerChannel() + != other.getEnableSeparateRecognitionPerChannel()) return false; + if (!getLanguageCode() + .equals(other.getLanguageCode())) return false; + if (!getAlternativeLanguageCodesList() + .equals(other.getAlternativeLanguageCodesList())) return false; + if (getMaxAlternatives() + != other.getMaxAlternatives()) return false; + if (getProfanityFilter() + != other.getProfanityFilter()) return false; + if (hasAdaptation() != other.hasAdaptation()) return false; + if (hasAdaptation()) { + if (!getAdaptation() + .equals(other.getAdaptation())) return false; + } + if (hasTranscriptNormalization() != other.hasTranscriptNormalization()) return false; + if (hasTranscriptNormalization()) { + if (!getTranscriptNormalization() + .equals(other.getTranscriptNormalization())) return false; + } + if (!getSpeechContextsList() + .equals(other.getSpeechContextsList())) return false; + if (getEnableWordTimeOffsets() + != other.getEnableWordTimeOffsets()) return false; + if (getEnableWordConfidence() + != other.getEnableWordConfidence()) return false; + if (getEnableAutomaticPunctuation() + != other.getEnableAutomaticPunctuation()) return false; + if (hasEnableSpokenPunctuation() != other.hasEnableSpokenPunctuation()) return false; + if (hasEnableSpokenPunctuation()) { + if (!getEnableSpokenPunctuation() + .equals(other.getEnableSpokenPunctuation())) return false; + } + if (hasEnableSpokenEmojis() != other.hasEnableSpokenEmojis()) return false; + if (hasEnableSpokenEmojis()) { + if (!getEnableSpokenEmojis() + .equals(other.getEnableSpokenEmojis())) return false; + } + if (getEnableSpeakerDiarization() + != other.getEnableSpeakerDiarization()) return false; + if (getDiarizationSpeakerCount() + != other.getDiarizationSpeakerCount()) return false; + if (hasDiarizationConfig() != other.hasDiarizationConfig()) return false; + if (hasDiarizationConfig()) { + if (!getDiarizationConfig() + .equals(other.getDiarizationConfig())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata() + .equals(other.getMetadata())) return false; + } + if (!getModel() + .equals(other.getModel())) return false; + if (getUseEnhanced() + != other.getUseEnhanced()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENCODING_FIELD_NUMBER; + hash = (53 * hash) + encoding_; + hash = (37 * hash) + SAMPLE_RATE_HERTZ_FIELD_NUMBER; + hash = (53 * hash) + getSampleRateHertz(); + hash = (37 * hash) + AUDIO_CHANNEL_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getAudioChannelCount(); + hash = (37 * hash) + ENABLE_SEPARATE_RECOGNITION_PER_CHANNEL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableSeparateRecognitionPerChannel()); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + if (getAlternativeLanguageCodesCount() > 0) { + hash = (37 * hash) + ALTERNATIVE_LANGUAGE_CODES_FIELD_NUMBER; + hash = (53 * hash) + getAlternativeLanguageCodesList().hashCode(); + } + hash = (37 * hash) + MAX_ALTERNATIVES_FIELD_NUMBER; + hash = (53 * hash) + getMaxAlternatives(); + hash = (37 * hash) + PROFANITY_FILTER_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getProfanityFilter()); + if (hasAdaptation()) { + hash = (37 * hash) + ADAPTATION_FIELD_NUMBER; + hash = (53 * hash) + getAdaptation().hashCode(); + } + if (hasTranscriptNormalization()) { + hash = (37 * hash) + TRANSCRIPT_NORMALIZATION_FIELD_NUMBER; + hash = (53 * hash) + getTranscriptNormalization().hashCode(); + } + if (getSpeechContextsCount() > 0) { + hash = (37 * hash) + SPEECH_CONTEXTS_FIELD_NUMBER; + hash = (53 * hash) + getSpeechContextsList().hashCode(); + } + hash = (37 * hash) + ENABLE_WORD_TIME_OFFSETS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableWordTimeOffsets()); + hash = (37 * hash) + ENABLE_WORD_CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableWordConfidence()); + hash = (37 * hash) + ENABLE_AUTOMATIC_PUNCTUATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableAutomaticPunctuation()); + if (hasEnableSpokenPunctuation()) { + hash = (37 * hash) + ENABLE_SPOKEN_PUNCTUATION_FIELD_NUMBER; + hash = (53 * hash) + getEnableSpokenPunctuation().hashCode(); + } + if (hasEnableSpokenEmojis()) { + hash = (37 * hash) + ENABLE_SPOKEN_EMOJIS_FIELD_NUMBER; + hash = (53 * hash) + getEnableSpokenEmojis().hashCode(); + } + hash = (37 * hash) + ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableSpeakerDiarization()); + hash = (37 * hash) + DIARIZATION_SPEAKER_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getDiarizationSpeakerCount(); + if (hasDiarizationConfig()) { + hash = (37 * hash) + DIARIZATION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getDiarizationConfig().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (37 * hash) + USE_ENHANCED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getUseEnhanced()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.RecognitionConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognitionConfig) + com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.RecognitionConfig.class, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.RecognitionConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSpeechContextsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + encoding_ = 0; + + sampleRateHertz_ = 0; + + audioChannelCount_ = 0; + + enableSeparateRecognitionPerChannel_ = false; + + languageCode_ = ""; + + alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + maxAlternatives_ = 0; + + profanityFilter_ = false; + + if (adaptationBuilder_ == null) { + adaptation_ = null; + } else { + adaptation_ = null; + adaptationBuilder_ = null; + } + if (transcriptNormalizationBuilder_ == null) { + transcriptNormalization_ = null; + } else { + transcriptNormalization_ = null; + transcriptNormalizationBuilder_ = null; + } + if (speechContextsBuilder_ == null) { + speechContexts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + speechContextsBuilder_.clear(); + } + enableWordTimeOffsets_ = false; + + enableWordConfidence_ = false; + + enableAutomaticPunctuation_ = false; + + if (enableSpokenPunctuationBuilder_ == null) { + enableSpokenPunctuation_ = null; + } else { + enableSpokenPunctuation_ = null; + enableSpokenPunctuationBuilder_ = null; + } + if (enableSpokenEmojisBuilder_ == null) { + enableSpokenEmojis_ = null; + } else { + enableSpokenEmojis_ = null; + enableSpokenEmojisBuilder_ = null; + } + enableSpeakerDiarization_ = false; + + diarizationSpeakerCount_ = 0; + + if (diarizationConfigBuilder_ == null) { + diarizationConfig_ = null; + } else { + diarizationConfig_ = null; + diarizationConfigBuilder_ = null; + } + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + model_ = ""; + + useEnhanced_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionConfig getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionConfig build() { + com.google.cloud.speech.v1p1beta1.RecognitionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionConfig buildPartial() { + com.google.cloud.speech.v1p1beta1.RecognitionConfig result = new com.google.cloud.speech.v1p1beta1.RecognitionConfig(this); + int from_bitField0_ = bitField0_; + result.encoding_ = encoding_; + result.sampleRateHertz_ = sampleRateHertz_; + result.audioChannelCount_ = audioChannelCount_; + result.enableSeparateRecognitionPerChannel_ = enableSeparateRecognitionPerChannel_; + result.languageCode_ = languageCode_; + if (((bitField0_ & 0x00000001) != 0)) { + alternativeLanguageCodes_ = alternativeLanguageCodes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.alternativeLanguageCodes_ = alternativeLanguageCodes_; + result.maxAlternatives_ = maxAlternatives_; + result.profanityFilter_ = profanityFilter_; + if (adaptationBuilder_ == null) { + result.adaptation_ = adaptation_; + } else { + result.adaptation_ = adaptationBuilder_.build(); + } + if (transcriptNormalizationBuilder_ == null) { + result.transcriptNormalization_ = transcriptNormalization_; + } else { + result.transcriptNormalization_ = transcriptNormalizationBuilder_.build(); + } + if (speechContextsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.speechContexts_ = speechContexts_; + } else { + result.speechContexts_ = speechContextsBuilder_.build(); + } + result.enableWordTimeOffsets_ = enableWordTimeOffsets_; + result.enableWordConfidence_ = enableWordConfidence_; + result.enableAutomaticPunctuation_ = enableAutomaticPunctuation_; + if (enableSpokenPunctuationBuilder_ == null) { + result.enableSpokenPunctuation_ = enableSpokenPunctuation_; + } else { + result.enableSpokenPunctuation_ = enableSpokenPunctuationBuilder_.build(); + } + if (enableSpokenEmojisBuilder_ == null) { + result.enableSpokenEmojis_ = enableSpokenEmojis_; + } else { + result.enableSpokenEmojis_ = enableSpokenEmojisBuilder_.build(); + } + result.enableSpeakerDiarization_ = enableSpeakerDiarization_; + result.diarizationSpeakerCount_ = diarizationSpeakerCount_; + if (diarizationConfigBuilder_ == null) { + result.diarizationConfig_ = diarizationConfig_; + } else { + result.diarizationConfig_ = diarizationConfigBuilder_.build(); + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + result.model_ = model_; + result.useEnhanced_ = useEnhanced_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.RecognitionConfig) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognitionConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognitionConfig other) { + if (other == com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance()) return this; + if (other.encoding_ != 0) { + setEncodingValue(other.getEncodingValue()); + } + if (other.getSampleRateHertz() != 0) { + setSampleRateHertz(other.getSampleRateHertz()); + } + if (other.getAudioChannelCount() != 0) { + setAudioChannelCount(other.getAudioChannelCount()); + } + if (other.getEnableSeparateRecognitionPerChannel() != false) { + setEnableSeparateRecognitionPerChannel(other.getEnableSeparateRecognitionPerChannel()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + if (!other.alternativeLanguageCodes_.isEmpty()) { + if (alternativeLanguageCodes_.isEmpty()) { + alternativeLanguageCodes_ = other.alternativeLanguageCodes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAlternativeLanguageCodesIsMutable(); + alternativeLanguageCodes_.addAll(other.alternativeLanguageCodes_); + } + onChanged(); + } + if (other.getMaxAlternatives() != 0) { + setMaxAlternatives(other.getMaxAlternatives()); + } + if (other.getProfanityFilter() != false) { + setProfanityFilter(other.getProfanityFilter()); + } + if (other.hasAdaptation()) { + mergeAdaptation(other.getAdaptation()); + } + if (other.hasTranscriptNormalization()) { + mergeTranscriptNormalization(other.getTranscriptNormalization()); + } + if (speechContextsBuilder_ == null) { + if (!other.speechContexts_.isEmpty()) { + if (speechContexts_.isEmpty()) { + speechContexts_ = other.speechContexts_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSpeechContextsIsMutable(); + speechContexts_.addAll(other.speechContexts_); + } + onChanged(); + } + } else { + if (!other.speechContexts_.isEmpty()) { + if (speechContextsBuilder_.isEmpty()) { + speechContextsBuilder_.dispose(); + speechContextsBuilder_ = null; + speechContexts_ = other.speechContexts_; + bitField0_ = (bitField0_ & ~0x00000002); + speechContextsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSpeechContextsFieldBuilder() : null; + } else { + speechContextsBuilder_.addAllMessages(other.speechContexts_); + } + } + } + if (other.getEnableWordTimeOffsets() != false) { + setEnableWordTimeOffsets(other.getEnableWordTimeOffsets()); + } + if (other.getEnableWordConfidence() != false) { + setEnableWordConfidence(other.getEnableWordConfidence()); + } + if (other.getEnableAutomaticPunctuation() != false) { + setEnableAutomaticPunctuation(other.getEnableAutomaticPunctuation()); + } + if (other.hasEnableSpokenPunctuation()) { + mergeEnableSpokenPunctuation(other.getEnableSpokenPunctuation()); + } + if (other.hasEnableSpokenEmojis()) { + mergeEnableSpokenEmojis(other.getEnableSpokenEmojis()); + } + if (other.getEnableSpeakerDiarization() != false) { + setEnableSpeakerDiarization(other.getEnableSpeakerDiarization()); + } + if (other.getDiarizationSpeakerCount() != 0) { + setDiarizationSpeakerCount(other.getDiarizationSpeakerCount()); + } + if (other.hasDiarizationConfig()) { + mergeDiarizationConfig(other.getDiarizationConfig()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + onChanged(); + } + if (other.getUseEnhanced() != false) { + setUseEnhanced(other.getUseEnhanced()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.RecognitionConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.RecognitionConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int encoding_ = 0; + /** + *
+     * Encoding of audio data sent in all `RecognitionAudio` messages.
+     * This field is optional for `FLAC` and `WAV` audio files and required
+     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; + * @return The enum numeric value on the wire for encoding. + */ + @java.lang.Override public int getEncodingValue() { + return encoding_; + } + /** + *
+     * Encoding of audio data sent in all `RecognitionAudio` messages.
+     * This field is optional for `FLAC` and `WAV` audio files and required
+     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; + * @param value The enum numeric value on the wire for encoding to set. + * @return This builder for chaining. + */ + public Builder setEncodingValue(int value) { + + encoding_ = value; + onChanged(); + return this; + } + /** + *
+     * Encoding of audio data sent in all `RecognitionAudio` messages.
+     * This field is optional for `FLAC` and `WAV` audio files and required
+     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; + * @return The encoding. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding getEncoding() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding result = com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.valueOf(encoding_); + return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.UNRECOGNIZED : result; + } + /** + *
+     * Encoding of audio data sent in all `RecognitionAudio` messages.
+     * This field is optional for `FLAC` and `WAV` audio files and required
+     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; + * @param value The encoding to set. + * @return This builder for chaining. + */ + public Builder setEncoding(com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding value) { + if (value == null) { + throw new NullPointerException(); + } + + encoding_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Encoding of audio data sent in all `RecognitionAudio` messages.
+     * This field is optional for `FLAC` and `WAV` audio files and required
+     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; + * @return This builder for chaining. + */ + public Builder clearEncoding() { + + encoding_ = 0; + onChanged(); + return this; + } + + private int sampleRateHertz_ ; + /** + *
+     * Sample rate in Hertz of the audio data sent in all
+     * `RecognitionAudio` messages. Valid values are: 8000-48000.
+     * 16000 is optimal. For best results, set the sampling rate of the audio
+     * source to 16000 Hz. If that's not possible, use the native sample rate of
+     * the audio source (instead of re-sampling).
+     * This field is optional for FLAC and WAV audio files, but is
+     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * int32 sample_rate_hertz = 2; + * @return The sampleRateHertz. + */ + @java.lang.Override + public int getSampleRateHertz() { + return sampleRateHertz_; + } + /** + *
+     * Sample rate in Hertz of the audio data sent in all
+     * `RecognitionAudio` messages. Valid values are: 8000-48000.
+     * 16000 is optimal. For best results, set the sampling rate of the audio
+     * source to 16000 Hz. If that's not possible, use the native sample rate of
+     * the audio source (instead of re-sampling).
+     * This field is optional for FLAC and WAV audio files, but is
+     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * int32 sample_rate_hertz = 2; + * @param value The sampleRateHertz to set. + * @return This builder for chaining. + */ + public Builder setSampleRateHertz(int value) { + + sampleRateHertz_ = value; + onChanged(); + return this; + } + /** + *
+     * Sample rate in Hertz of the audio data sent in all
+     * `RecognitionAudio` messages. Valid values are: 8000-48000.
+     * 16000 is optimal. For best results, set the sampling rate of the audio
+     * source to 16000 Hz. If that's not possible, use the native sample rate of
+     * the audio source (instead of re-sampling).
+     * This field is optional for FLAC and WAV audio files, but is
+     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+     * 
+ * + * int32 sample_rate_hertz = 2; + * @return This builder for chaining. + */ + public Builder clearSampleRateHertz() { + + sampleRateHertz_ = 0; + onChanged(); + return this; + } + + private int audioChannelCount_ ; + /** + *
+     * The number of channels in the input audio data.
+     * ONLY set this for MULTI-CHANNEL recognition.
+     * Valid values for LINEAR16 and FLAC are `1`-`8`.
+     * Valid values for OGG_OPUS are '1'-'254'.
+     * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
+     * If `0` or omitted, defaults to one channel (mono).
+     * Note: We only recognize the first channel by default.
+     * To perform independent recognition on each channel set
+     * `enable_separate_recognition_per_channel` to 'true'.
+     * 
+ * + * int32 audio_channel_count = 7; + * @return The audioChannelCount. + */ + @java.lang.Override + public int getAudioChannelCount() { + return audioChannelCount_; + } + /** + *
+     * The number of channels in the input audio data.
+     * ONLY set this for MULTI-CHANNEL recognition.
+     * Valid values for LINEAR16 and FLAC are `1`-`8`.
+     * Valid values for OGG_OPUS are '1'-'254'.
+     * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
+     * If `0` or omitted, defaults to one channel (mono).
+     * Note: We only recognize the first channel by default.
+     * To perform independent recognition on each channel set
+     * `enable_separate_recognition_per_channel` to 'true'.
+     * 
+ * + * int32 audio_channel_count = 7; + * @param value The audioChannelCount to set. + * @return This builder for chaining. + */ + public Builder setAudioChannelCount(int value) { + + audioChannelCount_ = value; + onChanged(); + return this; + } + /** + *
+     * The number of channels in the input audio data.
+     * ONLY set this for MULTI-CHANNEL recognition.
+     * Valid values for LINEAR16 and FLAC are `1`-`8`.
+     * Valid values for OGG_OPUS are '1'-'254'.
+     * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
+     * If `0` or omitted, defaults to one channel (mono).
+     * Note: We only recognize the first channel by default.
+     * To perform independent recognition on each channel set
+     * `enable_separate_recognition_per_channel` to 'true'.
+     * 
+ * + * int32 audio_channel_count = 7; + * @return This builder for chaining. + */ + public Builder clearAudioChannelCount() { + + audioChannelCount_ = 0; + onChanged(); + return this; + } + + private boolean enableSeparateRecognitionPerChannel_ ; + /** + *
+     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
+     * to get each channel recognized separately. The recognition result will
+     * contain a `channel_tag` field to state which channel that result belongs
+     * to. If this is not true, we will only recognize the first channel. The
+     * request is billed cumulatively for all channels recognized:
+     * `audio_channel_count` multiplied by the length of the audio.
+     * 
+ * + * bool enable_separate_recognition_per_channel = 12; + * @return The enableSeparateRecognitionPerChannel. + */ + @java.lang.Override + public boolean getEnableSeparateRecognitionPerChannel() { + return enableSeparateRecognitionPerChannel_; + } + /** + *
+     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
+     * to get each channel recognized separately. The recognition result will
+     * contain a `channel_tag` field to state which channel that result belongs
+     * to. If this is not true, we will only recognize the first channel. The
+     * request is billed cumulatively for all channels recognized:
+     * `audio_channel_count` multiplied by the length of the audio.
+     * 
+ * + * bool enable_separate_recognition_per_channel = 12; + * @param value The enableSeparateRecognitionPerChannel to set. + * @return This builder for chaining. + */ + public Builder setEnableSeparateRecognitionPerChannel(boolean value) { + + enableSeparateRecognitionPerChannel_ = value; + onChanged(); + return this; + } + /** + *
+     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
+     * to get each channel recognized separately. The recognition result will
+     * contain a `channel_tag` field to state which channel that result belongs
+     * to. If this is not true, we will only recognize the first channel. The
+     * request is billed cumulatively for all channels recognized:
+     * `audio_channel_count` multiplied by the length of the audio.
+     * 
+ * + * bool enable_separate_recognition_per_channel = 12; + * @return This builder for chaining. + */ + public Builder clearEnableSeparateRecognitionPerChannel() { + + enableSeparateRecognitionPerChannel_ = false; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + *
+     * Required. The language of the supplied audio as a
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+     * Example: "en-US".
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes.
+     * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The language of the supplied audio as a
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+     * Example: "en-US".
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes.
+     * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The language of the supplied audio as a
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+     * Example: "en-US".
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes.
+     * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The language of the supplied audio as a
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+     * Example: "en-US".
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes.
+     * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + *
+     * Required. The language of the supplied audio as a
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+     * Example: "en-US".
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes.
+     * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureAlternativeLanguageCodesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + alternativeLanguageCodes_ = new com.google.protobuf.LazyStringArrayList(alternativeLanguageCodes_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @return A list containing the alternativeLanguageCodes. + */ + public com.google.protobuf.ProtocolStringList + getAlternativeLanguageCodesList() { + return alternativeLanguageCodes_.getUnmodifiableView(); + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @return The count of alternativeLanguageCodes. + */ + public int getAlternativeLanguageCodesCount() { + return alternativeLanguageCodes_.size(); + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index of the element to return. + * @return The alternativeLanguageCodes at the given index. + */ + public java.lang.String getAlternativeLanguageCodes(int index) { + return alternativeLanguageCodes_.get(index); + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index of the value to return. + * @return The bytes of the alternativeLanguageCodes at the given index. + */ + public com.google.protobuf.ByteString + getAlternativeLanguageCodesBytes(int index) { + return alternativeLanguageCodes_.getByteString(index); + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index to set the value at. + * @param value The alternativeLanguageCodes to set. + * @return This builder for chaining. + */ + public Builder setAlternativeLanguageCodes( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativeLanguageCodesIsMutable(); + alternativeLanguageCodes_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @param value The alternativeLanguageCodes to add. + * @return This builder for chaining. + */ + public Builder addAlternativeLanguageCodes( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativeLanguageCodesIsMutable(); + alternativeLanguageCodes_.add(value); + onChanged(); + return this; + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @param values The alternativeLanguageCodes to add. + * @return This builder for chaining. + */ + public Builder addAllAlternativeLanguageCodes( + java.lang.Iterable values) { + ensureAlternativeLanguageCodesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, alternativeLanguageCodes_); + onChanged(); + return this; + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @return This builder for chaining. + */ + public Builder clearAlternativeLanguageCodes() { + alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * A list of up to 3 additional
+     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+     * listing possible alternative languages of the supplied audio.
+     * See [Language
+     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+     * of the currently supported language codes. If alternative languages are
+     * listed, recognition result will contain recognition in the most likely
+     * language detected including the main language_code. The recognition result
+     * will include the language tag of the language detected in the audio. Note:
+     * This feature is only supported for Voice Command and Voice Search use cases
+     * and performance may vary for other use cases (e.g., phone call
+     * transcription).
+     * 
+ * + * repeated string alternative_language_codes = 18; + * @param value The bytes of the alternativeLanguageCodes to add. + * @return This builder for chaining. + */ + public Builder addAlternativeLanguageCodesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAlternativeLanguageCodesIsMutable(); + alternativeLanguageCodes_.add(value); + onChanged(); + return this; + } + + private int maxAlternatives_ ; + /** + *
+     * Maximum number of recognition hypotheses to be returned.
+     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
+     * within each `SpeechRecognitionResult`.
+     * The server may return fewer than `max_alternatives`.
+     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
+     * one. If omitted, will return a maximum of one.
+     * 
+ * + * int32 max_alternatives = 4; + * @return The maxAlternatives. + */ + @java.lang.Override + public int getMaxAlternatives() { + return maxAlternatives_; + } + /** + *
+     * Maximum number of recognition hypotheses to be returned.
+     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
+     * within each `SpeechRecognitionResult`.
+     * The server may return fewer than `max_alternatives`.
+     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
+     * one. If omitted, will return a maximum of one.
+     * 
+ * + * int32 max_alternatives = 4; + * @param value The maxAlternatives to set. + * @return This builder for chaining. + */ + public Builder setMaxAlternatives(int value) { + + maxAlternatives_ = value; + onChanged(); + return this; + } + /** + *
+     * Maximum number of recognition hypotheses to be returned.
+     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
+     * within each `SpeechRecognitionResult`.
+     * The server may return fewer than `max_alternatives`.
+     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
+     * one. If omitted, will return a maximum of one.
+     * 
+ * + * int32 max_alternatives = 4; + * @return This builder for chaining. + */ + public Builder clearMaxAlternatives() { + + maxAlternatives_ = 0; + onChanged(); + return this; + } + + private boolean profanityFilter_ ; + /** + *
+     * If set to `true`, the server will attempt to filter out
+     * profanities, replacing all but the initial character in each filtered word
+     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
+     * won't be filtered out.
+     * 
+ * + * bool profanity_filter = 5; + * @return The profanityFilter. + */ + @java.lang.Override + public boolean getProfanityFilter() { + return profanityFilter_; + } + /** + *
+     * If set to `true`, the server will attempt to filter out
+     * profanities, replacing all but the initial character in each filtered word
+     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
+     * won't be filtered out.
+     * 
+ * + * bool profanity_filter = 5; + * @param value The profanityFilter to set. + * @return This builder for chaining. + */ + public Builder setProfanityFilter(boolean value) { + + profanityFilter_ = value; + onChanged(); + return this; + } + /** + *
+     * If set to `true`, the server will attempt to filter out
+     * profanities, replacing all but the initial character in each filtered word
+     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
+     * won't be filtered out.
+     * 
+ * + * bool profanity_filter = 5; + * @return This builder for chaining. + */ + public Builder clearProfanityFilter() { + + profanityFilter_ = false; + onChanged(); + return this; + } + + private com.google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechAdaptation, com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder, com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder> adaptationBuilder_; + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + * @return Whether the adaptation field is set. + */ + public boolean hasAdaptation() { + return adaptationBuilder_ != null || adaptation_ != null; + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + * @return The adaptation. + */ + public com.google.cloud.speech.v1p1beta1.SpeechAdaptation getAdaptation() { + if (adaptationBuilder_ == null) { + return adaptation_ == null ? com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance() : adaptation_; + } else { + return adaptationBuilder_.getMessage(); + } + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + */ + public Builder setAdaptation(com.google.cloud.speech.v1p1beta1.SpeechAdaptation value) { + if (adaptationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + adaptation_ = value; + onChanged(); + } else { + adaptationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + */ + public Builder setAdaptation( + com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder builderForValue) { + if (adaptationBuilder_ == null) { + adaptation_ = builderForValue.build(); + onChanged(); + } else { + adaptationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + */ + public Builder mergeAdaptation(com.google.cloud.speech.v1p1beta1.SpeechAdaptation value) { + if (adaptationBuilder_ == null) { + if (adaptation_ != null) { + adaptation_ = + com.google.cloud.speech.v1p1beta1.SpeechAdaptation.newBuilder(adaptation_).mergeFrom(value).buildPartial(); + } else { + adaptation_ = value; + } + onChanged(); + } else { + adaptationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + */ + public Builder clearAdaptation() { + if (adaptationBuilder_ == null) { + adaptation_ = null; + onChanged(); + } else { + adaptation_ = null; + adaptationBuilder_ = null; + } + + return this; + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + */ + public com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder getAdaptationBuilder() { + + onChanged(); + return getAdaptationFieldBuilder().getBuilder(); + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + */ + public com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder getAdaptationOrBuilder() { + if (adaptationBuilder_ != null) { + return adaptationBuilder_.getMessageOrBuilder(); + } else { + return adaptation_ == null ? + com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance() : adaptation_; + } + } + /** + *
+     * Speech adaptation configuration improves the accuracy of speech
+     * recognition. For more information, see the [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+     * documentation.
+     * When speech adaptation is set it supersedes the `speech_contexts` field.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechAdaptation, com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder, com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder> + getAdaptationFieldBuilder() { + if (adaptationBuilder_ == null) { + adaptationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechAdaptation, com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder, com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder>( + getAdaptation(), + getParentForChildren(), + isClean()); + adaptation_ = null; + } + return adaptationBuilder_; + } + + private com.google.cloud.speech.v1p1beta1.TranscriptNormalization transcriptNormalization_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptNormalization, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder, com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder> transcriptNormalizationBuilder_; + /** + *
+     * Use transcription normalization to automatically replace parts of the
+     * transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + * @return Whether the transcriptNormalization field is set. + */ + public boolean hasTranscriptNormalization() { + return transcriptNormalizationBuilder_ != null || transcriptNormalization_ != null; + } + /** + *
+     * Use transcription normalization to automatically replace parts of the
+     * transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + * @return The transcriptNormalization. + */ + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization getTranscriptNormalization() { + if (transcriptNormalizationBuilder_ == null) { + return transcriptNormalization_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptNormalization.getDefaultInstance() : transcriptNormalization_; + } else { + return transcriptNormalizationBuilder_.getMessage(); + } + } + /** + *
+     * Use transcription normalization to automatically replace parts of the
+     * transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + */ + public Builder setTranscriptNormalization(com.google.cloud.speech.v1p1beta1.TranscriptNormalization value) { + if (transcriptNormalizationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + transcriptNormalization_ = value; + onChanged(); + } else { + transcriptNormalizationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Use transcription normalization to automatically replace parts of the
+     * transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + */ + public Builder setTranscriptNormalization( + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder builderForValue) { + if (transcriptNormalizationBuilder_ == null) { + transcriptNormalization_ = builderForValue.build(); + onChanged(); + } else { + transcriptNormalizationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Use transcription normalization to automatically replace parts of the
+     * transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + */ + public Builder mergeTranscriptNormalization(com.google.cloud.speech.v1p1beta1.TranscriptNormalization value) { + if (transcriptNormalizationBuilder_ == null) { + if (transcriptNormalization_ != null) { + transcriptNormalization_ = + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.newBuilder(transcriptNormalization_).mergeFrom(value).buildPartial(); + } else { + transcriptNormalization_ = value; + } + onChanged(); + } else { + transcriptNormalizationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Use transcription normalization to automatically replace parts of the
+     * transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + */ + public Builder clearTranscriptNormalization() { + if (transcriptNormalizationBuilder_ == null) { + transcriptNormalization_ = null; + onChanged(); + } else { + transcriptNormalization_ = null; + transcriptNormalizationBuilder_ = null; + } + + return this; + } + /** + *
+     * Use transcription normalization to automatically replace parts of the
+     * transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder getTranscriptNormalizationBuilder() { + + onChanged(); + return getTranscriptNormalizationFieldBuilder().getBuilder(); + } + /** + *
+     * Use transcription normalization to automatically replace parts of the
+     * transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder getTranscriptNormalizationOrBuilder() { + if (transcriptNormalizationBuilder_ != null) { + return transcriptNormalizationBuilder_.getMessageOrBuilder(); + } else { + return transcriptNormalization_ == null ? + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.getDefaultInstance() : transcriptNormalization_; + } + } + /** + *
+     * Use transcription normalization to automatically replace parts of the
+     * transcript with phrases of your choosing. For StreamingRecognize, this
+     * normalization only applies to stable partial transcripts (stability > 0.8)
+     * and final transcripts.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptNormalization, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder, com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder> + getTranscriptNormalizationFieldBuilder() { + if (transcriptNormalizationBuilder_ == null) { + transcriptNormalizationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptNormalization, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder, com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder>( + getTranscriptNormalization(), + getParentForChildren(), + isClean()); + transcriptNormalization_ = null; + } + return transcriptNormalizationBuilder_; + } + + private java.util.List speechContexts_ = + java.util.Collections.emptyList(); + private void ensureSpeechContextsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + speechContexts_ = new java.util.ArrayList(speechContexts_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechContext, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder, com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder> speechContextsBuilder_; + + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public java.util.List getSpeechContextsList() { + if (speechContextsBuilder_ == null) { + return java.util.Collections.unmodifiableList(speechContexts_); + } else { + return speechContextsBuilder_.getMessageList(); + } + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public int getSpeechContextsCount() { + if (speechContextsBuilder_ == null) { + return speechContexts_.size(); + } else { + return speechContextsBuilder_.getCount(); + } + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public com.google.cloud.speech.v1p1beta1.SpeechContext getSpeechContexts(int index) { + if (speechContextsBuilder_ == null) { + return speechContexts_.get(index); + } else { + return speechContextsBuilder_.getMessage(index); + } + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public Builder setSpeechContexts( + int index, com.google.cloud.speech.v1p1beta1.SpeechContext value) { + if (speechContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeechContextsIsMutable(); + speechContexts_.set(index, value); + onChanged(); + } else { + speechContextsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public Builder setSpeechContexts( + int index, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder builderForValue) { + if (speechContextsBuilder_ == null) { + ensureSpeechContextsIsMutable(); + speechContexts_.set(index, builderForValue.build()); + onChanged(); + } else { + speechContextsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public Builder addSpeechContexts(com.google.cloud.speech.v1p1beta1.SpeechContext value) { + if (speechContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeechContextsIsMutable(); + speechContexts_.add(value); + onChanged(); + } else { + speechContextsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public Builder addSpeechContexts( + int index, com.google.cloud.speech.v1p1beta1.SpeechContext value) { + if (speechContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSpeechContextsIsMutable(); + speechContexts_.add(index, value); + onChanged(); + } else { + speechContextsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public Builder addSpeechContexts( + com.google.cloud.speech.v1p1beta1.SpeechContext.Builder builderForValue) { + if (speechContextsBuilder_ == null) { + ensureSpeechContextsIsMutable(); + speechContexts_.add(builderForValue.build()); + onChanged(); + } else { + speechContextsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public Builder addSpeechContexts( + int index, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder builderForValue) { + if (speechContextsBuilder_ == null) { + ensureSpeechContextsIsMutable(); + speechContexts_.add(index, builderForValue.build()); + onChanged(); + } else { + speechContextsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public Builder addAllSpeechContexts( + java.lang.Iterable values) { + if (speechContextsBuilder_ == null) { + ensureSpeechContextsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, speechContexts_); + onChanged(); + } else { + speechContextsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public Builder clearSpeechContexts() { + if (speechContextsBuilder_ == null) { + speechContexts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + speechContextsBuilder_.clear(); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public Builder removeSpeechContexts(int index) { + if (speechContextsBuilder_ == null) { + ensureSpeechContextsIsMutable(); + speechContexts_.remove(index); + onChanged(); + } else { + speechContextsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public com.google.cloud.speech.v1p1beta1.SpeechContext.Builder getSpeechContextsBuilder( + int index) { + return getSpeechContextsFieldBuilder().getBuilder(index); + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder getSpeechContextsOrBuilder( + int index) { + if (speechContextsBuilder_ == null) { + return speechContexts_.get(index); } else { + return speechContextsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public java.util.List + getSpeechContextsOrBuilderList() { + if (speechContextsBuilder_ != null) { + return speechContextsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(speechContexts_); + } + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public com.google.cloud.speech.v1p1beta1.SpeechContext.Builder addSpeechContextsBuilder() { + return getSpeechContextsFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.SpeechContext.getDefaultInstance()); + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public com.google.cloud.speech.v1p1beta1.SpeechContext.Builder addSpeechContextsBuilder( + int index) { + return getSpeechContextsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.SpeechContext.getDefaultInstance()); + } + /** + *
+     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+     * A means to provide context to assist the speech recognition. For more
+     * information, see
+     * [speech
+     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + public java.util.List + getSpeechContextsBuilderList() { + return getSpeechContextsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechContext, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder, com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder> + getSpeechContextsFieldBuilder() { + if (speechContextsBuilder_ == null) { + speechContextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechContext, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder, com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder>( + speechContexts_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + speechContexts_ = null; + } + return speechContextsBuilder_; + } + + private boolean enableWordTimeOffsets_ ; + /** + *
+     * If `true`, the top result includes a list of words and
+     * the start and end time offsets (timestamps) for those words. If
+     * `false`, no word-level time offset information is returned. The default is
+     * `false`.
+     * 
+ * + * bool enable_word_time_offsets = 8; + * @return The enableWordTimeOffsets. + */ + @java.lang.Override + public boolean getEnableWordTimeOffsets() { + return enableWordTimeOffsets_; + } + /** + *
+     * If `true`, the top result includes a list of words and
+     * the start and end time offsets (timestamps) for those words. If
+     * `false`, no word-level time offset information is returned. The default is
+     * `false`.
+     * 
+ * + * bool enable_word_time_offsets = 8; + * @param value The enableWordTimeOffsets to set. + * @return This builder for chaining. + */ + public Builder setEnableWordTimeOffsets(boolean value) { + + enableWordTimeOffsets_ = value; + onChanged(); + return this; + } + /** + *
+     * If `true`, the top result includes a list of words and
+     * the start and end time offsets (timestamps) for those words. If
+     * `false`, no word-level time offset information is returned. The default is
+     * `false`.
+     * 
+ * + * bool enable_word_time_offsets = 8; + * @return This builder for chaining. + */ + public Builder clearEnableWordTimeOffsets() { + + enableWordTimeOffsets_ = false; + onChanged(); + return this; + } + + private boolean enableWordConfidence_ ; + /** + *
+     * If `true`, the top result includes a list of words and the
+     * confidence for those words. If `false`, no word-level confidence
+     * information is returned. The default is `false`.
+     * 
+ * + * bool enable_word_confidence = 15; + * @return The enableWordConfidence. + */ + @java.lang.Override + public boolean getEnableWordConfidence() { + return enableWordConfidence_; + } + /** + *
+     * If `true`, the top result includes a list of words and the
+     * confidence for those words. If `false`, no word-level confidence
+     * information is returned. The default is `false`.
+     * 
+ * + * bool enable_word_confidence = 15; + * @param value The enableWordConfidence to set. + * @return This builder for chaining. + */ + public Builder setEnableWordConfidence(boolean value) { + + enableWordConfidence_ = value; + onChanged(); + return this; + } + /** + *
+     * If `true`, the top result includes a list of words and the
+     * confidence for those words. If `false`, no word-level confidence
+     * information is returned. The default is `false`.
+     * 
+ * + * bool enable_word_confidence = 15; + * @return This builder for chaining. + */ + public Builder clearEnableWordConfidence() { + + enableWordConfidence_ = false; + onChanged(); + return this; + } + + private boolean enableAutomaticPunctuation_ ; + /** + *
+     * If 'true', adds punctuation to recognition result hypotheses.
+     * This feature is only available in select languages. Setting this for
+     * requests in other languages has no effect at all.
+     * The default 'false' value does not add punctuation to result hypotheses.
+     * 
+ * + * bool enable_automatic_punctuation = 11; + * @return The enableAutomaticPunctuation. + */ + @java.lang.Override + public boolean getEnableAutomaticPunctuation() { + return enableAutomaticPunctuation_; + } + /** + *
+     * If 'true', adds punctuation to recognition result hypotheses.
+     * This feature is only available in select languages. Setting this for
+     * requests in other languages has no effect at all.
+     * The default 'false' value does not add punctuation to result hypotheses.
+     * 
+ * + * bool enable_automatic_punctuation = 11; + * @param value The enableAutomaticPunctuation to set. + * @return This builder for chaining. + */ + public Builder setEnableAutomaticPunctuation(boolean value) { + + enableAutomaticPunctuation_ = value; + onChanged(); + return this; + } + /** + *
+     * If 'true', adds punctuation to recognition result hypotheses.
+     * This feature is only available in select languages. Setting this for
+     * requests in other languages has no effect at all.
+     * The default 'false' value does not add punctuation to result hypotheses.
+     * 
+ * + * bool enable_automatic_punctuation = 11; + * @return This builder for chaining. + */ + public Builder clearEnableAutomaticPunctuation() { + + enableAutomaticPunctuation_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.BoolValue enableSpokenPunctuation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> enableSpokenPunctuationBuilder_; + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + * @return Whether the enableSpokenPunctuation field is set. + */ + public boolean hasEnableSpokenPunctuation() { + return enableSpokenPunctuationBuilder_ != null || enableSpokenPunctuation_ != null; + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + * @return The enableSpokenPunctuation. + */ + public com.google.protobuf.BoolValue getEnableSpokenPunctuation() { + if (enableSpokenPunctuationBuilder_ == null) { + return enableSpokenPunctuation_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenPunctuation_; + } else { + return enableSpokenPunctuationBuilder_.getMessage(); + } + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + public Builder setEnableSpokenPunctuation(com.google.protobuf.BoolValue value) { + if (enableSpokenPunctuationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enableSpokenPunctuation_ = value; + onChanged(); + } else { + enableSpokenPunctuationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + public Builder setEnableSpokenPunctuation( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (enableSpokenPunctuationBuilder_ == null) { + enableSpokenPunctuation_ = builderForValue.build(); + onChanged(); + } else { + enableSpokenPunctuationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + public Builder mergeEnableSpokenPunctuation(com.google.protobuf.BoolValue value) { + if (enableSpokenPunctuationBuilder_ == null) { + if (enableSpokenPunctuation_ != null) { + enableSpokenPunctuation_ = + com.google.protobuf.BoolValue.newBuilder(enableSpokenPunctuation_).mergeFrom(value).buildPartial(); + } else { + enableSpokenPunctuation_ = value; + } + onChanged(); + } else { + enableSpokenPunctuationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + public Builder clearEnableSpokenPunctuation() { + if (enableSpokenPunctuationBuilder_ == null) { + enableSpokenPunctuation_ = null; + onChanged(); + } else { + enableSpokenPunctuation_ = null; + enableSpokenPunctuationBuilder_ = null; + } + + return this; + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + public com.google.protobuf.BoolValue.Builder getEnableSpokenPunctuationBuilder() { + + onChanged(); + return getEnableSpokenPunctuationFieldBuilder().getBuilder(); + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + public com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilder() { + if (enableSpokenPunctuationBuilder_ != null) { + return enableSpokenPunctuationBuilder_.getMessageOrBuilder(); + } else { + return enableSpokenPunctuation_ == null ? + com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenPunctuation_; + } + } + /** + *
+     * The spoken punctuation behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * e.g. command_and_search will enable spoken punctuation by default
+     * If 'true', replaces spoken punctuation with the corresponding symbols in
+     * the request. For example, "how are you question mark" becomes "how are
+     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+     * for support. If 'false', spoken punctuation is not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> + getEnableSpokenPunctuationFieldBuilder() { + if (enableSpokenPunctuationBuilder_ == null) { + enableSpokenPunctuationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder>( + getEnableSpokenPunctuation(), + getParentForChildren(), + isClean()); + enableSpokenPunctuation_ = null; + } + return enableSpokenPunctuationBuilder_; + } + + private com.google.protobuf.BoolValue enableSpokenEmojis_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> enableSpokenEmojisBuilder_; + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + * @return Whether the enableSpokenEmojis field is set. + */ + public boolean hasEnableSpokenEmojis() { + return enableSpokenEmojisBuilder_ != null || enableSpokenEmojis_ != null; + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + * @return The enableSpokenEmojis. + */ + public com.google.protobuf.BoolValue getEnableSpokenEmojis() { + if (enableSpokenEmojisBuilder_ == null) { + return enableSpokenEmojis_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenEmojis_; + } else { + return enableSpokenEmojisBuilder_.getMessage(); + } + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + public Builder setEnableSpokenEmojis(com.google.protobuf.BoolValue value) { + if (enableSpokenEmojisBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + enableSpokenEmojis_ = value; + onChanged(); + } else { + enableSpokenEmojisBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + public Builder setEnableSpokenEmojis( + com.google.protobuf.BoolValue.Builder builderForValue) { + if (enableSpokenEmojisBuilder_ == null) { + enableSpokenEmojis_ = builderForValue.build(); + onChanged(); + } else { + enableSpokenEmojisBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + public Builder mergeEnableSpokenEmojis(com.google.protobuf.BoolValue value) { + if (enableSpokenEmojisBuilder_ == null) { + if (enableSpokenEmojis_ != null) { + enableSpokenEmojis_ = + com.google.protobuf.BoolValue.newBuilder(enableSpokenEmojis_).mergeFrom(value).buildPartial(); + } else { + enableSpokenEmojis_ = value; + } + onChanged(); + } else { + enableSpokenEmojisBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + public Builder clearEnableSpokenEmojis() { + if (enableSpokenEmojisBuilder_ == null) { + enableSpokenEmojis_ = null; + onChanged(); + } else { + enableSpokenEmojis_ = null; + enableSpokenEmojisBuilder_ = null; + } + + return this; + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + public com.google.protobuf.BoolValue.Builder getEnableSpokenEmojisBuilder() { + + onChanged(); + return getEnableSpokenEmojisFieldBuilder().getBuilder(); + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + public com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder() { + if (enableSpokenEmojisBuilder_ != null) { + return enableSpokenEmojisBuilder_.getMessageOrBuilder(); + } else { + return enableSpokenEmojis_ == null ? + com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenEmojis_; + } + } + /** + *
+     * The spoken emoji behavior for the call
+     * If not set, uses default behavior based on model of choice
+     * If 'true', adds spoken emoji formatting for the request. This will replace
+     * spoken emojis with the corresponding Unicode symbols in the final
+     * transcript. If 'false', spoken emojis are not replaced.
+     * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> + getEnableSpokenEmojisFieldBuilder() { + if (enableSpokenEmojisBuilder_ == null) { + enableSpokenEmojisBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder>( + getEnableSpokenEmojis(), + getParentForChildren(), + isClean()); + enableSpokenEmojis_ = null; + } + return enableSpokenEmojisBuilder_; + } + + private boolean enableSpeakerDiarization_ ; + /** + *
+     * If 'true', enables speaker detection for each recognized word in
+     * the top alternative of the recognition result using a speaker_tag provided
+     * in the WordInfo.
+     * Note: Use diarization_config instead.
+     * 
+ * + * bool enable_speaker_diarization = 16 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378 + * @return The enableSpeakerDiarization. + */ + @java.lang.Override + @java.lang.Deprecated public boolean getEnableSpeakerDiarization() { + return enableSpeakerDiarization_; + } + /** + *
+     * If 'true', enables speaker detection for each recognized word in
+     * the top alternative of the recognition result using a speaker_tag provided
+     * in the WordInfo.
+     * Note: Use diarization_config instead.
+     * 
+ * + * bool enable_speaker_diarization = 16 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378 + * @param value The enableSpeakerDiarization to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setEnableSpeakerDiarization(boolean value) { + + enableSpeakerDiarization_ = value; + onChanged(); + return this; + } + /** + *
+     * If 'true', enables speaker detection for each recognized word in
+     * the top alternative of the recognition result using a speaker_tag provided
+     * in the WordInfo.
+     * Note: Use diarization_config instead.
+     * 
+ * + * bool enable_speaker_diarization = 16 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearEnableSpeakerDiarization() { + + enableSpeakerDiarization_ = false; + onChanged(); + return this; + } + + private int diarizationSpeakerCount_ ; + /** + *
+     * If set, specifies the estimated number of speakers in the conversation.
+     * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
+     * Note: Use diarization_config instead.
+     * 
+ * + * int32 diarization_speaker_count = 17 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383 + * @return The diarizationSpeakerCount. + */ + @java.lang.Override + @java.lang.Deprecated public int getDiarizationSpeakerCount() { + return diarizationSpeakerCount_; + } + /** + *
+     * If set, specifies the estimated number of speakers in the conversation.
+     * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
+     * Note: Use diarization_config instead.
+     * 
+ * + * int32 diarization_speaker_count = 17 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383 + * @param value The diarizationSpeakerCount to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setDiarizationSpeakerCount(int value) { + + diarizationSpeakerCount_ = value; + onChanged(); + return this; + } + /** + *
+     * If set, specifies the estimated number of speakers in the conversation.
+     * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
+     * Note: Use diarization_config instead.
+     * 
+ * + * int32 diarization_speaker_count = 17 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearDiarizationSpeakerCount() { + + diarizationSpeakerCount_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarizationConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder> diarizationConfigBuilder_; + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + * @return Whether the diarizationConfig field is set. + */ + public boolean hasDiarizationConfig() { + return diarizationConfigBuilder_ != null || diarizationConfig_ != null; + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + * @return The diarizationConfig. + */ + public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDiarizationConfig() { + if (diarizationConfigBuilder_ == null) { + return diarizationConfig_ == null ? com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance() : diarizationConfig_; + } else { + return diarizationConfigBuilder_.getMessage(); + } + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + */ + public Builder setDiarizationConfig(com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig value) { + if (diarizationConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + diarizationConfig_ = value; + onChanged(); + } else { + diarizationConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + */ + public Builder setDiarizationConfig( + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder builderForValue) { + if (diarizationConfigBuilder_ == null) { + diarizationConfig_ = builderForValue.build(); + onChanged(); + } else { + diarizationConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + */ + public Builder mergeDiarizationConfig(com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig value) { + if (diarizationConfigBuilder_ == null) { + if (diarizationConfig_ != null) { + diarizationConfig_ = + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.newBuilder(diarizationConfig_).mergeFrom(value).buildPartial(); + } else { + diarizationConfig_ = value; + } + onChanged(); + } else { + diarizationConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + */ + public Builder clearDiarizationConfig() { + if (diarizationConfigBuilder_ == null) { + diarizationConfig_ = null; + onChanged(); + } else { + diarizationConfig_ = null; + diarizationConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + */ + public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder getDiarizationConfigBuilder() { + + onChanged(); + return getDiarizationConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + */ + public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder() { + if (diarizationConfigBuilder_ != null) { + return diarizationConfigBuilder_.getMessageOrBuilder(); + } else { + return diarizationConfig_ == null ? + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance() : diarizationConfig_; + } + } + /** + *
+     * Config to enable speaker diarization and set additional
+     * parameters to make diarization better suited for your application.
+     * Note: When this is enabled, we send all the words from the beginning of the
+     * audio for the top alternative in every consecutive STREAMING responses.
+     * This is done in order to improve our speaker tags as our models learn to
+     * identify the speakers in the conversation over time.
+     * For non-streaming requests, the diarization results will be provided only
+     * in the top alternative of the FINAL SpeechRecognitionResult.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder> + getDiarizationConfigFieldBuilder() { + if (diarizationConfigBuilder_ == null) { + diarizationConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder>( + getDiarizationConfig(), + getParentForChildren(), + isClean()); + diarizationConfig_ = null; + } + return diarizationConfigBuilder_; + } + + private com.google.cloud.speech.v1p1beta1.RecognitionMetadata metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionMetadata, com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder, com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder> metadataBuilder_; + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + * @return The metadata. + */ + public com.google.cloud.speech.v1p1beta1.RecognitionMetadata getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + */ + public Builder setMetadata(com.google.cloud.speech.v1p1beta1.RecognitionMetadata value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + */ + public Builder setMetadata( + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + */ + public Builder mergeMetadata(com.google.cloud.speech.v1p1beta1.RecognitionMetadata value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.newBuilder(metadata_).mergeFrom(value).buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + */ + public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + */ + public com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance() : metadata_; + } + } + /** + *
+     * Metadata regarding this request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionMetadata, com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder, com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionMetadata, com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder, com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder>( + getMetadata(), + getParentForChildren(), + isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + private java.lang.Object model_ = ""; + /** + *
+     * Which model to select for the given request. Select the model
+     * best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the RecognitionConfig.
+     * <table>
+     *   <tr>
+     *     <td><b>Model</b></td>
+     *     <td><b>Description</b></td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_long</code></td>
+     *     <td>Best for long form content like media or conversation.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_short</code></td>
+     *     <td>Best for short form content like commands or single shot directed
+     *     speech.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>command_and_search</code></td>
+     *     <td>Best for short queries such as voice commands or voice search.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>phone_call</code></td>
+     *     <td>Best for audio that originated from a phone call (typically
+     *     recorded at an 8khz sampling rate).</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>video</code></td>
+     *     <td>Best for audio that originated from video or includes multiple
+     *         speakers. Ideally the audio is recorded at a 16khz or greater
+     *         sampling rate. This is a premium model that costs more than the
+     *         standard rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>default</code></td>
+     *     <td>Best for audio that is not one of the specific audio models.
+     *         For example, long-form audio. Ideally the audio is high-fidelity,
+     *         recorded at a 16khz or greater sampling rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_conversation</code></td>
+     *     <td>Best for audio that originated from a conversation between a
+     *         medical provider and patient.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_dictation</code></td>
+     *     <td>Best for audio that originated from dictation notes by a medical
+     *         provider.</td>
+     *   </tr>
+     * </table>
+     * 
+ * + * string model = 13; + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Which model to select for the given request. Select the model
+     * best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the RecognitionConfig.
+     * <table>
+     *   <tr>
+     *     <td><b>Model</b></td>
+     *     <td><b>Description</b></td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_long</code></td>
+     *     <td>Best for long form content like media or conversation.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_short</code></td>
+     *     <td>Best for short form content like commands or single shot directed
+     *     speech.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>command_and_search</code></td>
+     *     <td>Best for short queries such as voice commands or voice search.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>phone_call</code></td>
+     *     <td>Best for audio that originated from a phone call (typically
+     *     recorded at an 8khz sampling rate).</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>video</code></td>
+     *     <td>Best for audio that originated from video or includes multiple
+     *         speakers. Ideally the audio is recorded at a 16khz or greater
+     *         sampling rate. This is a premium model that costs more than the
+     *         standard rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>default</code></td>
+     *     <td>Best for audio that is not one of the specific audio models.
+     *         For example, long-form audio. Ideally the audio is high-fidelity,
+     *         recorded at a 16khz or greater sampling rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_conversation</code></td>
+     *     <td>Best for audio that originated from a conversation between a
+     *         medical provider and patient.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_dictation</code></td>
+     *     <td>Best for audio that originated from dictation notes by a medical
+     *         provider.</td>
+     *   </tr>
+     * </table>
+     * 
+ * + * string model = 13; + * @return The bytes for model. + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Which model to select for the given request. Select the model
+     * best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the RecognitionConfig.
+     * <table>
+     *   <tr>
+     *     <td><b>Model</b></td>
+     *     <td><b>Description</b></td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_long</code></td>
+     *     <td>Best for long form content like media or conversation.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_short</code></td>
+     *     <td>Best for short form content like commands or single shot directed
+     *     speech.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>command_and_search</code></td>
+     *     <td>Best for short queries such as voice commands or voice search.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>phone_call</code></td>
+     *     <td>Best for audio that originated from a phone call (typically
+     *     recorded at an 8khz sampling rate).</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>video</code></td>
+     *     <td>Best for audio that originated from video or includes multiple
+     *         speakers. Ideally the audio is recorded at a 16khz or greater
+     *         sampling rate. This is a premium model that costs more than the
+     *         standard rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>default</code></td>
+     *     <td>Best for audio that is not one of the specific audio models.
+     *         For example, long-form audio. Ideally the audio is high-fidelity,
+     *         recorded at a 16khz or greater sampling rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_conversation</code></td>
+     *     <td>Best for audio that originated from a conversation between a
+     *         medical provider and patient.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_dictation</code></td>
+     *     <td>Best for audio that originated from dictation notes by a medical
+     *         provider.</td>
+     *   </tr>
+     * </table>
+     * 
+ * + * string model = 13; + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + model_ = value; + onChanged(); + return this; + } + /** + *
+     * Which model to select for the given request. Select the model
+     * best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the RecognitionConfig.
+     * <table>
+     *   <tr>
+     *     <td><b>Model</b></td>
+     *     <td><b>Description</b></td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_long</code></td>
+     *     <td>Best for long form content like media or conversation.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_short</code></td>
+     *     <td>Best for short form content like commands or single shot directed
+     *     speech.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>command_and_search</code></td>
+     *     <td>Best for short queries such as voice commands or voice search.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>phone_call</code></td>
+     *     <td>Best for audio that originated from a phone call (typically
+     *     recorded at an 8khz sampling rate).</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>video</code></td>
+     *     <td>Best for audio that originated from video or includes multiple
+     *         speakers. Ideally the audio is recorded at a 16khz or greater
+     *         sampling rate. This is a premium model that costs more than the
+     *         standard rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>default</code></td>
+     *     <td>Best for audio that is not one of the specific audio models.
+     *         For example, long-form audio. Ideally the audio is high-fidelity,
+     *         recorded at a 16khz or greater sampling rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_conversation</code></td>
+     *     <td>Best for audio that originated from a conversation between a
+     *         medical provider and patient.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_dictation</code></td>
+     *     <td>Best for audio that originated from dictation notes by a medical
+     *         provider.</td>
+     *   </tr>
+     * </table>
+     * 
+ * + * string model = 13; + * @return This builder for chaining. + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + *
+     * Which model to select for the given request. Select the model
+     * best suited to your domain to get best results. If a model is not
+     * explicitly specified, then we auto-select a model based on the parameters
+     * in the RecognitionConfig.
+     * <table>
+     *   <tr>
+     *     <td><b>Model</b></td>
+     *     <td><b>Description</b></td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_long</code></td>
+     *     <td>Best for long form content like media or conversation.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>latest_short</code></td>
+     *     <td>Best for short form content like commands or single shot directed
+     *     speech.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>command_and_search</code></td>
+     *     <td>Best for short queries such as voice commands or voice search.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>phone_call</code></td>
+     *     <td>Best for audio that originated from a phone call (typically
+     *     recorded at an 8khz sampling rate).</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>video</code></td>
+     *     <td>Best for audio that originated from video or includes multiple
+     *         speakers. Ideally the audio is recorded at a 16khz or greater
+     *         sampling rate. This is a premium model that costs more than the
+     *         standard rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>default</code></td>
+     *     <td>Best for audio that is not one of the specific audio models.
+     *         For example, long-form audio. Ideally the audio is high-fidelity,
+     *         recorded at a 16khz or greater sampling rate.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_conversation</code></td>
+     *     <td>Best for audio that originated from a conversation between a
+     *         medical provider and patient.</td>
+     *   </tr>
+     *   <tr>
+     *     <td><code>medical_dictation</code></td>
+     *     <td>Best for audio that originated from dictation notes by a medical
+     *         provider.</td>
+     *   </tr>
+     * </table>
+     * 
+ * + * string model = 13; + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + model_ = value; + onChanged(); + return this; + } + + private boolean useEnhanced_ ; + /** + *
+     * Set to true to use an enhanced model for speech recognition.
+     * If `use_enhanced` is set to true and the `model` field is not set, then
+     * an appropriate enhanced model is chosen if an enhanced model exists for
+     * the audio.
+     * If `use_enhanced` is true and an enhanced version of the specified model
+     * does not exist, then the speech is recognized using the standard version
+     * of the specified model.
+     * 
+ * + * bool use_enhanced = 14; + * @return The useEnhanced. + */ + @java.lang.Override + public boolean getUseEnhanced() { + return useEnhanced_; + } + /** + *
+     * Set to true to use an enhanced model for speech recognition.
+     * If `use_enhanced` is set to true and the `model` field is not set, then
+     * an appropriate enhanced model is chosen if an enhanced model exists for
+     * the audio.
+     * If `use_enhanced` is true and an enhanced version of the specified model
+     * does not exist, then the speech is recognized using the standard version
+     * of the specified model.
+     * 
+ * + * bool use_enhanced = 14; + * @param value The useEnhanced to set. + * @return This builder for chaining. + */ + public Builder setUseEnhanced(boolean value) { + + useEnhanced_ = value; + onChanged(); + return this; + } + /** + *
+     * Set to true to use an enhanced model for speech recognition.
+     * If `use_enhanced` is set to true and the `model` field is not set, then
+     * an appropriate enhanced model is chosen if an enhanced model exists for
+     * the audio.
+     * If `use_enhanced` is true and an enhanced version of the specified model
+     * does not exist, then the speech is recognized using the standard version
+     * of the specified model.
+     * 
+ * + * bool use_enhanced = 14; + * @return This builder for chaining. + */ + public Builder clearUseEnhanced() { + + useEnhanced_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.RecognitionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognitionConfig) + private static final com.google.cloud.speech.v1p1beta1.RecognitionConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognitionConfig(); + } + + public static com.google.cloud.speech.v1p1beta1.RecognitionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecognitionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecognitionConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java new file mode 100644 index 000000000000..dfc41e54d6fe --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java @@ -0,0 +1,725 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface RecognitionConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognitionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Encoding of audio data sent in all `RecognitionAudio` messages.
+   * This field is optional for `FLAC` and `WAV` audio files and required
+   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; + * @return The enum numeric value on the wire for encoding. + */ + int getEncodingValue(); + /** + *
+   * Encoding of audio data sent in all `RecognitionAudio` messages.
+   * This field is optional for `FLAC` and `WAV` audio files and required
+   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; + * @return The encoding. + */ + com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding getEncoding(); + + /** + *
+   * Sample rate in Hertz of the audio data sent in all
+   * `RecognitionAudio` messages. Valid values are: 8000-48000.
+   * 16000 is optimal. For best results, set the sampling rate of the audio
+   * source to 16000 Hz. If that's not possible, use the native sample rate of
+   * the audio source (instead of re-sampling).
+   * This field is optional for FLAC and WAV audio files, but is
+   * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
+   * 
+ * + * int32 sample_rate_hertz = 2; + * @return The sampleRateHertz. + */ + int getSampleRateHertz(); + + /** + *
+   * The number of channels in the input audio data.
+   * ONLY set this for MULTI-CHANNEL recognition.
+   * Valid values for LINEAR16 and FLAC are `1`-`8`.
+   * Valid values for OGG_OPUS are '1'-'254'.
+   * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
+   * If `0` or omitted, defaults to one channel (mono).
+   * Note: We only recognize the first channel by default.
+   * To perform independent recognition on each channel set
+   * `enable_separate_recognition_per_channel` to 'true'.
+   * 
+ * + * int32 audio_channel_count = 7; + * @return The audioChannelCount. + */ + int getAudioChannelCount(); + + /** + *
+   * This needs to be set to `true` explicitly and `audio_channel_count` > 1
+   * to get each channel recognized separately. The recognition result will
+   * contain a `channel_tag` field to state which channel that result belongs
+   * to. If this is not true, we will only recognize the first channel. The
+   * request is billed cumulatively for all channels recognized:
+   * `audio_channel_count` multiplied by the length of the audio.
+   * 
+ * + * bool enable_separate_recognition_per_channel = 12; + * @return The enableSeparateRecognitionPerChannel. + */ + boolean getEnableSeparateRecognitionPerChannel(); + + /** + *
+   * Required. The language of the supplied audio as a
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+   * Example: "en-US".
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes.
+   * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + *
+   * Required. The language of the supplied audio as a
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
+   * Example: "en-US".
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes.
+   * 
+ * + * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString + getLanguageCodeBytes(); + + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @return A list containing the alternativeLanguageCodes. + */ + java.util.List + getAlternativeLanguageCodesList(); + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @return The count of alternativeLanguageCodes. + */ + int getAlternativeLanguageCodesCount(); + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index of the element to return. + * @return The alternativeLanguageCodes at the given index. + */ + java.lang.String getAlternativeLanguageCodes(int index); + /** + *
+   * A list of up to 3 additional
+   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
+   * listing possible alternative languages of the supplied audio.
+   * See [Language
+   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
+   * of the currently supported language codes. If alternative languages are
+   * listed, recognition result will contain recognition in the most likely
+   * language detected including the main language_code. The recognition result
+   * will include the language tag of the language detected in the audio. Note:
+   * This feature is only supported for Voice Command and Voice Search use cases
+   * and performance may vary for other use cases (e.g., phone call
+   * transcription).
+   * 
+ * + * repeated string alternative_language_codes = 18; + * @param index The index of the value to return. + * @return The bytes of the alternativeLanguageCodes at the given index. + */ + com.google.protobuf.ByteString + getAlternativeLanguageCodesBytes(int index); + + /** + *
+   * Maximum number of recognition hypotheses to be returned.
+   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
+   * within each `SpeechRecognitionResult`.
+   * The server may return fewer than `max_alternatives`.
+   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
+   * one. If omitted, will return a maximum of one.
+   * 
+ * + * int32 max_alternatives = 4; + * @return The maxAlternatives. + */ + int getMaxAlternatives(); + + /** + *
+   * If set to `true`, the server will attempt to filter out
+   * profanities, replacing all but the initial character in each filtered word
+   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
+   * won't be filtered out.
+   * 
+ * + * bool profanity_filter = 5; + * @return The profanityFilter. + */ + boolean getProfanityFilter(); + + /** + *
+   * Speech adaptation configuration improves the accuracy of speech
+   * recognition. For more information, see the [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+   * documentation.
+   * When speech adaptation is set it supersedes the `speech_contexts` field.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + * @return Whether the adaptation field is set. + */ + boolean hasAdaptation(); + /** + *
+   * Speech adaptation configuration improves the accuracy of speech
+   * recognition. For more information, see the [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+   * documentation.
+   * When speech adaptation is set it supersedes the `speech_contexts` field.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + * @return The adaptation. + */ + com.google.cloud.speech.v1p1beta1.SpeechAdaptation getAdaptation(); + /** + *
+   * Speech adaptation configuration improves the accuracy of speech
+   * recognition. For more information, see the [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
+   * documentation.
+   * When speech adaptation is set it supersedes the `speech_contexts` field.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; + */ + com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder getAdaptationOrBuilder(); + + /** + *
+   * Use transcription normalization to automatically replace parts of the
+   * transcript with phrases of your choosing. For StreamingRecognize, this
+   * normalization only applies to stable partial transcripts (stability > 0.8)
+   * and final transcripts.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + * @return Whether the transcriptNormalization field is set. + */ + boolean hasTranscriptNormalization(); + /** + *
+   * Use transcription normalization to automatically replace parts of the
+   * transcript with phrases of your choosing. For StreamingRecognize, this
+   * normalization only applies to stable partial transcripts (stability > 0.8)
+   * and final transcripts.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + * @return The transcriptNormalization. + */ + com.google.cloud.speech.v1p1beta1.TranscriptNormalization getTranscriptNormalization(); + /** + *
+   * Use transcription normalization to automatically replace parts of the
+   * transcript with phrases of your choosing. For StreamingRecognize, this
+   * normalization only applies to stable partial transcripts (stability > 0.8)
+   * and final transcripts.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; + */ + com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder getTranscriptNormalizationOrBuilder(); + + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + java.util.List + getSpeechContextsList(); + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + com.google.cloud.speech.v1p1beta1.SpeechContext getSpeechContexts(int index); + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + int getSpeechContextsCount(); + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + java.util.List + getSpeechContextsOrBuilderList(); + /** + *
+   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
+   * A means to provide context to assist the speech recognition. For more
+   * information, see
+   * [speech
+   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; + */ + com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder getSpeechContextsOrBuilder( + int index); + + /** + *
+   * If `true`, the top result includes a list of words and
+   * the start and end time offsets (timestamps) for those words. If
+   * `false`, no word-level time offset information is returned. The default is
+   * `false`.
+   * 
+ * + * bool enable_word_time_offsets = 8; + * @return The enableWordTimeOffsets. + */ + boolean getEnableWordTimeOffsets(); + + /** + *
+   * If `true`, the top result includes a list of words and the
+   * confidence for those words. If `false`, no word-level confidence
+   * information is returned. The default is `false`.
+   * 
+ * + * bool enable_word_confidence = 15; + * @return The enableWordConfidence. + */ + boolean getEnableWordConfidence(); + + /** + *
+   * If 'true', adds punctuation to recognition result hypotheses.
+   * This feature is only available in select languages. Setting this for
+   * requests in other languages has no effect at all.
+   * The default 'false' value does not add punctuation to result hypotheses.
+   * 
+ * + * bool enable_automatic_punctuation = 11; + * @return The enableAutomaticPunctuation. + */ + boolean getEnableAutomaticPunctuation(); + + /** + *
+   * The spoken punctuation behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * e.g. command_and_search will enable spoken punctuation by default
+   * If 'true', replaces spoken punctuation with the corresponding symbols in
+   * the request. For example, "how are you question mark" becomes "how are
+   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+   * for support. If 'false', spoken punctuation is not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + * @return Whether the enableSpokenPunctuation field is set. + */ + boolean hasEnableSpokenPunctuation(); + /** + *
+   * The spoken punctuation behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * e.g. command_and_search will enable spoken punctuation by default
+   * If 'true', replaces spoken punctuation with the corresponding symbols in
+   * the request. For example, "how are you question mark" becomes "how are
+   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+   * for support. If 'false', spoken punctuation is not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + * @return The enableSpokenPunctuation. + */ + com.google.protobuf.BoolValue getEnableSpokenPunctuation(); + /** + *
+   * The spoken punctuation behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * e.g. command_and_search will enable spoken punctuation by default
+   * If 'true', replaces spoken punctuation with the corresponding symbols in
+   * the request. For example, "how are you question mark" becomes "how are
+   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
+   * for support. If 'false', spoken punctuation is not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_punctuation = 22; + */ + com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilder(); + + /** + *
+   * The spoken emoji behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * If 'true', adds spoken emoji formatting for the request. This will replace
+   * spoken emojis with the corresponding Unicode symbols in the final
+   * transcript. If 'false', spoken emojis are not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + * @return Whether the enableSpokenEmojis field is set. + */ + boolean hasEnableSpokenEmojis(); + /** + *
+   * The spoken emoji behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * If 'true', adds spoken emoji formatting for the request. This will replace
+   * spoken emojis with the corresponding Unicode symbols in the final
+   * transcript. If 'false', spoken emojis are not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + * @return The enableSpokenEmojis. + */ + com.google.protobuf.BoolValue getEnableSpokenEmojis(); + /** + *
+   * The spoken emoji behavior for the call
+   * If not set, uses default behavior based on model of choice
+   * If 'true', adds spoken emoji formatting for the request. This will replace
+   * spoken emojis with the corresponding Unicode symbols in the final
+   * transcript. If 'false', spoken emojis are not replaced.
+   * 
+ * + * .google.protobuf.BoolValue enable_spoken_emojis = 23; + */ + com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder(); + + /** + *
+   * If 'true', enables speaker detection for each recognized word in
+   * the top alternative of the recognition result using a speaker_tag provided
+   * in the WordInfo.
+   * Note: Use diarization_config instead.
+   * 
+ * + * bool enable_speaker_diarization = 16 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378 + * @return The enableSpeakerDiarization. + */ + @java.lang.Deprecated boolean getEnableSpeakerDiarization(); + + /** + *
+   * If set, specifies the estimated number of speakers in the conversation.
+   * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
+   * Note: Use diarization_config instead.
+   * 
+ * + * int32 diarization_speaker_count = 17 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383 + * @return The diarizationSpeakerCount. + */ + @java.lang.Deprecated int getDiarizationSpeakerCount(); + + /** + *
+   * Config to enable speaker diarization and set additional
+   * parameters to make diarization better suited for your application.
+   * Note: When this is enabled, we send all the words from the beginning of the
+   * audio for the top alternative in every consecutive STREAMING responses.
+   * This is done in order to improve our speaker tags as our models learn to
+   * identify the speakers in the conversation over time.
+   * For non-streaming requests, the diarization results will be provided only
+   * in the top alternative of the FINAL SpeechRecognitionResult.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + * @return Whether the diarizationConfig field is set. + */ + boolean hasDiarizationConfig(); + /** + *
+   * Config to enable speaker diarization and set additional
+   * parameters to make diarization better suited for your application.
+   * Note: When this is enabled, we send all the words from the beginning of the
+   * audio for the top alternative in every consecutive STREAMING responses.
+   * This is done in order to improve our speaker tags as our models learn to
+   * identify the speakers in the conversation over time.
+   * For non-streaming requests, the diarization results will be provided only
+   * in the top alternative of the FINAL SpeechRecognitionResult.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + * @return The diarizationConfig. + */ + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDiarizationConfig(); + /** + *
+   * Config to enable speaker diarization and set additional
+   * parameters to make diarization better suited for your application.
+   * Note: When this is enabled, we send all the words from the beginning of the
+   * audio for the top alternative in every consecutive STREAMING responses.
+   * This is done in order to improve our speaker tags as our models learn to
+   * identify the speakers in the conversation over time.
+   * For non-streaming requests, the diarization results will be provided only
+   * in the top alternative of the FINAL SpeechRecognitionResult.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; + */ + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder(); + + /** + *
+   * Metadata regarding this request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + *
+   * Metadata regarding this request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + * @return The metadata. + */ + com.google.cloud.speech.v1p1beta1.RecognitionMetadata getMetadata(); + /** + *
+   * Metadata regarding this request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; + */ + com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder getMetadataOrBuilder(); + + /** + *
+   * Which model to select for the given request. Select the model
+   * best suited to your domain to get best results. If a model is not
+   * explicitly specified, then we auto-select a model based on the parameters
+   * in the RecognitionConfig.
+   * <table>
+   *   <tr>
+   *     <td><b>Model</b></td>
+   *     <td><b>Description</b></td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_long</code></td>
+   *     <td>Best for long form content like media or conversation.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_short</code></td>
+   *     <td>Best for short form content like commands or single shot directed
+   *     speech.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>command_and_search</code></td>
+   *     <td>Best for short queries such as voice commands or voice search.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>phone_call</code></td>
+   *     <td>Best for audio that originated from a phone call (typically
+   *     recorded at an 8khz sampling rate).</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>video</code></td>
+   *     <td>Best for audio that originated from video or includes multiple
+   *         speakers. Ideally the audio is recorded at a 16khz or greater
+   *         sampling rate. This is a premium model that costs more than the
+   *         standard rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>default</code></td>
+   *     <td>Best for audio that is not one of the specific audio models.
+   *         For example, long-form audio. Ideally the audio is high-fidelity,
+   *         recorded at a 16khz or greater sampling rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_conversation</code></td>
+   *     <td>Best for audio that originated from a conversation between a
+   *         medical provider and patient.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_dictation</code></td>
+   *     <td>Best for audio that originated from dictation notes by a medical
+   *         provider.</td>
+   *   </tr>
+   * </table>
+   * 
+ * + * string model = 13; + * @return The model. + */ + java.lang.String getModel(); + /** + *
+   * Which model to select for the given request. Select the model
+   * best suited to your domain to get best results. If a model is not
+   * explicitly specified, then we auto-select a model based on the parameters
+   * in the RecognitionConfig.
+   * <table>
+   *   <tr>
+   *     <td><b>Model</b></td>
+   *     <td><b>Description</b></td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_long</code></td>
+   *     <td>Best for long form content like media or conversation.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>latest_short</code></td>
+   *     <td>Best for short form content like commands or single shot directed
+   *     speech.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>command_and_search</code></td>
+   *     <td>Best for short queries such as voice commands or voice search.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>phone_call</code></td>
+   *     <td>Best for audio that originated from a phone call (typically
+   *     recorded at an 8khz sampling rate).</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>video</code></td>
+   *     <td>Best for audio that originated from video or includes multiple
+   *         speakers. Ideally the audio is recorded at a 16khz or greater
+   *         sampling rate. This is a premium model that costs more than the
+   *         standard rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>default</code></td>
+   *     <td>Best for audio that is not one of the specific audio models.
+   *         For example, long-form audio. Ideally the audio is high-fidelity,
+   *         recorded at a 16khz or greater sampling rate.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_conversation</code></td>
+   *     <td>Best for audio that originated from a conversation between a
+   *         medical provider and patient.</td>
+   *   </tr>
+   *   <tr>
+   *     <td><code>medical_dictation</code></td>
+   *     <td>Best for audio that originated from dictation notes by a medical
+   *         provider.</td>
+   *   </tr>
+   * </table>
+   * 
+ * + * string model = 13; + * @return The bytes for model. + */ + com.google.protobuf.ByteString + getModelBytes(); + + /** + *
+   * Set to true to use an enhanced model for speech recognition.
+   * If `use_enhanced` is set to true and the `model` field is not set, then
+   * an appropriate enhanced model is chosen if an enhanced model exists for
+   * the audio.
+   * If `use_enhanced` is true and an enhanced version of the specified model
+   * does not exist, then the speech is recognized using the standard version
+   * of the specified model.
+   * 
+ * + * bool use_enhanced = 14; + * @return The useEnhanced. + */ + boolean getUseEnhanced(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java new file mode 100644 index 000000000000..4a666fd4cee5 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java @@ -0,0 +1,2436 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Description of audio data to be recognized.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionMetadata} + */ +@java.lang.Deprecated public final class RecognitionMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognitionMetadata) + RecognitionMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use RecognitionMetadata.newBuilder() to construct. + private RecognitionMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RecognitionMetadata() { + interactionType_ = 0; + microphoneDistance_ = 0; + originalMediaType_ = 0; + recordingDeviceType_ = 0; + recordingDeviceName_ = ""; + originalMimeType_ = ""; + audioTopic_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RecognitionMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RecognitionMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + interactionType_ = rawValue; + break; + } + case 24: { + + industryNaicsCodeOfAudio_ = input.readUInt32(); + break; + } + case 32: { + int rawValue = input.readEnum(); + + microphoneDistance_ = rawValue; + break; + } + case 40: { + int rawValue = input.readEnum(); + + originalMediaType_ = rawValue; + break; + } + case 48: { + int rawValue = input.readEnum(); + + recordingDeviceType_ = rawValue; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + recordingDeviceName_ = s; + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + originalMimeType_ = s; + break; + } + case 72: { + + obfuscatedId_ = input.readInt64(); + break; + } + case 82: { + java.lang.String s = input.readStringRequireUtf8(); + + audioTopic_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.class, com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder.class); + } + + /** + *
+   * Use case categories that the audio recognition request can be described
+   * by.
+   * 
+ * + * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType} + */ + public enum InteractionType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Use case is either unknown or is something other than one of the other
+     * values below.
+     * 
+ * + * INTERACTION_TYPE_UNSPECIFIED = 0; + */ + INTERACTION_TYPE_UNSPECIFIED(0), + /** + *
+     * Multiple people in a conversation or discussion. For example in a
+     * meeting with two or more people actively participating. Typically
+     * all the primary people speaking would be in the same room (if not,
+     * see PHONE_CALL)
+     * 
+ * + * DISCUSSION = 1; + */ + DISCUSSION(1), + /** + *
+     * One or more persons lecturing or presenting to others, mostly
+     * uninterrupted.
+     * 
+ * + * PRESENTATION = 2; + */ + PRESENTATION(2), + /** + *
+     * A phone-call or video-conference in which two or more people, who are
+     * not in the same room, are actively participating.
+     * 
+ * + * PHONE_CALL = 3; + */ + PHONE_CALL(3), + /** + *
+     * A recorded message intended for another person to listen to.
+     * 
+ * + * VOICEMAIL = 4; + */ + VOICEMAIL(4), + /** + *
+     * Professionally produced audio (eg. TV Show, Podcast).
+     * 
+ * + * PROFESSIONALLY_PRODUCED = 5; + */ + PROFESSIONALLY_PRODUCED(5), + /** + *
+     * Transcribe spoken questions and queries into text.
+     * 
+ * + * VOICE_SEARCH = 6; + */ + VOICE_SEARCH(6), + /** + *
+     * Transcribe voice commands, such as for controlling a device.
+     * 
+ * + * VOICE_COMMAND = 7; + */ + VOICE_COMMAND(7), + /** + *
+     * Transcribe speech to text to create a written document, such as a
+     * text-message, email or report.
+     * 
+ * + * DICTATION = 8; + */ + DICTATION(8), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Use case is either unknown or is something other than one of the other
+     * values below.
+     * 
+ * + * INTERACTION_TYPE_UNSPECIFIED = 0; + */ + public static final int INTERACTION_TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * Multiple people in a conversation or discussion. For example in a
+     * meeting with two or more people actively participating. Typically
+     * all the primary people speaking would be in the same room (if not,
+     * see PHONE_CALL)
+     * 
+ * + * DISCUSSION = 1; + */ + public static final int DISCUSSION_VALUE = 1; + /** + *
+     * One or more persons lecturing or presenting to others, mostly
+     * uninterrupted.
+     * 
+ * + * PRESENTATION = 2; + */ + public static final int PRESENTATION_VALUE = 2; + /** + *
+     * A phone-call or video-conference in which two or more people, who are
+     * not in the same room, are actively participating.
+     * 
+ * + * PHONE_CALL = 3; + */ + public static final int PHONE_CALL_VALUE = 3; + /** + *
+     * A recorded message intended for another person to listen to.
+     * 
+ * + * VOICEMAIL = 4; + */ + public static final int VOICEMAIL_VALUE = 4; + /** + *
+     * Professionally produced audio (eg. TV Show, Podcast).
+     * 
+ * + * PROFESSIONALLY_PRODUCED = 5; + */ + public static final int PROFESSIONALLY_PRODUCED_VALUE = 5; + /** + *
+     * Transcribe spoken questions and queries into text.
+     * 
+ * + * VOICE_SEARCH = 6; + */ + public static final int VOICE_SEARCH_VALUE = 6; + /** + *
+     * Transcribe voice commands, such as for controlling a device.
+     * 
+ * + * VOICE_COMMAND = 7; + */ + public static final int VOICE_COMMAND_VALUE = 7; + /** + *
+     * Transcribe speech to text to create a written document, such as a
+     * text-message, email or report.
+     * 
+ * + * DICTATION = 8; + */ + public static final int DICTATION_VALUE = 8; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static InteractionType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static InteractionType forNumber(int value) { + switch (value) { + case 0: return INTERACTION_TYPE_UNSPECIFIED; + case 1: return DISCUSSION; + case 2: return PRESENTATION; + case 3: return PHONE_CALL; + case 4: return VOICEMAIL; + case 5: return PROFESSIONALLY_PRODUCED; + case 6: return VOICE_SEARCH; + case 7: return VOICE_COMMAND; + case 8: return DICTATION; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + InteractionType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public InteractionType findValueByNumber(int number) { + return InteractionType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDescriptor().getEnumTypes().get(0); + } + + private static final InteractionType[] VALUES = values(); + + public static InteractionType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private InteractionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType) + } + + /** + *
+   * Enumerates the types of capture settings describing an audio file.
+   * 
+ * + * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance} + */ + public enum MicrophoneDistance + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Audio type is not known.
+     * 
+ * + * MICROPHONE_DISTANCE_UNSPECIFIED = 0; + */ + MICROPHONE_DISTANCE_UNSPECIFIED(0), + /** + *
+     * The audio was captured from a closely placed microphone. Eg. phone,
+     * dictaphone, or handheld microphone. Generally if there speaker is within
+     * 1 meter of the microphone.
+     * 
+ * + * NEARFIELD = 1; + */ + NEARFIELD(1), + /** + *
+     * The speaker if within 3 meters of the microphone.
+     * 
+ * + * MIDFIELD = 2; + */ + MIDFIELD(2), + /** + *
+     * The speaker is more than 3 meters away from the microphone.
+     * 
+ * + * FARFIELD = 3; + */ + FARFIELD(3), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Audio type is not known.
+     * 
+ * + * MICROPHONE_DISTANCE_UNSPECIFIED = 0; + */ + public static final int MICROPHONE_DISTANCE_UNSPECIFIED_VALUE = 0; + /** + *
+     * The audio was captured from a closely placed microphone. Eg. phone,
+     * dictaphone, or handheld microphone. Generally if there speaker is within
+     * 1 meter of the microphone.
+     * 
+ * + * NEARFIELD = 1; + */ + public static final int NEARFIELD_VALUE = 1; + /** + *
+     * The speaker if within 3 meters of the microphone.
+     * 
+ * + * MIDFIELD = 2; + */ + public static final int MIDFIELD_VALUE = 2; + /** + *
+     * The speaker is more than 3 meters away from the microphone.
+     * 
+ * + * FARFIELD = 3; + */ + public static final int FARFIELD_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static MicrophoneDistance valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static MicrophoneDistance forNumber(int value) { + switch (value) { + case 0: return MICROPHONE_DISTANCE_UNSPECIFIED; + case 1: return NEARFIELD; + case 2: return MIDFIELD; + case 3: return FARFIELD; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + MicrophoneDistance> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public MicrophoneDistance findValueByNumber(int number) { + return MicrophoneDistance.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDescriptor().getEnumTypes().get(1); + } + + private static final MicrophoneDistance[] VALUES = values(); + + public static MicrophoneDistance valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private MicrophoneDistance(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance) + } + + /** + *
+   * The original media the speech was recorded on.
+   * 
+ * + * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType} + */ + public enum OriginalMediaType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unknown original media type.
+     * 
+ * + * ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; + */ + ORIGINAL_MEDIA_TYPE_UNSPECIFIED(0), + /** + *
+     * The speech data is an audio recording.
+     * 
+ * + * AUDIO = 1; + */ + AUDIO(1), + /** + *
+     * The speech data originally recorded on a video.
+     * 
+ * + * VIDEO = 2; + */ + VIDEO(2), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unknown original media type.
+     * 
+ * + * ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; + */ + public static final int ORIGINAL_MEDIA_TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * The speech data is an audio recording.
+     * 
+ * + * AUDIO = 1; + */ + public static final int AUDIO_VALUE = 1; + /** + *
+     * The speech data originally recorded on a video.
+     * 
+ * + * VIDEO = 2; + */ + public static final int VIDEO_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OriginalMediaType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static OriginalMediaType forNumber(int value) { + switch (value) { + case 0: return ORIGINAL_MEDIA_TYPE_UNSPECIFIED; + case 1: return AUDIO; + case 2: return VIDEO; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + OriginalMediaType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public OriginalMediaType findValueByNumber(int number) { + return OriginalMediaType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDescriptor().getEnumTypes().get(2); + } + + private static final OriginalMediaType[] VALUES = values(); + + public static OriginalMediaType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private OriginalMediaType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType) + } + + /** + *
+   * The type of device the speech was recorded with.
+   * 
+ * + * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType} + */ + public enum RecordingDeviceType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * The recording device is unknown.
+     * 
+ * + * RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; + */ + RECORDING_DEVICE_TYPE_UNSPECIFIED(0), + /** + *
+     * Speech was recorded on a smartphone.
+     * 
+ * + * SMARTPHONE = 1; + */ + SMARTPHONE(1), + /** + *
+     * Speech was recorded using a personal computer or tablet.
+     * 
+ * + * PC = 2; + */ + PC(2), + /** + *
+     * Speech was recorded over a phone line.
+     * 
+ * + * PHONE_LINE = 3; + */ + PHONE_LINE(3), + /** + *
+     * Speech was recorded in a vehicle.
+     * 
+ * + * VEHICLE = 4; + */ + VEHICLE(4), + /** + *
+     * Speech was recorded outdoors.
+     * 
+ * + * OTHER_OUTDOOR_DEVICE = 5; + */ + OTHER_OUTDOOR_DEVICE(5), + /** + *
+     * Speech was recorded indoors.
+     * 
+ * + * OTHER_INDOOR_DEVICE = 6; + */ + OTHER_INDOOR_DEVICE(6), + UNRECOGNIZED(-1), + ; + + /** + *
+     * The recording device is unknown.
+     * 
+ * + * RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; + */ + public static final int RECORDING_DEVICE_TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * Speech was recorded on a smartphone.
+     * 
+ * + * SMARTPHONE = 1; + */ + public static final int SMARTPHONE_VALUE = 1; + /** + *
+     * Speech was recorded using a personal computer or tablet.
+     * 
+ * + * PC = 2; + */ + public static final int PC_VALUE = 2; + /** + *
+     * Speech was recorded over a phone line.
+     * 
+ * + * PHONE_LINE = 3; + */ + public static final int PHONE_LINE_VALUE = 3; + /** + *
+     * Speech was recorded in a vehicle.
+     * 
+ * + * VEHICLE = 4; + */ + public static final int VEHICLE_VALUE = 4; + /** + *
+     * Speech was recorded outdoors.
+     * 
+ * + * OTHER_OUTDOOR_DEVICE = 5; + */ + public static final int OTHER_OUTDOOR_DEVICE_VALUE = 5; + /** + *
+     * Speech was recorded indoors.
+     * 
+ * + * OTHER_INDOOR_DEVICE = 6; + */ + public static final int OTHER_INDOOR_DEVICE_VALUE = 6; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RecordingDeviceType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RecordingDeviceType forNumber(int value) { + switch (value) { + case 0: return RECORDING_DEVICE_TYPE_UNSPECIFIED; + case 1: return SMARTPHONE; + case 2: return PC; + case 3: return PHONE_LINE; + case 4: return VEHICLE; + case 5: return OTHER_OUTDOOR_DEVICE; + case 6: return OTHER_INDOOR_DEVICE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + RecordingDeviceType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RecordingDeviceType findValueByNumber(int number) { + return RecordingDeviceType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDescriptor().getEnumTypes().get(3); + } + + private static final RecordingDeviceType[] VALUES = values(); + + public static RecordingDeviceType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RecordingDeviceType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType) + } + + public static final int INTERACTION_TYPE_FIELD_NUMBER = 1; + private int interactionType_; + /** + *
+   * The use case most closely describing the audio content to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return The enum numeric value on the wire for interactionType. + */ + @java.lang.Override public int getInteractionTypeValue() { + return interactionType_; + } + /** + *
+   * The use case most closely describing the audio content to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return The interactionType. + */ + @java.lang.Override public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType getInteractionType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.valueOf(interactionType_); + return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.UNRECOGNIZED : result; + } + + public static final int INDUSTRY_NAICS_CODE_OF_AUDIO_FIELD_NUMBER = 3; + private int industryNaicsCodeOfAudio_; + /** + *
+   * The industry vertical to which this speech recognition request most
+   * closely applies. This is most indicative of the topics contained
+   * in the audio.  Use the 6-digit NAICS code to identify the industry
+   * vertical - see https://www.naics.com/search/.
+   * 
+ * + * uint32 industry_naics_code_of_audio = 3; + * @return The industryNaicsCodeOfAudio. + */ + @java.lang.Override + public int getIndustryNaicsCodeOfAudio() { + return industryNaicsCodeOfAudio_; + } + + public static final int MICROPHONE_DISTANCE_FIELD_NUMBER = 4; + private int microphoneDistance_; + /** + *
+   * The audio type that most closely describes the audio being recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return The enum numeric value on the wire for microphoneDistance. + */ + @java.lang.Override public int getMicrophoneDistanceValue() { + return microphoneDistance_; + } + /** + *
+   * The audio type that most closely describes the audio being recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return The microphoneDistance. + */ + @java.lang.Override public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.valueOf(microphoneDistance_); + return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.UNRECOGNIZED : result; + } + + public static final int ORIGINAL_MEDIA_TYPE_FIELD_NUMBER = 5; + private int originalMediaType_; + /** + *
+   * The original media the speech was recorded on.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return The enum numeric value on the wire for originalMediaType. + */ + @java.lang.Override public int getOriginalMediaTypeValue() { + return originalMediaType_; + } + /** + *
+   * The original media the speech was recorded on.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return The originalMediaType. + */ + @java.lang.Override public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType getOriginalMediaType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.valueOf(originalMediaType_); + return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.UNRECOGNIZED : result; + } + + public static final int RECORDING_DEVICE_TYPE_FIELD_NUMBER = 6; + private int recordingDeviceType_; + /** + *
+   * The type of device the speech was recorded with.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return The enum numeric value on the wire for recordingDeviceType. + */ + @java.lang.Override public int getRecordingDeviceTypeValue() { + return recordingDeviceType_; + } + /** + *
+   * The type of device the speech was recorded with.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return The recordingDeviceType. + */ + @java.lang.Override public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.valueOf(recordingDeviceType_); + return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.UNRECOGNIZED : result; + } + + public static final int RECORDING_DEVICE_NAME_FIELD_NUMBER = 7; + private volatile java.lang.Object recordingDeviceName_; + /** + *
+   * The device used to make the recording.  Examples 'Nexus 5X' or
+   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+   * 'Cardioid Microphone'.
+   * 
+ * + * string recording_device_name = 7; + * @return The recordingDeviceName. + */ + @java.lang.Override + public java.lang.String getRecordingDeviceName() { + java.lang.Object ref = recordingDeviceName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recordingDeviceName_ = s; + return s; + } + } + /** + *
+   * The device used to make the recording.  Examples 'Nexus 5X' or
+   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+   * 'Cardioid Microphone'.
+   * 
+ * + * string recording_device_name = 7; + * @return The bytes for recordingDeviceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRecordingDeviceNameBytes() { + java.lang.Object ref = recordingDeviceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + recordingDeviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORIGINAL_MIME_TYPE_FIELD_NUMBER = 8; + private volatile java.lang.Object originalMimeType_; + /** + *
+   * Mime type of the original audio file.  For example `audio/m4a`,
+   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+   * A list of possible audio mime types is maintained at
+   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+   * 
+ * + * string original_mime_type = 8; + * @return The originalMimeType. + */ + @java.lang.Override + public java.lang.String getOriginalMimeType() { + java.lang.Object ref = originalMimeType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + originalMimeType_ = s; + return s; + } + } + /** + *
+   * Mime type of the original audio file.  For example `audio/m4a`,
+   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+   * A list of possible audio mime types is maintained at
+   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+   * 
+ * + * string original_mime_type = 8; + * @return The bytes for originalMimeType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOriginalMimeTypeBytes() { + java.lang.Object ref = originalMimeType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + originalMimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OBFUSCATED_ID_FIELD_NUMBER = 9; + private long obfuscatedId_; + /** + *
+   * Obfuscated (privacy-protected) ID of the user, to identify number of
+   * unique users using the service.
+   * 
+ * + * int64 obfuscated_id = 9 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612 + * @return The obfuscatedId. + */ + @java.lang.Override + @java.lang.Deprecated public long getObfuscatedId() { + return obfuscatedId_; + } + + public static final int AUDIO_TOPIC_FIELD_NUMBER = 10; + private volatile java.lang.Object audioTopic_; + /** + *
+   * Description of the content. Eg. "Recordings of federal supreme court
+   * hearings from 2012".
+   * 
+ * + * string audio_topic = 10; + * @return The audioTopic. + */ + @java.lang.Override + public java.lang.String getAudioTopic() { + java.lang.Object ref = audioTopic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + audioTopic_ = s; + return s; + } + } + /** + *
+   * Description of the content. Eg. "Recordings of federal supreme court
+   * hearings from 2012".
+   * 
+ * + * string audio_topic = 10; + * @return The bytes for audioTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAudioTopicBytes() { + java.lang.Object ref = audioTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + audioTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (interactionType_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.INTERACTION_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, interactionType_); + } + if (industryNaicsCodeOfAudio_ != 0) { + output.writeUInt32(3, industryNaicsCodeOfAudio_); + } + if (microphoneDistance_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.MICROPHONE_DISTANCE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, microphoneDistance_); + } + if (originalMediaType_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.ORIGINAL_MEDIA_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, originalMediaType_); + } + if (recordingDeviceType_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.RECORDING_DEVICE_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, recordingDeviceType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordingDeviceName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, recordingDeviceName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalMimeType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, originalMimeType_); + } + if (obfuscatedId_ != 0L) { + output.writeInt64(9, obfuscatedId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audioTopic_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, audioTopic_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (interactionType_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.INTERACTION_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, interactionType_); + } + if (industryNaicsCodeOfAudio_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(3, industryNaicsCodeOfAudio_); + } + if (microphoneDistance_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.MICROPHONE_DISTANCE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, microphoneDistance_); + } + if (originalMediaType_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.ORIGINAL_MEDIA_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(5, originalMediaType_); + } + if (recordingDeviceType_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.RECORDING_DEVICE_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(6, recordingDeviceType_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordingDeviceName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, recordingDeviceName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalMimeType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, originalMimeType_); + } + if (obfuscatedId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, obfuscatedId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audioTopic_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, audioTopic_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.RecognitionMetadata)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.RecognitionMetadata other = (com.google.cloud.speech.v1p1beta1.RecognitionMetadata) obj; + + if (interactionType_ != other.interactionType_) return false; + if (getIndustryNaicsCodeOfAudio() + != other.getIndustryNaicsCodeOfAudio()) return false; + if (microphoneDistance_ != other.microphoneDistance_) return false; + if (originalMediaType_ != other.originalMediaType_) return false; + if (recordingDeviceType_ != other.recordingDeviceType_) return false; + if (!getRecordingDeviceName() + .equals(other.getRecordingDeviceName())) return false; + if (!getOriginalMimeType() + .equals(other.getOriginalMimeType())) return false; + if (getObfuscatedId() + != other.getObfuscatedId()) return false; + if (!getAudioTopic() + .equals(other.getAudioTopic())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + INTERACTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + interactionType_; + hash = (37 * hash) + INDUSTRY_NAICS_CODE_OF_AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getIndustryNaicsCodeOfAudio(); + hash = (37 * hash) + MICROPHONE_DISTANCE_FIELD_NUMBER; + hash = (53 * hash) + microphoneDistance_; + hash = (37 * hash) + ORIGINAL_MEDIA_TYPE_FIELD_NUMBER; + hash = (53 * hash) + originalMediaType_; + hash = (37 * hash) + RECORDING_DEVICE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + recordingDeviceType_; + hash = (37 * hash) + RECORDING_DEVICE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getRecordingDeviceName().hashCode(); + hash = (37 * hash) + ORIGINAL_MIME_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getOriginalMimeType().hashCode(); + hash = (37 * hash) + OBFUSCATED_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getObfuscatedId()); + hash = (37 * hash) + AUDIO_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getAudioTopic().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.RecognitionMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Description of audio data to be recognized.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognitionMetadata) + com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.class, com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.RecognitionMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + interactionType_ = 0; + + industryNaicsCodeOfAudio_ = 0; + + microphoneDistance_ = 0; + + originalMediaType_ = 0; + + recordingDeviceType_ = 0; + + recordingDeviceName_ = ""; + + originalMimeType_ = ""; + + obfuscatedId_ = 0L; + + audioTopic_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionMetadata getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionMetadata build() { + com.google.cloud.speech.v1p1beta1.RecognitionMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionMetadata buildPartial() { + com.google.cloud.speech.v1p1beta1.RecognitionMetadata result = new com.google.cloud.speech.v1p1beta1.RecognitionMetadata(this); + result.interactionType_ = interactionType_; + result.industryNaicsCodeOfAudio_ = industryNaicsCodeOfAudio_; + result.microphoneDistance_ = microphoneDistance_; + result.originalMediaType_ = originalMediaType_; + result.recordingDeviceType_ = recordingDeviceType_; + result.recordingDeviceName_ = recordingDeviceName_; + result.originalMimeType_ = originalMimeType_; + result.obfuscatedId_ = obfuscatedId_; + result.audioTopic_ = audioTopic_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.RecognitionMetadata) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognitionMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognitionMetadata other) { + if (other == com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance()) return this; + if (other.interactionType_ != 0) { + setInteractionTypeValue(other.getInteractionTypeValue()); + } + if (other.getIndustryNaicsCodeOfAudio() != 0) { + setIndustryNaicsCodeOfAudio(other.getIndustryNaicsCodeOfAudio()); + } + if (other.microphoneDistance_ != 0) { + setMicrophoneDistanceValue(other.getMicrophoneDistanceValue()); + } + if (other.originalMediaType_ != 0) { + setOriginalMediaTypeValue(other.getOriginalMediaTypeValue()); + } + if (other.recordingDeviceType_ != 0) { + setRecordingDeviceTypeValue(other.getRecordingDeviceTypeValue()); + } + if (!other.getRecordingDeviceName().isEmpty()) { + recordingDeviceName_ = other.recordingDeviceName_; + onChanged(); + } + if (!other.getOriginalMimeType().isEmpty()) { + originalMimeType_ = other.originalMimeType_; + onChanged(); + } + if (other.getObfuscatedId() != 0L) { + setObfuscatedId(other.getObfuscatedId()); + } + if (!other.getAudioTopic().isEmpty()) { + audioTopic_ = other.audioTopic_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.RecognitionMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.RecognitionMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int interactionType_ = 0; + /** + *
+     * The use case most closely describing the audio content to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return The enum numeric value on the wire for interactionType. + */ + @java.lang.Override public int getInteractionTypeValue() { + return interactionType_; + } + /** + *
+     * The use case most closely describing the audio content to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; + * @param value The enum numeric value on the wire for interactionType to set. + * @return This builder for chaining. + */ + public Builder setInteractionTypeValue(int value) { + + interactionType_ = value; + onChanged(); + return this; + } + /** + *
+     * The use case most closely describing the audio content to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return The interactionType. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType getInteractionType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.valueOf(interactionType_); + return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.UNRECOGNIZED : result; + } + /** + *
+     * The use case most closely describing the audio content to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; + * @param value The interactionType to set. + * @return This builder for chaining. + */ + public Builder setInteractionType(com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType value) { + if (value == null) { + throw new NullPointerException(); + } + + interactionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The use case most closely describing the audio content to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return This builder for chaining. + */ + public Builder clearInteractionType() { + + interactionType_ = 0; + onChanged(); + return this; + } + + private int industryNaicsCodeOfAudio_ ; + /** + *
+     * The industry vertical to which this speech recognition request most
+     * closely applies. This is most indicative of the topics contained
+     * in the audio.  Use the 6-digit NAICS code to identify the industry
+     * vertical - see https://www.naics.com/search/.
+     * 
+ * + * uint32 industry_naics_code_of_audio = 3; + * @return The industryNaicsCodeOfAudio. + */ + @java.lang.Override + public int getIndustryNaicsCodeOfAudio() { + return industryNaicsCodeOfAudio_; + } + /** + *
+     * The industry vertical to which this speech recognition request most
+     * closely applies. This is most indicative of the topics contained
+     * in the audio.  Use the 6-digit NAICS code to identify the industry
+     * vertical - see https://www.naics.com/search/.
+     * 
+ * + * uint32 industry_naics_code_of_audio = 3; + * @param value The industryNaicsCodeOfAudio to set. + * @return This builder for chaining. + */ + public Builder setIndustryNaicsCodeOfAudio(int value) { + + industryNaicsCodeOfAudio_ = value; + onChanged(); + return this; + } + /** + *
+     * The industry vertical to which this speech recognition request most
+     * closely applies. This is most indicative of the topics contained
+     * in the audio.  Use the 6-digit NAICS code to identify the industry
+     * vertical - see https://www.naics.com/search/.
+     * 
+ * + * uint32 industry_naics_code_of_audio = 3; + * @return This builder for chaining. + */ + public Builder clearIndustryNaicsCodeOfAudio() { + + industryNaicsCodeOfAudio_ = 0; + onChanged(); + return this; + } + + private int microphoneDistance_ = 0; + /** + *
+     * The audio type that most closely describes the audio being recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return The enum numeric value on the wire for microphoneDistance. + */ + @java.lang.Override public int getMicrophoneDistanceValue() { + return microphoneDistance_; + } + /** + *
+     * The audio type that most closely describes the audio being recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @param value The enum numeric value on the wire for microphoneDistance to set. + * @return This builder for chaining. + */ + public Builder setMicrophoneDistanceValue(int value) { + + microphoneDistance_ = value; + onChanged(); + return this; + } + /** + *
+     * The audio type that most closely describes the audio being recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return The microphoneDistance. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.valueOf(microphoneDistance_); + return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.UNRECOGNIZED : result; + } + /** + *
+     * The audio type that most closely describes the audio being recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @param value The microphoneDistance to set. + * @return This builder for chaining. + */ + public Builder setMicrophoneDistance(com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance value) { + if (value == null) { + throw new NullPointerException(); + } + + microphoneDistance_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The audio type that most closely describes the audio being recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return This builder for chaining. + */ + public Builder clearMicrophoneDistance() { + + microphoneDistance_ = 0; + onChanged(); + return this; + } + + private int originalMediaType_ = 0; + /** + *
+     * The original media the speech was recorded on.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return The enum numeric value on the wire for originalMediaType. + */ + @java.lang.Override public int getOriginalMediaTypeValue() { + return originalMediaType_; + } + /** + *
+     * The original media the speech was recorded on.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @param value The enum numeric value on the wire for originalMediaType to set. + * @return This builder for chaining. + */ + public Builder setOriginalMediaTypeValue(int value) { + + originalMediaType_ = value; + onChanged(); + return this; + } + /** + *
+     * The original media the speech was recorded on.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return The originalMediaType. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType getOriginalMediaType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.valueOf(originalMediaType_); + return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.UNRECOGNIZED : result; + } + /** + *
+     * The original media the speech was recorded on.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @param value The originalMediaType to set. + * @return This builder for chaining. + */ + public Builder setOriginalMediaType(com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType value) { + if (value == null) { + throw new NullPointerException(); + } + + originalMediaType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The original media the speech was recorded on.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return This builder for chaining. + */ + public Builder clearOriginalMediaType() { + + originalMediaType_ = 0; + onChanged(); + return this; + } + + private int recordingDeviceType_ = 0; + /** + *
+     * The type of device the speech was recorded with.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return The enum numeric value on the wire for recordingDeviceType. + */ + @java.lang.Override public int getRecordingDeviceTypeValue() { + return recordingDeviceType_; + } + /** + *
+     * The type of device the speech was recorded with.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @param value The enum numeric value on the wire for recordingDeviceType to set. + * @return This builder for chaining. + */ + public Builder setRecordingDeviceTypeValue(int value) { + + recordingDeviceType_ = value; + onChanged(); + return this; + } + /** + *
+     * The type of device the speech was recorded with.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return The recordingDeviceType. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.valueOf(recordingDeviceType_); + return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.UNRECOGNIZED : result; + } + /** + *
+     * The type of device the speech was recorded with.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @param value The recordingDeviceType to set. + * @return This builder for chaining. + */ + public Builder setRecordingDeviceType(com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType value) { + if (value == null) { + throw new NullPointerException(); + } + + recordingDeviceType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The type of device the speech was recorded with.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return This builder for chaining. + */ + public Builder clearRecordingDeviceType() { + + recordingDeviceType_ = 0; + onChanged(); + return this; + } + + private java.lang.Object recordingDeviceName_ = ""; + /** + *
+     * The device used to make the recording.  Examples 'Nexus 5X' or
+     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+     * 'Cardioid Microphone'.
+     * 
+ * + * string recording_device_name = 7; + * @return The recordingDeviceName. + */ + public java.lang.String getRecordingDeviceName() { + java.lang.Object ref = recordingDeviceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + recordingDeviceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The device used to make the recording.  Examples 'Nexus 5X' or
+     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+     * 'Cardioid Microphone'.
+     * 
+ * + * string recording_device_name = 7; + * @return The bytes for recordingDeviceName. + */ + public com.google.protobuf.ByteString + getRecordingDeviceNameBytes() { + java.lang.Object ref = recordingDeviceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + recordingDeviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The device used to make the recording.  Examples 'Nexus 5X' or
+     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+     * 'Cardioid Microphone'.
+     * 
+ * + * string recording_device_name = 7; + * @param value The recordingDeviceName to set. + * @return This builder for chaining. + */ + public Builder setRecordingDeviceName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + recordingDeviceName_ = value; + onChanged(); + return this; + } + /** + *
+     * The device used to make the recording.  Examples 'Nexus 5X' or
+     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+     * 'Cardioid Microphone'.
+     * 
+ * + * string recording_device_name = 7; + * @return This builder for chaining. + */ + public Builder clearRecordingDeviceName() { + + recordingDeviceName_ = getDefaultInstance().getRecordingDeviceName(); + onChanged(); + return this; + } + /** + *
+     * The device used to make the recording.  Examples 'Nexus 5X' or
+     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+     * 'Cardioid Microphone'.
+     * 
+ * + * string recording_device_name = 7; + * @param value The bytes for recordingDeviceName to set. + * @return This builder for chaining. + */ + public Builder setRecordingDeviceNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + recordingDeviceName_ = value; + onChanged(); + return this; + } + + private java.lang.Object originalMimeType_ = ""; + /** + *
+     * Mime type of the original audio file.  For example `audio/m4a`,
+     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+     * A list of possible audio mime types is maintained at
+     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+     * 
+ * + * string original_mime_type = 8; + * @return The originalMimeType. + */ + public java.lang.String getOriginalMimeType() { + java.lang.Object ref = originalMimeType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + originalMimeType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Mime type of the original audio file.  For example `audio/m4a`,
+     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+     * A list of possible audio mime types is maintained at
+     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+     * 
+ * + * string original_mime_type = 8; + * @return The bytes for originalMimeType. + */ + public com.google.protobuf.ByteString + getOriginalMimeTypeBytes() { + java.lang.Object ref = originalMimeType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + originalMimeType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Mime type of the original audio file.  For example `audio/m4a`,
+     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+     * A list of possible audio mime types is maintained at
+     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+     * 
+ * + * string original_mime_type = 8; + * @param value The originalMimeType to set. + * @return This builder for chaining. + */ + public Builder setOriginalMimeType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + originalMimeType_ = value; + onChanged(); + return this; + } + /** + *
+     * Mime type of the original audio file.  For example `audio/m4a`,
+     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+     * A list of possible audio mime types is maintained at
+     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+     * 
+ * + * string original_mime_type = 8; + * @return This builder for chaining. + */ + public Builder clearOriginalMimeType() { + + originalMimeType_ = getDefaultInstance().getOriginalMimeType(); + onChanged(); + return this; + } + /** + *
+     * Mime type of the original audio file.  For example `audio/m4a`,
+     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+     * A list of possible audio mime types is maintained at
+     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+     * 
+ * + * string original_mime_type = 8; + * @param value The bytes for originalMimeType to set. + * @return This builder for chaining. + */ + public Builder setOriginalMimeTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + originalMimeType_ = value; + onChanged(); + return this; + } + + private long obfuscatedId_ ; + /** + *
+     * Obfuscated (privacy-protected) ID of the user, to identify number of
+     * unique users using the service.
+     * 
+ * + * int64 obfuscated_id = 9 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612 + * @return The obfuscatedId. + */ + @java.lang.Override + @java.lang.Deprecated public long getObfuscatedId() { + return obfuscatedId_; + } + /** + *
+     * Obfuscated (privacy-protected) ID of the user, to identify number of
+     * unique users using the service.
+     * 
+ * + * int64 obfuscated_id = 9 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612 + * @param value The obfuscatedId to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setObfuscatedId(long value) { + + obfuscatedId_ = value; + onChanged(); + return this; + } + /** + *
+     * Obfuscated (privacy-protected) ID of the user, to identify number of
+     * unique users using the service.
+     * 
+ * + * int64 obfuscated_id = 9 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearObfuscatedId() { + + obfuscatedId_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object audioTopic_ = ""; + /** + *
+     * Description of the content. Eg. "Recordings of federal supreme court
+     * hearings from 2012".
+     * 
+ * + * string audio_topic = 10; + * @return The audioTopic. + */ + public java.lang.String getAudioTopic() { + java.lang.Object ref = audioTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + audioTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Description of the content. Eg. "Recordings of federal supreme court
+     * hearings from 2012".
+     * 
+ * + * string audio_topic = 10; + * @return The bytes for audioTopic. + */ + public com.google.protobuf.ByteString + getAudioTopicBytes() { + java.lang.Object ref = audioTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + audioTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Description of the content. Eg. "Recordings of federal supreme court
+     * hearings from 2012".
+     * 
+ * + * string audio_topic = 10; + * @param value The audioTopic to set. + * @return This builder for chaining. + */ + public Builder setAudioTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + audioTopic_ = value; + onChanged(); + return this; + } + /** + *
+     * Description of the content. Eg. "Recordings of federal supreme court
+     * hearings from 2012".
+     * 
+ * + * string audio_topic = 10; + * @return This builder for chaining. + */ + public Builder clearAudioTopic() { + + audioTopic_ = getDefaultInstance().getAudioTopic(); + onChanged(); + return this; + } + /** + *
+     * Description of the content. Eg. "Recordings of federal supreme court
+     * hearings from 2012".
+     * 
+ * + * string audio_topic = 10; + * @param value The bytes for audioTopic to set. + * @return This builder for chaining. + */ + public Builder setAudioTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + audioTopic_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata) + private static final com.google.cloud.speech.v1p1beta1.RecognitionMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognitionMetadata(); + } + + public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecognitionMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecognitionMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java new file mode 100644 index 000000000000..64e8e2e34a38 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java @@ -0,0 +1,183 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +@java.lang.Deprecated public interface RecognitionMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognitionMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The use case most closely describing the audio content to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return The enum numeric value on the wire for interactionType. + */ + int getInteractionTypeValue(); + /** + *
+   * The use case most closely describing the audio content to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; + * @return The interactionType. + */ + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType getInteractionType(); + + /** + *
+   * The industry vertical to which this speech recognition request most
+   * closely applies. This is most indicative of the topics contained
+   * in the audio.  Use the 6-digit NAICS code to identify the industry
+   * vertical - see https://www.naics.com/search/.
+   * 
+ * + * uint32 industry_naics_code_of_audio = 3; + * @return The industryNaicsCodeOfAudio. + */ + int getIndustryNaicsCodeOfAudio(); + + /** + *
+   * The audio type that most closely describes the audio being recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return The enum numeric value on the wire for microphoneDistance. + */ + int getMicrophoneDistanceValue(); + /** + *
+   * The audio type that most closely describes the audio being recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; + * @return The microphoneDistance. + */ + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance(); + + /** + *
+   * The original media the speech was recorded on.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return The enum numeric value on the wire for originalMediaType. + */ + int getOriginalMediaTypeValue(); + /** + *
+   * The original media the speech was recorded on.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; + * @return The originalMediaType. + */ + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType getOriginalMediaType(); + + /** + *
+   * The type of device the speech was recorded with.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return The enum numeric value on the wire for recordingDeviceType. + */ + int getRecordingDeviceTypeValue(); + /** + *
+   * The type of device the speech was recorded with.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; + * @return The recordingDeviceType. + */ + com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType(); + + /** + *
+   * The device used to make the recording.  Examples 'Nexus 5X' or
+   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+   * 'Cardioid Microphone'.
+   * 
+ * + * string recording_device_name = 7; + * @return The recordingDeviceName. + */ + java.lang.String getRecordingDeviceName(); + /** + *
+   * The device used to make the recording.  Examples 'Nexus 5X' or
+   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
+   * 'Cardioid Microphone'.
+   * 
+ * + * string recording_device_name = 7; + * @return The bytes for recordingDeviceName. + */ + com.google.protobuf.ByteString + getRecordingDeviceNameBytes(); + + /** + *
+   * Mime type of the original audio file.  For example `audio/m4a`,
+   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+   * A list of possible audio mime types is maintained at
+   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+   * 
+ * + * string original_mime_type = 8; + * @return The originalMimeType. + */ + java.lang.String getOriginalMimeType(); + /** + *
+   * Mime type of the original audio file.  For example `audio/m4a`,
+   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
+   * A list of possible audio mime types is maintained at
+   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
+   * 
+ * + * string original_mime_type = 8; + * @return The bytes for originalMimeType. + */ + com.google.protobuf.ByteString + getOriginalMimeTypeBytes(); + + /** + *
+   * Obfuscated (privacy-protected) ID of the user, to identify number of
+   * unique users using the service.
+   * 
+ * + * int64 obfuscated_id = 9 [deprecated = true]; + * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612 + * @return The obfuscatedId. + */ + @java.lang.Deprecated long getObfuscatedId(); + + /** + *
+   * Description of the content. Eg. "Recordings of federal supreme court
+   * hearings from 2012".
+   * 
+ * + * string audio_topic = 10; + * @return The audioTopic. + */ + java.lang.String getAudioTopic(); + /** + *
+   * Description of the content. Eg. "Recordings of federal supreme court
+   * hearings from 2012".
+   * 
+ * + * string audio_topic = 10; + * @return The bytes for audioTopic. + */ + com.google.protobuf.ByteString + getAudioTopicBytes(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequest.java new file mode 100644 index 000000000000..b8acfd307170 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequest.java @@ -0,0 +1,913 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * The top-level message sent by the client for the `Recognize` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognizeRequest} + */ +public final class RecognizeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognizeRequest) + RecognizeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use RecognizeRequest.newBuilder() to construct. + private RecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RecognizeRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RecognizeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RecognizeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder subBuilder = null; + if (config_ != null) { + subBuilder = config_.toBuilder(); + } + config_ = input.readMessage(com.google.cloud.speech.v1p1beta1.RecognitionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(config_); + config_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder subBuilder = null; + if (audio_ != null) { + subBuilder = audio_.toBuilder(); + } + audio_ = input.readMessage(com.google.cloud.speech.v1p1beta1.RecognitionAudio.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(audio_); + audio_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.RecognizeRequest.class, com.google.cloud.speech.v1p1beta1.RecognizeRequest.Builder.class); + } + + public static final int CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return config_ != null; + } + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { + return config_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; + } + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { + return getConfig(); + } + + public static final int AUDIO_FIELD_NUMBER = 2; + private com.google.cloud.speech.v1p1beta1.RecognitionAudio audio_; + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the audio field is set. + */ + @java.lang.Override + public boolean hasAudio() { + return audio_ != null; + } + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The audio. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio() { + return audio_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() : audio_; + } + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { + return getAudio(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (config_ != null) { + output.writeMessage(1, getConfig()); + } + if (audio_ != null) { + output.writeMessage(2, getAudio()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (config_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getConfig()); + } + if (audio_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getAudio()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.RecognizeRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.RecognizeRequest other = (com.google.cloud.speech.v1p1beta1.RecognizeRequest) obj; + + if (hasConfig() != other.hasConfig()) return false; + if (hasConfig()) { + if (!getConfig() + .equals(other.getConfig())) return false; + } + if (hasAudio() != other.hasAudio()) return false; + if (hasAudio()) { + if (!getAudio() + .equals(other.getAudio())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + if (hasAudio()) { + hash = (37 * hash) + AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getAudio().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.RecognizeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The top-level message sent by the client for the `Recognize` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognizeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognizeRequest) + com.google.cloud.speech.v1p1beta1.RecognizeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.RecognizeRequest.class, com.google.cloud.speech.v1p1beta1.RecognizeRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.RecognizeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (configBuilder_ == null) { + config_ = null; + } else { + config_ = null; + configBuilder_ = null; + } + if (audioBuilder_ == null) { + audio_ = null; + } else { + audio_ = null; + audioBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognizeRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.RecognizeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognizeRequest build() { + com.google.cloud.speech.v1p1beta1.RecognizeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognizeRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.RecognizeRequest result = new com.google.cloud.speech.v1p1beta1.RecognizeRequest(this); + if (configBuilder_ == null) { + result.config_ = config_; + } else { + result.config_ = configBuilder_.build(); + } + if (audioBuilder_ == null) { + result.audio_ = audio_; + } else { + result.audio_ = audioBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.RecognizeRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognizeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognizeRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.RecognizeRequest.getDefaultInstance()) return this; + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + if (other.hasAudio()) { + mergeAudio(other.getAudio()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.RecognizeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.RecognizeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> configBuilder_; + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + public boolean hasConfig() { + return configBuilder_ != null || config_ != null; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { + if (configBuilder_ == null) { + return config_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig( + com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { + if (configBuilder_ == null) { + if (config_ != null) { + config_ = + com.google.cloud.speech.v1p1beta1.RecognitionConfig.newBuilder(config_).mergeFrom(value).buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + configBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + config_ = null; + onChanged(); + } else { + config_ = null; + configBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder getConfigBuilder() { + + onChanged(); + return getConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null ? + com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; + } + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder>( + getConfig(), + getParentForChildren(), + isClean()); + config_ = null; + } + return configBuilder_; + } + + private com.google.cloud.speech.v1p1beta1.RecognitionAudio audio_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionAudio, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder> audioBuilder_; + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the audio field is set. + */ + public boolean hasAudio() { + return audioBuilder_ != null || audio_ != null; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The audio. + */ + public com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio() { + if (audioBuilder_ == null) { + return audio_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() : audio_; + } else { + return audioBuilder_.getMessage(); + } + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setAudio(com.google.cloud.speech.v1p1beta1.RecognitionAudio value) { + if (audioBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + audio_ = value; + onChanged(); + } else { + audioBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setAudio( + com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder builderForValue) { + if (audioBuilder_ == null) { + audio_ = builderForValue.build(); + onChanged(); + } else { + audioBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeAudio(com.google.cloud.speech.v1p1beta1.RecognitionAudio value) { + if (audioBuilder_ == null) { + if (audio_ != null) { + audio_ = + com.google.cloud.speech.v1p1beta1.RecognitionAudio.newBuilder(audio_).mergeFrom(value).buildPartial(); + } else { + audio_ = value; + } + onChanged(); + } else { + audioBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearAudio() { + if (audioBuilder_ == null) { + audio_ = null; + onChanged(); + } else { + audio_ = null; + audioBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder getAudioBuilder() { + + onChanged(); + return getAudioFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { + if (audioBuilder_ != null) { + return audioBuilder_.getMessageOrBuilder(); + } else { + return audio_ == null ? + com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() : audio_; + } + } + /** + *
+     * Required. The audio data to be recognized.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionAudio, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder> + getAudioFieldBuilder() { + if (audioBuilder_ == null) { + audioBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionAudio, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder>( + getAudio(), + getParentForChildren(), + isClean()); + audio_ = null; + } + return audioBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.RecognizeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognizeRequest) + private static final com.google.cloud.speech.v1p1beta1.RecognizeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognizeRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.RecognizeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecognizeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecognizeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognizeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequestOrBuilder.java new file mode 100644 index 000000000000..2e594dfddc8f --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequestOrBuilder.java @@ -0,0 +1,66 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface RecognizeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognizeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + boolean hasConfig(); + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig(); + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder(); + + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the audio field is set. + */ + boolean hasAudio(); + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return The audio. + */ + com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio(); + /** + *
+   * Required. The audio data to be recognized.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java new file mode 100644 index 000000000000..fe9f8b28c09e --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java @@ -0,0 +1,1135 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * The only message returned to the client by the `Recognize` method. It
+ * contains the result as zero or more sequential `SpeechRecognitionResult`
+ * messages.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognizeResponse} + */ +public final class RecognizeResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognizeResponse) + RecognizeResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use RecognizeResponse.newBuilder() to construct. + private RecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RecognizeResponse() { + results_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RecognizeResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RecognizeResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + results_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.parser(), extensionRegistry)); + break; + } + case 26: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (totalBilledTime_ != null) { + subBuilder = totalBilledTime_.toBuilder(); + } + totalBilledTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(totalBilledTime_); + totalBilledTime_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.RecognizeResponse.class, com.google.cloud.speech.v1p1beta1.RecognizeResponse.Builder.class); + } + + public static final int RESULTS_FIELD_NUMBER = 2; + private java.util.List results_; + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public java.util.List getResultsList() { + return results_; + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public java.util.List + getResultsOrBuilderList() { + return results_; + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index) { + return results_.get(index); + } + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( + int index) { + return results_.get(index); + } + + public static final int TOTAL_BILLED_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Duration totalBilledTime_; + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return Whether the totalBilledTime field is set. + */ + @java.lang.Override + public boolean hasTotalBilledTime() { + return totalBilledTime_ != null; + } + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return The totalBilledTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getTotalBilledTime() { + return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { + return getTotalBilledTime(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(2, results_.get(i)); + } + if (totalBilledTime_ != null) { + output.writeMessage(3, getTotalBilledTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, results_.get(i)); + } + if (totalBilledTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getTotalBilledTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.RecognizeResponse)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.RecognizeResponse other = (com.google.cloud.speech.v1p1beta1.RecognizeResponse) obj; + + if (!getResultsList() + .equals(other.getResultsList())) return false; + if (hasTotalBilledTime() != other.hasTotalBilledTime()) return false; + if (hasTotalBilledTime()) { + if (!getTotalBilledTime() + .equals(other.getTotalBilledTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + if (hasTotalBilledTime()) { + hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; + hash = (53 * hash) + getTotalBilledTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.RecognizeResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The only message returned to the client by the `Recognize` method. It
+   * contains the result as zero or more sequential `SpeechRecognitionResult`
+   * messages.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognizeResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognizeResponse) + com.google.cloud.speech.v1p1beta1.RecognizeResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.RecognizeResponse.class, com.google.cloud.speech.v1p1beta1.RecognizeResponse.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.RecognizeResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resultsBuilder_.clear(); + } + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = null; + } else { + totalBilledTime_ = null; + totalBilledTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognizeResponse getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.RecognizeResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognizeResponse build() { + com.google.cloud.speech.v1p1beta1.RecognizeResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognizeResponse buildPartial() { + com.google.cloud.speech.v1p1beta1.RecognizeResponse result = new com.google.cloud.speech.v1p1beta1.RecognizeResponse(this); + int from_bitField0_ = bitField0_; + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + if (totalBilledTimeBuilder_ == null) { + result.totalBilledTime_ = totalBilledTime_; + } else { + result.totalBilledTime_ = totalBilledTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.RecognizeResponse) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognizeResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognizeResponse other) { + if (other == com.google.cloud.speech.v1p1beta1.RecognizeResponse.getDefaultInstance()) return this; + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResultsFieldBuilder() : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (other.hasTotalBilledTime()) { + mergeTotalBilledTime(other.getTotalBilledTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.RecognizeResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.RecognizeResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List results_ = + java.util.Collections.emptyList(); + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> resultsBuilder_; + + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public java.util.List getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder setResults( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder setResults( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder addResults(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder addResults( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder addResults( + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder addResults( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder addAllResults( + java.lang.Iterable values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( + int index) { + if (resultsBuilder_ == null) { + return results_.get(index); } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public java.util.List + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResultsBuilder() { + return getResultsFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()); + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()); + } + /** + *
+     * Sequential list of transcription results corresponding to
+     * sequential portions of audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder>( + results_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private com.google.protobuf.Duration totalBilledTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalBilledTimeBuilder_; + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return Whether the totalBilledTime field is set. + */ + public boolean hasTotalBilledTime() { + return totalBilledTimeBuilder_ != null || totalBilledTime_ != null; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return The totalBilledTime. + */ + public com.google.protobuf.Duration getTotalBilledTime() { + if (totalBilledTimeBuilder_ == null) { + return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } else { + return totalBilledTimeBuilder_.getMessage(); + } + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder setTotalBilledTime(com.google.protobuf.Duration value) { + if (totalBilledTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + totalBilledTime_ = value; + onChanged(); + } else { + totalBilledTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder setTotalBilledTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = builderForValue.build(); + onChanged(); + } else { + totalBilledTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder mergeTotalBilledTime(com.google.protobuf.Duration value) { + if (totalBilledTimeBuilder_ == null) { + if (totalBilledTime_ != null) { + totalBilledTime_ = + com.google.protobuf.Duration.newBuilder(totalBilledTime_).mergeFrom(value).buildPartial(); + } else { + totalBilledTime_ = value; + } + onChanged(); + } else { + totalBilledTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public Builder clearTotalBilledTime() { + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = null; + onChanged(); + } else { + totalBilledTime_ = null; + totalBilledTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public com.google.protobuf.Duration.Builder getTotalBilledTimeBuilder() { + + onChanged(); + return getTotalBilledTimeFieldBuilder().getBuilder(); + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { + if (totalBilledTimeBuilder_ != null) { + return totalBilledTimeBuilder_.getMessageOrBuilder(); + } else { + return totalBilledTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } + } + /** + *
+     * When available, billed audio seconds for the corresponding request.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getTotalBilledTimeFieldBuilder() { + if (totalBilledTimeBuilder_ == null) { + totalBilledTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getTotalBilledTime(), + getParentForChildren(), + isClean()); + totalBilledTime_ = null; + } + return totalBilledTimeBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.RecognizeResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognizeResponse) + private static final com.google.cloud.speech.v1p1beta1.RecognizeResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognizeResponse(); + } + + public static com.google.cloud.speech.v1p1beta1.RecognizeResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RecognizeResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RecognizeResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognizeResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java new file mode 100644 index 000000000000..d558c9d50911 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface RecognizeResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognizeResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + java.util.List + getResultsList(); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + int getResultsCount(); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + java.util.List + getResultsOrBuilderList(); + /** + *
+   * Sequential list of transcription results corresponding to
+   * sequential portions of audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; + */ + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( + int index); + + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return Whether the totalBilledTime field is set. + */ + boolean hasTotalBilledTime(); + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + * @return The totalBilledTime. + */ + com.google.protobuf.Duration getTotalBilledTime(); + /** + *
+   * When available, billed audio seconds for the corresponding request.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 3; + */ + com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java new file mode 100644 index 000000000000..936d082585e2 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java @@ -0,0 +1,782 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Config to enable speaker diarization.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} + */ +public final class SpeakerDiarizationConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) + SpeakerDiarizationConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use SpeakerDiarizationConfig.newBuilder() to construct. + private SpeakerDiarizationConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SpeakerDiarizationConfig() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SpeakerDiarizationConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SpeakerDiarizationConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + enableSpeakerDiarization_ = input.readBool(); + break; + } + case 16: { + + minSpeakerCount_ = input.readInt32(); + break; + } + case 24: { + + maxSpeakerCount_ = input.readInt32(); + break; + } + case 40: { + + speakerTag_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.class, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder.class); + } + + public static final int ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER = 1; + private boolean enableSpeakerDiarization_; + /** + *
+   * If 'true', enables speaker detection for each recognized word in
+   * the top alternative of the recognition result using a speaker_tag provided
+   * in the WordInfo.
+   * 
+ * + * bool enable_speaker_diarization = 1; + * @return The enableSpeakerDiarization. + */ + @java.lang.Override + public boolean getEnableSpeakerDiarization() { + return enableSpeakerDiarization_; + } + + public static final int MIN_SPEAKER_COUNT_FIELD_NUMBER = 2; + private int minSpeakerCount_; + /** + *
+   * Minimum number of speakers in the conversation. This range gives you more
+   * flexibility by allowing the system to automatically determine the correct
+   * number of speakers. If not set, the default value is 2.
+   * 
+ * + * int32 min_speaker_count = 2; + * @return The minSpeakerCount. + */ + @java.lang.Override + public int getMinSpeakerCount() { + return minSpeakerCount_; + } + + public static final int MAX_SPEAKER_COUNT_FIELD_NUMBER = 3; + private int maxSpeakerCount_; + /** + *
+   * Maximum number of speakers in the conversation. This range gives you more
+   * flexibility by allowing the system to automatically determine the correct
+   * number of speakers. If not set, the default value is 6.
+   * 
+ * + * int32 max_speaker_count = 3; + * @return The maxSpeakerCount. + */ + @java.lang.Override + public int getMaxSpeakerCount() { + return maxSpeakerCount_; + } + + public static final int SPEAKER_TAG_FIELD_NUMBER = 5; + private int speakerTag_; + /** + *
+   * Output only. Unused.
+   * 
+ * + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 + * @return The speakerTag. + */ + @java.lang.Override + @java.lang.Deprecated public int getSpeakerTag() { + return speakerTag_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (enableSpeakerDiarization_ != false) { + output.writeBool(1, enableSpeakerDiarization_); + } + if (minSpeakerCount_ != 0) { + output.writeInt32(2, minSpeakerCount_); + } + if (maxSpeakerCount_ != 0) { + output.writeInt32(3, maxSpeakerCount_); + } + if (speakerTag_ != 0) { + output.writeInt32(5, speakerTag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (enableSpeakerDiarization_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, enableSpeakerDiarization_); + } + if (minSpeakerCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, minSpeakerCount_); + } + if (maxSpeakerCount_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, maxSpeakerCount_); + } + if (speakerTag_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, speakerTag_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig other = (com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) obj; + + if (getEnableSpeakerDiarization() + != other.getEnableSpeakerDiarization()) return false; + if (getMinSpeakerCount() + != other.getMinSpeakerCount()) return false; + if (getMaxSpeakerCount() + != other.getMaxSpeakerCount()) return false; + if (getSpeakerTag() + != other.getSpeakerTag()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnableSpeakerDiarization()); + hash = (37 * hash) + MIN_SPEAKER_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinSpeakerCount(); + hash = (37 * hash) + MAX_SPEAKER_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxSpeakerCount(); + hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; + hash = (53 * hash) + getSpeakerTag(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Config to enable speaker diarization.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.class, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + enableSpeakerDiarization_ = false; + + minSpeakerCount_ = 0; + + maxSpeakerCount_ = 0; + + speakerTag_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig build() { + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig buildPartial() { + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig result = new com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig(this); + result.enableSpeakerDiarization_ = enableSpeakerDiarization_; + result.minSpeakerCount_ = minSpeakerCount_; + result.maxSpeakerCount_ = maxSpeakerCount_; + result.speakerTag_ = speakerTag_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig other) { + if (other == com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance()) return this; + if (other.getEnableSpeakerDiarization() != false) { + setEnableSpeakerDiarization(other.getEnableSpeakerDiarization()); + } + if (other.getMinSpeakerCount() != 0) { + setMinSpeakerCount(other.getMinSpeakerCount()); + } + if (other.getMaxSpeakerCount() != 0) { + setMaxSpeakerCount(other.getMaxSpeakerCount()); + } + if (other.getSpeakerTag() != 0) { + setSpeakerTag(other.getSpeakerTag()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean enableSpeakerDiarization_ ; + /** + *
+     * If 'true', enables speaker detection for each recognized word in
+     * the top alternative of the recognition result using a speaker_tag provided
+     * in the WordInfo.
+     * 
+ * + * bool enable_speaker_diarization = 1; + * @return The enableSpeakerDiarization. + */ + @java.lang.Override + public boolean getEnableSpeakerDiarization() { + return enableSpeakerDiarization_; + } + /** + *
+     * If 'true', enables speaker detection for each recognized word in
+     * the top alternative of the recognition result using a speaker_tag provided
+     * in the WordInfo.
+     * 
+ * + * bool enable_speaker_diarization = 1; + * @param value The enableSpeakerDiarization to set. + * @return This builder for chaining. + */ + public Builder setEnableSpeakerDiarization(boolean value) { + + enableSpeakerDiarization_ = value; + onChanged(); + return this; + } + /** + *
+     * If 'true', enables speaker detection for each recognized word in
+     * the top alternative of the recognition result using a speaker_tag provided
+     * in the WordInfo.
+     * 
+ * + * bool enable_speaker_diarization = 1; + * @return This builder for chaining. + */ + public Builder clearEnableSpeakerDiarization() { + + enableSpeakerDiarization_ = false; + onChanged(); + return this; + } + + private int minSpeakerCount_ ; + /** + *
+     * Minimum number of speakers in the conversation. This range gives you more
+     * flexibility by allowing the system to automatically determine the correct
+     * number of speakers. If not set, the default value is 2.
+     * 
+ * + * int32 min_speaker_count = 2; + * @return The minSpeakerCount. + */ + @java.lang.Override + public int getMinSpeakerCount() { + return minSpeakerCount_; + } + /** + *
+     * Minimum number of speakers in the conversation. This range gives you more
+     * flexibility by allowing the system to automatically determine the correct
+     * number of speakers. If not set, the default value is 2.
+     * 
+ * + * int32 min_speaker_count = 2; + * @param value The minSpeakerCount to set. + * @return This builder for chaining. + */ + public Builder setMinSpeakerCount(int value) { + + minSpeakerCount_ = value; + onChanged(); + return this; + } + /** + *
+     * Minimum number of speakers in the conversation. This range gives you more
+     * flexibility by allowing the system to automatically determine the correct
+     * number of speakers. If not set, the default value is 2.
+     * 
+ * + * int32 min_speaker_count = 2; + * @return This builder for chaining. + */ + public Builder clearMinSpeakerCount() { + + minSpeakerCount_ = 0; + onChanged(); + return this; + } + + private int maxSpeakerCount_ ; + /** + *
+     * Maximum number of speakers in the conversation. This range gives you more
+     * flexibility by allowing the system to automatically determine the correct
+     * number of speakers. If not set, the default value is 6.
+     * 
+ * + * int32 max_speaker_count = 3; + * @return The maxSpeakerCount. + */ + @java.lang.Override + public int getMaxSpeakerCount() { + return maxSpeakerCount_; + } + /** + *
+     * Maximum number of speakers in the conversation. This range gives you more
+     * flexibility by allowing the system to automatically determine the correct
+     * number of speakers. If not set, the default value is 6.
+     * 
+ * + * int32 max_speaker_count = 3; + * @param value The maxSpeakerCount to set. + * @return This builder for chaining. + */ + public Builder setMaxSpeakerCount(int value) { + + maxSpeakerCount_ = value; + onChanged(); + return this; + } + /** + *
+     * Maximum number of speakers in the conversation. This range gives you more
+     * flexibility by allowing the system to automatically determine the correct
+     * number of speakers. If not set, the default value is 6.
+     * 
+ * + * int32 max_speaker_count = 3; + * @return This builder for chaining. + */ + public Builder clearMaxSpeakerCount() { + + maxSpeakerCount_ = 0; + onChanged(); + return this; + } + + private int speakerTag_ ; + /** + *
+     * Output only. Unused.
+     * 
+ * + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 + * @return The speakerTag. + */ + @java.lang.Override + @java.lang.Deprecated public int getSpeakerTag() { + return speakerTag_; + } + /** + *
+     * Output only. Unused.
+     * 
+ * + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 + * @param value The speakerTag to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setSpeakerTag(int value) { + + speakerTag_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. Unused.
+     * 
+ * + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearSpeakerTag() { + + speakerTag_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) + private static final com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig(); + } + + public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeakerDiarizationConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SpeakerDiarizationConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java new file mode 100644 index 000000000000..bc23982ea934 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java @@ -0,0 +1,57 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface SpeakerDiarizationConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * If 'true', enables speaker detection for each recognized word in
+   * the top alternative of the recognition result using a speaker_tag provided
+   * in the WordInfo.
+   * 
+ * + * bool enable_speaker_diarization = 1; + * @return The enableSpeakerDiarization. + */ + boolean getEnableSpeakerDiarization(); + + /** + *
+   * Minimum number of speakers in the conversation. This range gives you more
+   * flexibility by allowing the system to automatically determine the correct
+   * number of speakers. If not set, the default value is 2.
+   * 
+ * + * int32 min_speaker_count = 2; + * @return The minSpeakerCount. + */ + int getMinSpeakerCount(); + + /** + *
+   * Maximum number of speakers in the conversation. This range gives you more
+   * flexibility by allowing the system to automatically determine the correct
+   * number of speakers. If not set, the default value is 6.
+   * 
+ * + * int32 max_speaker_count = 3; + * @return The maxSpeakerCount. + */ + int getMaxSpeakerCount(); + + /** + *
+   * Output only. Unused.
+   * 
+ * + * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. + * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 + * @return The speakerTag. + */ + @java.lang.Deprecated int getSpeakerTag(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java new file mode 100644 index 000000000000..020d93047180 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java @@ -0,0 +1,1671 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/resource.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Speech adaptation configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechAdaptation} + */ +public final class SpeechAdaptation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechAdaptation) + SpeechAdaptationOrBuilder { +private static final long serialVersionUID = 0L; + // Use SpeechAdaptation.newBuilder() to construct. + private SpeechAdaptation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SpeechAdaptation() { + phraseSets_ = java.util.Collections.emptyList(); + phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; + customClasses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SpeechAdaptation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SpeechAdaptation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + phraseSets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + phraseSets_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.PhraseSet.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + phraseSetReferences_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + phraseSetReferences_.add(s); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + customClasses_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + customClasses_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.CustomClass.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + phraseSetReferences_ = phraseSetReferences_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + customClasses_ = java.util.Collections.unmodifiableList(customClasses_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.SpeechAdaptation.class, com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder.class); + } + + public static final int PHRASE_SETS_FIELD_NUMBER = 1; + private java.util.List phraseSets_; + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public java.util.List getPhraseSetsList() { + return phraseSets_; + } + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public java.util.List + getPhraseSetsOrBuilderList() { + return phraseSets_; + } + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public int getPhraseSetsCount() { + return phraseSets_.size(); + } + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index) { + return phraseSets_.get(index); + } + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder( + int index) { + return phraseSets_.get(index); + } + + public static final int PHRASE_SET_REFERENCES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList phraseSetReferences_; + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return A list containing the phraseSetReferences. + */ + public com.google.protobuf.ProtocolStringList + getPhraseSetReferencesList() { + return phraseSetReferences_; + } + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return The count of phraseSetReferences. + */ + public int getPhraseSetReferencesCount() { + return phraseSetReferences_.size(); + } + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index of the element to return. + * @return The phraseSetReferences at the given index. + */ + public java.lang.String getPhraseSetReferences(int index) { + return phraseSetReferences_.get(index); + } + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index of the value to return. + * @return The bytes of the phraseSetReferences at the given index. + */ + public com.google.protobuf.ByteString + getPhraseSetReferencesBytes(int index) { + return phraseSetReferences_.getByteString(index); + } + + public static final int CUSTOM_CLASSES_FIELD_NUMBER = 3; + private java.util.List customClasses_; + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + @java.lang.Override + public java.util.List getCustomClassesList() { + return customClasses_; + } + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + @java.lang.Override + public java.util.List + getCustomClassesOrBuilderList() { + return customClasses_; + } + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + @java.lang.Override + public int getCustomClassesCount() { + return customClasses_.size(); + } + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { + return customClasses_.get(index); + } + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index) { + return customClasses_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < phraseSets_.size(); i++) { + output.writeMessage(1, phraseSets_.get(i)); + } + for (int i = 0; i < phraseSetReferences_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, phraseSetReferences_.getRaw(i)); + } + for (int i = 0; i < customClasses_.size(); i++) { + output.writeMessage(3, customClasses_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < phraseSets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, phraseSets_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < phraseSetReferences_.size(); i++) { + dataSize += computeStringSizeNoTag(phraseSetReferences_.getRaw(i)); + } + size += dataSize; + size += 1 * getPhraseSetReferencesList().size(); + } + for (int i = 0; i < customClasses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, customClasses_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.SpeechAdaptation)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.SpeechAdaptation other = (com.google.cloud.speech.v1p1beta1.SpeechAdaptation) obj; + + if (!getPhraseSetsList() + .equals(other.getPhraseSetsList())) return false; + if (!getPhraseSetReferencesList() + .equals(other.getPhraseSetReferencesList())) return false; + if (!getCustomClassesList() + .equals(other.getCustomClassesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPhraseSetsCount() > 0) { + hash = (37 * hash) + PHRASE_SETS_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSetsList().hashCode(); + } + if (getPhraseSetReferencesCount() > 0) { + hash = (37 * hash) + PHRASE_SET_REFERENCES_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSetReferencesList().hashCode(); + } + if (getCustomClassesCount() > 0) { + hash = (37 * hash) + CUSTOM_CLASSES_FIELD_NUMBER; + hash = (53 * hash) + getCustomClassesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.SpeechAdaptation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Speech adaptation configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechAdaptation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechAdaptation) + com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.SpeechAdaptation.class, com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.SpeechAdaptation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPhraseSetsFieldBuilder(); + getCustomClassesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (phraseSetsBuilder_ == null) { + phraseSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + phraseSetsBuilder_.clear(); + } + phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + if (customClassesBuilder_ == null) { + customClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + customClassesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptation getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptation build() { + com.google.cloud.speech.v1p1beta1.SpeechAdaptation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptation buildPartial() { + com.google.cloud.speech.v1p1beta1.SpeechAdaptation result = new com.google.cloud.speech.v1p1beta1.SpeechAdaptation(this); + int from_bitField0_ = bitField0_; + if (phraseSetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.phraseSets_ = phraseSets_; + } else { + result.phraseSets_ = phraseSetsBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + phraseSetReferences_ = phraseSetReferences_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.phraseSetReferences_ = phraseSetReferences_; + if (customClassesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + customClasses_ = java.util.Collections.unmodifiableList(customClasses_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.customClasses_ = customClasses_; + } else { + result.customClasses_ = customClassesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.SpeechAdaptation) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechAdaptation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechAdaptation other) { + if (other == com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance()) return this; + if (phraseSetsBuilder_ == null) { + if (!other.phraseSets_.isEmpty()) { + if (phraseSets_.isEmpty()) { + phraseSets_ = other.phraseSets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePhraseSetsIsMutable(); + phraseSets_.addAll(other.phraseSets_); + } + onChanged(); + } + } else { + if (!other.phraseSets_.isEmpty()) { + if (phraseSetsBuilder_.isEmpty()) { + phraseSetsBuilder_.dispose(); + phraseSetsBuilder_ = null; + phraseSets_ = other.phraseSets_; + bitField0_ = (bitField0_ & ~0x00000001); + phraseSetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPhraseSetsFieldBuilder() : null; + } else { + phraseSetsBuilder_.addAllMessages(other.phraseSets_); + } + } + } + if (!other.phraseSetReferences_.isEmpty()) { + if (phraseSetReferences_.isEmpty()) { + phraseSetReferences_ = other.phraseSetReferences_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensurePhraseSetReferencesIsMutable(); + phraseSetReferences_.addAll(other.phraseSetReferences_); + } + onChanged(); + } + if (customClassesBuilder_ == null) { + if (!other.customClasses_.isEmpty()) { + if (customClasses_.isEmpty()) { + customClasses_ = other.customClasses_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureCustomClassesIsMutable(); + customClasses_.addAll(other.customClasses_); + } + onChanged(); + } + } else { + if (!other.customClasses_.isEmpty()) { + if (customClassesBuilder_.isEmpty()) { + customClassesBuilder_.dispose(); + customClassesBuilder_ = null; + customClasses_ = other.customClasses_; + bitField0_ = (bitField0_ & ~0x00000004); + customClassesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getCustomClassesFieldBuilder() : null; + } else { + customClassesBuilder_.addAllMessages(other.customClasses_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.SpeechAdaptation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.SpeechAdaptation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List phraseSets_ = + java.util.Collections.emptyList(); + private void ensurePhraseSetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + phraseSets_ = new java.util.ArrayList(phraseSets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> phraseSetsBuilder_; + + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public java.util.List getPhraseSetsList() { + if (phraseSetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(phraseSets_); + } else { + return phraseSetsBuilder_.getMessageList(); + } + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public int getPhraseSetsCount() { + if (phraseSetsBuilder_ == null) { + return phraseSets_.size(); + } else { + return phraseSetsBuilder_.getCount(); + } + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index) { + if (phraseSetsBuilder_ == null) { + return phraseSets_.get(index); + } else { + return phraseSetsBuilder_.getMessage(index); + } + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder setPhraseSets( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.set(index, value); + onChanged(); + } else { + phraseSetsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder setPhraseSets( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.set(index, builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets(com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.add(value); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetsIsMutable(); + phraseSets_.add(index, value); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.add(builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addPhraseSets( + int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.add(index, builderForValue.build()); + onChanged(); + } else { + phraseSetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder addAllPhraseSets( + java.lang.Iterable values) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, phraseSets_); + onChanged(); + } else { + phraseSetsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder clearPhraseSets() { + if (phraseSetsBuilder_ == null) { + phraseSets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + phraseSetsBuilder_.clear(); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public Builder removePhraseSets(int index) { + if (phraseSetsBuilder_ == null) { + ensurePhraseSetsIsMutable(); + phraseSets_.remove(index); + onChanged(); + } else { + phraseSetsBuilder_.remove(index); + } + return this; + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder getPhraseSetsBuilder( + int index) { + return getPhraseSetsFieldBuilder().getBuilder(index); + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder( + int index) { + if (phraseSetsBuilder_ == null) { + return phraseSets_.get(index); } else { + return phraseSetsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public java.util.List + getPhraseSetsOrBuilderList() { + if (phraseSetsBuilder_ != null) { + return phraseSetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(phraseSets_); + } + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder() { + return getPhraseSetsFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()); + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder( + int index) { + return getPhraseSetsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()); + } + /** + *
+     * A collection of phrase sets. To specify the hints inline, leave the
+     * phrase set's `name` blank and fill in the rest of its fields. Any
+     * phrase set can use any custom class.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + public java.util.List + getPhraseSetsBuilderList() { + return getPhraseSetsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> + getPhraseSetsFieldBuilder() { + if (phraseSetsBuilder_ == null) { + phraseSetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder>( + phraseSets_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + phraseSets_ = null; + } + return phraseSetsBuilder_; + } + + private com.google.protobuf.LazyStringList phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensurePhraseSetReferencesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + phraseSetReferences_ = new com.google.protobuf.LazyStringArrayList(phraseSetReferences_); + bitField0_ |= 0x00000002; + } + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return A list containing the phraseSetReferences. + */ + public com.google.protobuf.ProtocolStringList + getPhraseSetReferencesList() { + return phraseSetReferences_.getUnmodifiableView(); + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return The count of phraseSetReferences. + */ + public int getPhraseSetReferencesCount() { + return phraseSetReferences_.size(); + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index of the element to return. + * @return The phraseSetReferences at the given index. + */ + public java.lang.String getPhraseSetReferences(int index) { + return phraseSetReferences_.get(index); + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index of the value to return. + * @return The bytes of the phraseSetReferences at the given index. + */ + public com.google.protobuf.ByteString + getPhraseSetReferencesBytes(int index) { + return phraseSetReferences_.getByteString(index); + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index to set the value at. + * @param value The phraseSetReferences to set. + * @return This builder for chaining. + */ + public Builder setPhraseSetReferences( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetReferencesIsMutable(); + phraseSetReferences_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param value The phraseSetReferences to add. + * @return This builder for chaining. + */ + public Builder addPhraseSetReferences( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhraseSetReferencesIsMutable(); + phraseSetReferences_.add(value); + onChanged(); + return this; + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param values The phraseSetReferences to add. + * @return This builder for chaining. + */ + public Builder addAllPhraseSetReferences( + java.lang.Iterable values) { + ensurePhraseSetReferencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, phraseSetReferences_); + onChanged(); + return this; + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return This builder for chaining. + */ + public Builder clearPhraseSetReferences() { + phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * A collection of phrase set resource names to use.
+     * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param value The bytes of the phraseSetReferences to add. + * @return This builder for chaining. + */ + public Builder addPhraseSetReferencesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePhraseSetReferencesIsMutable(); + phraseSetReferences_.add(value); + onChanged(); + return this; + } + + private java.util.List customClasses_ = + java.util.Collections.emptyList(); + private void ensureCustomClassesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + customClasses_ = new java.util.ArrayList(customClasses_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> customClassesBuilder_; + + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public java.util.List getCustomClassesList() { + if (customClassesBuilder_ == null) { + return java.util.Collections.unmodifiableList(customClasses_); + } else { + return customClassesBuilder_.getMessageList(); + } + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public int getCustomClassesCount() { + if (customClassesBuilder_ == null) { + return customClasses_.size(); + } else { + return customClassesBuilder_.getCount(); + } + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { + if (customClassesBuilder_ == null) { + return customClasses_.get(index); + } else { + return customClassesBuilder_.getMessage(index); + } + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public Builder setCustomClasses( + int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.set(index, value); + onChanged(); + } else { + customClassesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public Builder setCustomClasses( + int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.set(index, builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public Builder addCustomClasses(com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.add(value); + onChanged(); + } else { + customClassesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public Builder addCustomClasses( + int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCustomClassesIsMutable(); + customClasses_.add(index, value); + onChanged(); + } else { + customClassesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public Builder addCustomClasses( + com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.add(builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public Builder addCustomClasses( + int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.add(index, builderForValue.build()); + onChanged(); + } else { + customClassesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public Builder addAllCustomClasses( + java.lang.Iterable values) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, customClasses_); + onChanged(); + } else { + customClassesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public Builder clearCustomClasses() { + if (customClassesBuilder_ == null) { + customClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + customClassesBuilder_.clear(); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public Builder removeCustomClasses(int index) { + if (customClassesBuilder_ == null) { + ensureCustomClassesIsMutable(); + customClasses_.remove(index); + onChanged(); + } else { + customClassesBuilder_.remove(index); + } + return this; + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassesBuilder( + int index) { + return getCustomClassesFieldBuilder().getBuilder(index); + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index) { + if (customClassesBuilder_ == null) { + return customClasses_.get(index); } else { + return customClassesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public java.util.List + getCustomClassesOrBuilderList() { + if (customClassesBuilder_ != null) { + return customClassesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(customClasses_); + } + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder() { + return getCustomClassesFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()); + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder( + int index) { + return getCustomClassesFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()); + } + /** + *
+     * A collection of custom classes. To specify the classes inline, leave the
+     * class' `name` blank and fill in the rest of its fields, giving it a unique
+     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+     * `custom_class_id`.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + public java.util.List + getCustomClassesBuilderList() { + return getCustomClassesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> + getCustomClassesFieldBuilder() { + if (customClassesBuilder_ == null) { + customClassesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( + customClasses_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + customClasses_ = null; + } + return customClassesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.SpeechAdaptation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechAdaptation) + private static final com.google.cloud.speech.v1p1beta1.SpeechAdaptation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechAdaptation(); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeechAdaptation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SpeechAdaptation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechAdaptation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java new file mode 100644 index 000000000000..64b0f0cb1359 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java @@ -0,0 +1,163 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/resource.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface SpeechAdaptationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechAdaptation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + java.util.List + getPhraseSetsList(); + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index); + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + int getPhraseSetsCount(); + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + java.util.List + getPhraseSetsOrBuilderList(); + /** + *
+   * A collection of phrase sets. To specify the hints inline, leave the
+   * phrase set's `name` blank and fill in the rest of its fields. Any
+   * phrase set can use any custom class.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; + */ + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder( + int index); + + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return A list containing the phraseSetReferences. + */ + java.util.List + getPhraseSetReferencesList(); + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @return The count of phraseSetReferences. + */ + int getPhraseSetReferencesCount(); + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index of the element to return. + * @return The phraseSetReferences at the given index. + */ + java.lang.String getPhraseSetReferences(int index); + /** + *
+   * A collection of phrase set resource names to use.
+   * 
+ * + * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } + * @param index The index of the value to return. + * @return The bytes of the phraseSetReferences at the given index. + */ + com.google.protobuf.ByteString + getPhraseSetReferencesBytes(int index); + + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + java.util.List + getCustomClassesList(); + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index); + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + int getCustomClassesCount(); + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + java.util.List + getCustomClassesOrBuilderList(); + /** + *
+   * A collection of custom classes. To specify the classes inline, leave the
+   * class' `name` blank and fill in the rest of its fields, giving it a unique
+   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
+   * `custom_class_id`.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; + */ + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( + int index); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java new file mode 100644 index 000000000000..0322b2c20ba1 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java @@ -0,0 +1,292 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public final class SpeechAdaptationProto { + private SpeechAdaptationProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n;google/cloud/speech/v1p1beta1/cloud_sp" + + "eech_adaptation.proto\022\035google.cloud.spee" + + "ch.v1p1beta1\032\034google/api/annotations.pro" + + "to\032\027google/api/client.proto\032\037google/api/" + + "field_behavior.proto\032\031google/api/resourc" + + "e.proto\032,google/cloud/speech/v1p1beta1/r" + + "esource.proto\032\033google/protobuf/empty.pro" + + "to\032 google/protobuf/field_mask.proto\"\260\001\n" + + "\026CreatePhraseSetRequest\0227\n\006parent\030\001 \001(\tB" + + "\'\340A\002\372A!\022\037speech.googleapis.com/PhraseSet" + + "\022\032\n\rphrase_set_id\030\002 \001(\tB\003\340A\002\022A\n\nphrase_s" + + "et\030\003 \001(\0132(.google.cloud.speech.v1p1beta1" + + ".PhraseSetB\003\340A\002\"\214\001\n\026UpdatePhraseSetReque" + + "st\022A\n\nphrase_set\030\001 \001(\0132(.google.cloud.sp" + + "eech.v1p1beta1.PhraseSetB\003\340A\002\022/\n\013update_" + + "mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"L" + + "\n\023GetPhraseSetRequest\0225\n\004name\030\001 \001(\tB\'\340A\002" + + "\372A!\n\037speech.googleapis.com/PhraseSet\"v\n\024" + + "ListPhraseSetRequest\0227\n\006parent\030\001 \001(\tB\'\340A" + + "\002\372A!\022\037speech.googleapis.com/PhraseSet\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"o\n\025" + + "ListPhraseSetResponse\022=\n\013phrase_sets\030\001 \003" + + "(\0132(.google.cloud.speech.v1p1beta1.Phras" + + "eSet\022\027\n\017next_page_token\030\002 \001(\t\"O\n\026DeleteP" + + "hraseSetRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037s" + + "peech.googleapis.com/PhraseSet\"\272\001\n\030Creat" + + "eCustomClassRequest\0229\n\006parent\030\001 \001(\tB)\340A\002" + + "\372A#\022!speech.googleapis.com/CustomClass\022\034" + + "\n\017custom_class_id\030\002 \001(\tB\003\340A\002\022E\n\014custom_c" + + "lass\030\003 \001(\0132*.google.cloud.speech.v1p1bet" + + "a1.CustomClassB\003\340A\002\"\222\001\n\030UpdateCustomClas" + + "sRequest\022E\n\014custom_class\030\001 \001(\0132*.google." + + "cloud.speech.v1p1beta1.CustomClassB\003\340A\002\022" + + "/\n\013update_mask\030\002 \001(\0132\032.google.protobuf.F" + + "ieldMask\"P\n\025GetCustomClassRequest\0227\n\004nam" + + "e\030\001 \001(\tB)\340A\002\372A#\n!speech.googleapis.com/C" + + "ustomClass\"|\n\030ListCustomClassesRequest\0229" + + "\n\006parent\030\001 \001(\tB)\340A\002\372A#\022!speech.googleapi" + + "s.com/CustomClass\022\021\n\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"x\n\031ListCustomClassesRes" + + "ponse\022B\n\016custom_classes\030\001 \003(\0132*.google.c" + + "loud.speech.v1p1beta1.CustomClass\022\027\n\017nex" + + "t_page_token\030\002 \001(\t\"S\n\030DeleteCustomClassR" + + "equest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!speech.goo" + + "gleapis.com/CustomClass2\322\020\n\nAdaptation\022\326" + + "\001\n\017CreatePhraseSet\0225.google.cloud.speech" + + ".v1p1beta1.CreatePhraseSetRequest\032(.goog" + + "le.cloud.speech.v1p1beta1.PhraseSet\"b\202\323\344" + + "\223\002:\"5/v1p1beta1/{parent=projects/*/locat" + + "ions/*}/phraseSets:\001*\332A\037parent,phrase_se" + + "t,phrase_set_id\022\262\001\n\014GetPhraseSet\0222.googl" + + "e.cloud.speech.v1p1beta1.GetPhraseSetReq" + + "uest\032(.google.cloud.speech.v1p1beta1.Phr" + + "aseSet\"D\202\323\344\223\0027\0225/v1p1beta1/{name=project" + + "s/*/locations/*/phraseSets/*}\332A\004name\022\302\001\n" + + "\rListPhraseSet\0223.google.cloud.speech.v1p" + + "1beta1.ListPhraseSetRequest\0324.google.clo" + + "ud.speech.v1p1beta1.ListPhraseSetRespons" + + "e\"F\202\323\344\223\0027\0225/v1p1beta1/{parent=projects/*" + + "/locations/*}/phraseSets\332A\006parent\022\341\001\n\017Up" + + "datePhraseSet\0225.google.cloud.speech.v1p1" + + "beta1.UpdatePhraseSetRequest\032(.google.cl" + + "oud.speech.v1p1beta1.PhraseSet\"m\202\323\344\223\002N2@" + + "/v1p1beta1/{phrase_set.name=projects/*/l" + + "ocations/*/phraseSets/*}:\nphrase_set\332A\026p" + + "hrase_set,update_mask\022\246\001\n\017DeletePhraseSe" + + "t\0225.google.cloud.speech.v1p1beta1.Delete" + + "PhraseSetRequest\032\026.google.protobuf.Empty" + + "\"D\202\323\344\223\0027*5/v1p1beta1/{name=projects/*/lo" + + "cations/*/phraseSets/*}\332A\004name\022\343\001\n\021Creat" + + "eCustomClass\0227.google.cloud.speech.v1p1b" + + "eta1.CreateCustomClassRequest\032*.google.c" + + "loud.speech.v1p1beta1.CustomClass\"i\202\323\344\223\002" + + "=\"8/v1p1beta1/{parent=projects/*/locatio" + + "ns/*}/customClasses:\001*\332A#parent,custom_c" + + "lass,custom_class_id\022\273\001\n\016GetCustomClass\022" + + "4.google.cloud.speech.v1p1beta1.GetCusto" + + "mClassRequest\032*.google.cloud.speech.v1p1" + + "beta1.CustomClass\"G\202\323\344\223\002:\0228/v1p1beta1/{n" + + "ame=projects/*/locations/*/customClasses" + + "/*}\332A\004name\022\321\001\n\021ListCustomClasses\0227.googl" + + "e.cloud.speech.v1p1beta1.ListCustomClass" + + "esRequest\0328.google.cloud.speech.v1p1beta" + + "1.ListCustomClassesResponse\"I\202\323\344\223\002:\0228/v1" + + "p1beta1/{parent=projects/*/locations/*}/" + + "customClasses\332A\006parent\022\360\001\n\021UpdateCustomC" + + "lass\0227.google.cloud.speech.v1p1beta1.Upd" + + "ateCustomClassRequest\032*.google.cloud.spe" + + "ech.v1p1beta1.CustomClass\"v\202\323\344\223\002U2E/v1p1" + + "beta1/{custom_class.name=projects/*/loca" + + "tions/*/customClasses/*}:\014custom_class\332A" + + "\030custom_class,update_mask\022\255\001\n\021DeleteCust" + + "omClass\0227.google.cloud.speech.v1p1beta1." + + "DeleteCustomClassRequest\032\026.google.protob" + + "uf.Empty\"G\202\323\344\223\002:*8/v1p1beta1/{name=proje" + + "cts/*/locations/*/customClasses/*}\332A\004nam" + + "e\032I\312A\025speech.googleapis.com\322A.https://ww" + + "w.googleapis.com/auth/cloud-platformB\212\001\n" + + "!com.google.cloud.speech.v1p1beta1B\025Spee" + + "chAdaptationProtoP\001ZCgoogle.golang.org/g" + + "enproto/googleapis/cloud/speech/v1p1beta" + + "1;speech\370\001\001\242\002\003GCSb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.speech.v1p1beta1.SpeechResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor, + new java.lang.String[] { "Parent", "PhraseSetId", "PhraseSet", }); + internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor, + new java.lang.String[] { "PhraseSet", "UpdateMask", }); + internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor, + new java.lang.String[] { "PhraseSets", "NextPageToken", }); + internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor, + new java.lang.String[] { "Parent", "CustomClassId", "CustomClass", }); + internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor, + new java.lang.String[] { "CustomClass", "UpdateMask", }); + internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor, + new java.lang.String[] { "CustomClasses", "NextPageToken", }); + internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor, + new java.lang.String[] { "Name", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.speech.v1p1beta1.SpeechResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java new file mode 100644 index 000000000000..b4cbb679d573 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java @@ -0,0 +1,918 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Provides "hints" to the speech recognizer to favor specific words and phrases
+ * in the results.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechContext} + */ +public final class SpeechContext extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechContext) + SpeechContextOrBuilder { +private static final long serialVersionUID = 0L; + // Use SpeechContext.newBuilder() to construct. + private SpeechContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SpeechContext() { + phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SpeechContext(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SpeechContext( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + phrases_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + phrases_.add(s); + break; + } + case 37: { + + boost_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + phrases_ = phrases_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.SpeechContext.class, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder.class); + } + + public static final int PHRASES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList phrases_; + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @return A list containing the phrases. + */ + public com.google.protobuf.ProtocolStringList + getPhrasesList() { + return phrases_; + } + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @return The count of phrases. + */ + public int getPhrasesCount() { + return phrases_.size(); + } + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @param index The index of the element to return. + * @return The phrases at the given index. + */ + public java.lang.String getPhrases(int index) { + return phrases_.get(index); + } + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @param index The index of the value to return. + * @return The bytes of the phrases at the given index. + */ + public com.google.protobuf.ByteString + getPhrasesBytes(int index) { + return phrases_.getByteString(index); + } + + public static final int BOOST_FIELD_NUMBER = 4; + private float boost_; + /** + *
+   * Hint Boost. Positive value will increase the probability that a specific
+   * phrase will be recognized over other similar sounding phrases. The higher
+   * the boost, the higher the chance of false positive recognition as well.
+   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+   * enabled, so negative boost will simply be ignored. Though `boost` can
+   * accept a wide range of positive values, most use cases are best served with
+   * values between 0 and 20. We recommend using a binary search approach to
+   * finding the optimal value for your use case.
+   * 
+ * + * float boost = 4; + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < phrases_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, phrases_.getRaw(i)); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + output.writeFloat(4, boost_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < phrases_.size(); i++) { + dataSize += computeStringSizeNoTag(phrases_.getRaw(i)); + } + size += dataSize; + size += 1 * getPhrasesList().size(); + } + if (java.lang.Float.floatToRawIntBits(boost_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, boost_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.SpeechContext)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.SpeechContext other = (com.google.cloud.speech.v1p1beta1.SpeechContext) obj; + + if (!getPhrasesList() + .equals(other.getPhrasesList())) return false; + if (java.lang.Float.floatToIntBits(getBoost()) + != java.lang.Float.floatToIntBits( + other.getBoost())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getPhrasesCount() > 0) { + hash = (37 * hash) + PHRASES_FIELD_NUMBER; + hash = (53 * hash) + getPhrasesList().hashCode(); + } + hash = (37 * hash) + BOOST_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getBoost()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeechContext parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.SpeechContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Provides "hints" to the speech recognizer to favor specific words and phrases
+   * in the results.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechContext} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechContext) + com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.SpeechContext.class, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.SpeechContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + boost_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechContext getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.SpeechContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechContext build() { + com.google.cloud.speech.v1p1beta1.SpeechContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechContext buildPartial() { + com.google.cloud.speech.v1p1beta1.SpeechContext result = new com.google.cloud.speech.v1p1beta1.SpeechContext(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + phrases_ = phrases_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.phrases_ = phrases_; + result.boost_ = boost_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.SpeechContext) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechContext)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechContext other) { + if (other == com.google.cloud.speech.v1p1beta1.SpeechContext.getDefaultInstance()) return this; + if (!other.phrases_.isEmpty()) { + if (phrases_.isEmpty()) { + phrases_ = other.phrases_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePhrasesIsMutable(); + phrases_.addAll(other.phrases_); + } + onChanged(); + } + if (other.getBoost() != 0F) { + setBoost(other.getBoost()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.SpeechContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.SpeechContext) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensurePhrasesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + phrases_ = new com.google.protobuf.LazyStringArrayList(phrases_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @return A list containing the phrases. + */ + public com.google.protobuf.ProtocolStringList + getPhrasesList() { + return phrases_.getUnmodifiableView(); + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @return The count of phrases. + */ + public int getPhrasesCount() { + return phrases_.size(); + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @param index The index of the element to return. + * @return The phrases at the given index. + */ + public java.lang.String getPhrases(int index) { + return phrases_.get(index); + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @param index The index of the value to return. + * @return The bytes of the phrases at the given index. + */ + public com.google.protobuf.ByteString + getPhrasesBytes(int index) { + return phrases_.getByteString(index); + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @param index The index to set the value at. + * @param value The phrases to set. + * @return This builder for chaining. + */ + public Builder setPhrases( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhrasesIsMutable(); + phrases_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @param value The phrases to add. + * @return This builder for chaining. + */ + public Builder addPhrases( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePhrasesIsMutable(); + phrases_.add(value); + onChanged(); + return this; + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @param values The phrases to add. + * @return This builder for chaining. + */ + public Builder addAllPhrases( + java.lang.Iterable values) { + ensurePhrasesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, phrases_); + onChanged(); + return this; + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @return This builder for chaining. + */ + public Builder clearPhrases() { + phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * A list of strings containing words and phrases "hints" so that
+     * the speech recognition is more likely to recognize them. This can be used
+     * to improve the accuracy for specific words and phrases, for example, if
+     * specific commands are typically spoken by the user. This can also be used
+     * to add additional words to the vocabulary of the recognizer. See
+     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * List items can also be set to classes for groups of words that represent
+     * common concepts that occur in natural language. For example, rather than
+     * providing phrase hints for every month of the year, using the $MONTH class
+     * improves the likelihood of correctly transcribing audio that includes
+     * months.
+     * 
+ * + * repeated string phrases = 1; + * @param value The bytes of the phrases to add. + * @return This builder for chaining. + */ + public Builder addPhrasesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePhrasesIsMutable(); + phrases_.add(value); + onChanged(); + return this; + } + + private float boost_ ; + /** + *
+     * Hint Boost. Positive value will increase the probability that a specific
+     * phrase will be recognized over other similar sounding phrases. The higher
+     * the boost, the higher the chance of false positive recognition as well.
+     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+     * enabled, so negative boost will simply be ignored. Though `boost` can
+     * accept a wide range of positive values, most use cases are best served with
+     * values between 0 and 20. We recommend using a binary search approach to
+     * finding the optimal value for your use case.
+     * 
+ * + * float boost = 4; + * @return The boost. + */ + @java.lang.Override + public float getBoost() { + return boost_; + } + /** + *
+     * Hint Boost. Positive value will increase the probability that a specific
+     * phrase will be recognized over other similar sounding phrases. The higher
+     * the boost, the higher the chance of false positive recognition as well.
+     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+     * enabled, so negative boost will simply be ignored. Though `boost` can
+     * accept a wide range of positive values, most use cases are best served with
+     * values between 0 and 20. We recommend using a binary search approach to
+     * finding the optimal value for your use case.
+     * 
+ * + * float boost = 4; + * @param value The boost to set. + * @return This builder for chaining. + */ + public Builder setBoost(float value) { + + boost_ = value; + onChanged(); + return this; + } + /** + *
+     * Hint Boost. Positive value will increase the probability that a specific
+     * phrase will be recognized over other similar sounding phrases. The higher
+     * the boost, the higher the chance of false positive recognition as well.
+     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+     * enabled, so negative boost will simply be ignored. Though `boost` can
+     * accept a wide range of positive values, most use cases are best served with
+     * values between 0 and 20. We recommend using a binary search approach to
+     * finding the optimal value for your use case.
+     * 
+ * + * float boost = 4; + * @return This builder for chaining. + */ + public Builder clearBoost() { + + boost_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.SpeechContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechContext) + private static final com.google.cloud.speech.v1p1beta1.SpeechContext DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechContext(); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeechContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SpeechContext(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java new file mode 100644 index 000000000000..1daae97d3d7c --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java @@ -0,0 +1,107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface SpeechContextOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechContext) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @return A list containing the phrases. + */ + java.util.List + getPhrasesList(); + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @return The count of phrases. + */ + int getPhrasesCount(); + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @param index The index of the element to return. + * @return The phrases at the given index. + */ + java.lang.String getPhrases(int index); + /** + *
+   * A list of strings containing words and phrases "hints" so that
+   * the speech recognition is more likely to recognize them. This can be used
+   * to improve the accuracy for specific words and phrases, for example, if
+   * specific commands are typically spoken by the user. This can also be used
+   * to add additional words to the vocabulary of the recognizer. See
+   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * List items can also be set to classes for groups of words that represent
+   * common concepts that occur in natural language. For example, rather than
+   * providing phrase hints for every month of the year, using the $MONTH class
+   * improves the likelihood of correctly transcribing audio that includes
+   * months.
+   * 
+ * + * repeated string phrases = 1; + * @param index The index of the value to return. + * @return The bytes of the phrases at the given index. + */ + com.google.protobuf.ByteString + getPhrasesBytes(int index); + + /** + *
+   * Hint Boost. Positive value will increase the probability that a specific
+   * phrase will be recognized over other similar sounding phrases. The higher
+   * the boost, the higher the chance of false positive recognition as well.
+   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
+   * enabled, so negative boost will simply be ignored. Though `boost` can
+   * accept a wide range of positive values, most use cases are best served with
+   * values between 0 and 20. We recommend using a binary search approach to
+   * finding the optimal value for your use case.
+   * 
+ * + * float boost = 4; + * @return The boost. + */ + float getBoost(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java new file mode 100644 index 000000000000..914c6bec3435 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java @@ -0,0 +1,420 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public final class SpeechProto { + private SpeechProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_SpeechContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/speech/v1p1beta1/cloud_sp" + + "eech.proto\022\035google.cloud.speech.v1p1beta" + + "1\032\034google/api/annotations.proto\032\027google/" + + "api/client.proto\032\037google/api/field_behav" + + "ior.proto\032,google/cloud/speech/v1p1beta1" + + "/resource.proto\032#google/longrunning/oper" + + "ations.proto\032\036google/protobuf/duration.p" + + "roto\032\037google/protobuf/timestamp.proto\032\036g" + + "oogle/protobuf/wrappers.proto\032\027google/rp" + + "c/status.proto\"\236\001\n\020RecognizeRequest\022E\n\006c" + + "onfig\030\001 \001(\01320.google.cloud.speech.v1p1be" + + "ta1.RecognitionConfigB\003\340A\002\022C\n\005audio\030\002 \001(" + + "\0132/.google.cloud.speech.v1p1beta1.Recogn" + + "itionAudioB\003\340A\002\"\374\001\n\033LongRunningRecognize" + + "Request\022E\n\006config\030\001 \001(\01320.google.cloud.s" + + "peech.v1p1beta1.RecognitionConfigB\003\340A\002\022C" + + "\n\005audio\030\002 \001(\0132/.google.cloud.speech.v1p1" + + "beta1.RecognitionAudioB\003\340A\002\022Q\n\routput_co" + + "nfig\030\004 \001(\01325.google.cloud.speech.v1p1bet" + + "a1.TranscriptOutputConfigB\003\340A\001\":\n\026Transc" + + "riptOutputConfig\022\021\n\007gcs_uri\030\001 \001(\tH\000B\r\n\013o" + + "utput_type\"\240\001\n\031StreamingRecognizeRequest" + + "\022U\n\020streaming_config\030\001 \001(\01329.google.clou" + + "d.speech.v1p1beta1.StreamingRecognitionC" + + "onfigH\000\022\027\n\raudio_content\030\002 \001(\014H\000B\023\n\021stre" + + "aming_request\"\226\001\n\032StreamingRecognitionCo" + + "nfig\022E\n\006config\030\001 \001(\01320.google.cloud.spee" + + "ch.v1p1beta1.RecognitionConfigB\003\340A\002\022\030\n\020s" + + "ingle_utterance\030\002 \001(\010\022\027\n\017interim_results" + + "\030\003 \001(\010\"\276\t\n\021RecognitionConfig\022P\n\010encoding" + + "\030\001 \001(\0162>.google.cloud.speech.v1p1beta1.R" + + "ecognitionConfig.AudioEncoding\022\031\n\021sample" + + "_rate_hertz\030\002 \001(\005\022\033\n\023audio_channel_count" + + "\030\007 \001(\005\022/\n\'enable_separate_recognition_pe" + + "r_channel\030\014 \001(\010\022\032\n\rlanguage_code\030\003 \001(\tB\003" + + "\340A\002\022\"\n\032alternative_language_codes\030\022 \003(\t\022" + + "\030\n\020max_alternatives\030\004 \001(\005\022\030\n\020profanity_f" + + "ilter\030\005 \001(\010\022C\n\nadaptation\030\024 \001(\0132/.google" + + ".cloud.speech.v1p1beta1.SpeechAdaptation" + + "\022X\n\030transcript_normalization\030\030 \001(\01326.goo" + + "gle.cloud.speech.v1p1beta1.TranscriptNor" + + "malization\022E\n\017speech_contexts\030\006 \003(\0132,.go" + + "ogle.cloud.speech.v1p1beta1.SpeechContex" + + "t\022 \n\030enable_word_time_offsets\030\010 \001(\010\022\036\n\026e" + + "nable_word_confidence\030\017 \001(\010\022$\n\034enable_au" + + "tomatic_punctuation\030\013 \001(\010\022=\n\031enable_spok" + + "en_punctuation\030\026 \001(\0132\032.google.protobuf.B" + + "oolValue\0228\n\024enable_spoken_emojis\030\027 \001(\0132\032" + + ".google.protobuf.BoolValue\022&\n\032enable_spe" + + "aker_diarization\030\020 \001(\010B\002\030\001\022%\n\031diarizatio" + + "n_speaker_count\030\021 \001(\005B\002\030\001\022S\n\022diarization" + + "_config\030\023 \001(\01327.google.cloud.speech.v1p1" + + "beta1.SpeakerDiarizationConfig\022D\n\010metada" + + "ta\030\t \001(\01322.google.cloud.speech.v1p1beta1" + + ".RecognitionMetadata\022\r\n\005model\030\r \001(\t\022\024\n\014u" + + "se_enhanced\030\016 \001(\010\"\243\001\n\rAudioEncoding\022\030\n\024E" + + "NCODING_UNSPECIFIED\020\000\022\014\n\010LINEAR16\020\001\022\010\n\004F" + + "LAC\020\002\022\t\n\005MULAW\020\003\022\007\n\003AMR\020\004\022\n\n\006AMR_WB\020\005\022\014\n" + + "\010OGG_OPUS\020\006\022\032\n\026SPEEX_WITH_HEADER_BYTE\020\007\022" + + "\007\n\003MP3\020\010\022\r\n\tWEBM_OPUS\020\t\"\220\001\n\030SpeakerDiari" + + "zationConfig\022\"\n\032enable_speaker_diarizati" + + "on\030\001 \001(\010\022\031\n\021min_speaker_count\030\002 \001(\005\022\031\n\021m" + + "ax_speaker_count\030\003 \001(\005\022\032\n\013speaker_tag\030\005 " + + "\001(\005B\005\030\001\340A\003\"\333\010\n\023RecognitionMetadata\022\\\n\020in" + + "teraction_type\030\001 \001(\0162B.google.cloud.spee" + + "ch.v1p1beta1.RecognitionMetadata.Interac" + + "tionType\022$\n\034industry_naics_code_of_audio" + + "\030\003 \001(\r\022b\n\023microphone_distance\030\004 \001(\0162E.go" + + "ogle.cloud.speech.v1p1beta1.RecognitionM" + + "etadata.MicrophoneDistance\022a\n\023original_m" + + "edia_type\030\005 \001(\0162D.google.cloud.speech.v1" + + "p1beta1.RecognitionMetadata.OriginalMedi" + + "aType\022e\n\025recording_device_type\030\006 \001(\0162F.g" + + "oogle.cloud.speech.v1p1beta1.Recognition" + + "Metadata.RecordingDeviceType\022\035\n\025recordin" + + "g_device_name\030\007 \001(\t\022\032\n\022original_mime_typ" + + "e\030\010 \001(\t\022\031\n\robfuscated_id\030\t \001(\003B\002\030\001\022\023\n\013au" + + "dio_topic\030\n \001(\t\"\305\001\n\017InteractionType\022 \n\034I" + + "NTERACTION_TYPE_UNSPECIFIED\020\000\022\016\n\nDISCUSS" + + "ION\020\001\022\020\n\014PRESENTATION\020\002\022\016\n\nPHONE_CALL\020\003\022" + + "\r\n\tVOICEMAIL\020\004\022\033\n\027PROFESSIONALLY_PRODUCE" + + "D\020\005\022\020\n\014VOICE_SEARCH\020\006\022\021\n\rVOICE_COMMAND\020\007" + + "\022\r\n\tDICTATION\020\010\"d\n\022MicrophoneDistance\022#\n" + + "\037MICROPHONE_DISTANCE_UNSPECIFIED\020\000\022\r\n\tNE" + + "ARFIELD\020\001\022\014\n\010MIDFIELD\020\002\022\014\n\010FARFIELD\020\003\"N\n" + + "\021OriginalMediaType\022#\n\037ORIGINAL_MEDIA_TYP" + + "E_UNSPECIFIED\020\000\022\t\n\005AUDIO\020\001\022\t\n\005VIDEO\020\002\"\244\001" + + "\n\023RecordingDeviceType\022%\n!RECORDING_DEVIC" + + "E_TYPE_UNSPECIFIED\020\000\022\016\n\nSMARTPHONE\020\001\022\006\n\002" + + "PC\020\002\022\016\n\nPHONE_LINE\020\003\022\013\n\007VEHICLE\020\004\022\030\n\024OTH" + + "ER_OUTDOOR_DEVICE\020\005\022\027\n\023OTHER_INDOOR_DEVI" + + "CE\020\006:\002\030\001\"/\n\rSpeechContext\022\017\n\007phrases\030\001 \003" + + "(\t\022\r\n\005boost\030\004 \001(\002\"D\n\020RecognitionAudio\022\021\n" + + "\007content\030\001 \001(\014H\000\022\r\n\003uri\030\002 \001(\tH\000B\016\n\014audio" + + "_source\"\222\001\n\021RecognizeResponse\022G\n\007results" + + "\030\002 \003(\01326.google.cloud.speech.v1p1beta1.S" + + "peechRecognitionResult\0224\n\021total_billed_t" + + "ime\030\003 \001(\0132\031.google.protobuf.Duration\"\225\002\n" + + "\034LongRunningRecognizeResponse\022G\n\007results" + + "\030\002 \003(\01326.google.cloud.speech.v1p1beta1.S" + + "peechRecognitionResult\0224\n\021total_billed_t" + + "ime\030\003 \001(\0132\031.google.protobuf.Duration\022L\n\r" + + "output_config\030\006 \001(\01325.google.cloud.speec" + + "h.v1p1beta1.TranscriptOutputConfig\022(\n\014ou" + + "tput_error\030\007 \001(\0132\022.google.rpc.Status\"\203\002\n" + + "\034LongRunningRecognizeMetadata\022\030\n\020progres" + + "s_percent\030\001 \001(\005\022.\n\nstart_time\030\002 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\0224\n\020last_update_t" + + "ime\030\003 \001(\0132\032.google.protobuf.Timestamp\022\020\n" + + "\003uri\030\004 \001(\tB\003\340A\003\022Q\n\routput_config\030\005 \001(\01325" + + ".google.cloud.speech.v1p1beta1.Transcrip" + + "tOutputConfigB\003\340A\003\"\365\002\n\032StreamingRecogniz" + + "eResponse\022!\n\005error\030\001 \001(\0132\022.google.rpc.St" + + "atus\022J\n\007results\030\002 \003(\01329.google.cloud.spe" + + "ech.v1p1beta1.StreamingRecognitionResult" + + "\022d\n\021speech_event_type\030\004 \001(\0162I.google.clo" + + "ud.speech.v1p1beta1.StreamingRecognizeRe" + + "sponse.SpeechEventType\0224\n\021total_billed_t" + + "ime\030\005 \001(\0132\031.google.protobuf.Duration\"L\n\017" + + "SpeechEventType\022\034\n\030SPEECH_EVENT_UNSPECIF" + + "IED\020\000\022\033\n\027END_OF_SINGLE_UTTERANCE\020\001\"\371\001\n\032S" + + "treamingRecognitionResult\022Q\n\014alternative" + + "s\030\001 \003(\0132;.google.cloud.speech.v1p1beta1." + + "SpeechRecognitionAlternative\022\020\n\010is_final" + + "\030\002 \001(\010\022\021\n\tstability\030\003 \001(\002\0222\n\017result_end_" + + "time\030\004 \001(\0132\031.google.protobuf.Duration\022\023\n" + + "\013channel_tag\030\005 \001(\005\022\032\n\rlanguage_code\030\006 \001(" + + "\tB\003\340A\003\"\321\001\n\027SpeechRecognitionResult\022Q\n\014al" + + "ternatives\030\001 \003(\0132;.google.cloud.speech.v" + + "1p1beta1.SpeechRecognitionAlternative\022\023\n" + + "\013channel_tag\030\002 \001(\005\0222\n\017result_end_time\030\004 " + + "\001(\0132\031.google.protobuf.Duration\022\032\n\rlangua" + + "ge_code\030\005 \001(\tB\003\340A\003\"~\n\034SpeechRecognitionA" + + "lternative\022\022\n\ntranscript\030\001 \001(\t\022\022\n\nconfid" + + "ence\030\002 \001(\002\0226\n\005words\030\003 \003(\0132\'.google.cloud" + + ".speech.v1p1beta1.WordInfo\"\242\001\n\010WordInfo\022" + + "-\n\nstart_time\030\001 \001(\0132\031.google.protobuf.Du" + + "ration\022+\n\010end_time\030\002 \001(\0132\031.google.protob" + + "uf.Duration\022\014\n\004word\030\003 \001(\t\022\022\n\nconfidence\030" + + "\004 \001(\002\022\030\n\013speaker_tag\030\005 \001(\005B\003\340A\0032\202\005\n\006Spee" + + "ch\022\245\001\n\tRecognize\022/.google.cloud.speech.v" + + "1p1beta1.RecognizeRequest\0320.google.cloud" + + ".speech.v1p1beta1.RecognizeResponse\"5\202\323\344" + + "\223\002 \"\033/v1p1beta1/speech:recognize:\001*\332A\014co" + + "nfig,audio\022\362\001\n\024LongRunningRecognize\022:.go" + + "ogle.cloud.speech.v1p1beta1.LongRunningR" + + "ecognizeRequest\032\035.google.longrunning.Ope" + + "ration\"\177\202\323\344\223\002+\"&/v1p1beta1/speech:longru" + + "nningrecognize:\001*\332A\014config,audio\312A<\n\034Lon" + + "gRunningRecognizeResponse\022\034LongRunningRe" + + "cognizeMetadata\022\217\001\n\022StreamingRecognize\0228" + + ".google.cloud.speech.v1p1beta1.Streaming" + + "RecognizeRequest\0329.google.cloud.speech.v" + + "1p1beta1.StreamingRecognizeResponse\"\000(\0010" + + "\001\032I\312A\025speech.googleapis.com\322A.https://ww" + + "w.googleapis.com/auth/cloud-platformB\200\001\n" + + "!com.google.cloud.speech.v1p1beta1B\013Spee" + + "chProtoP\001ZCgoogle.golang.org/genproto/go" + + "ogleapis/cloud/speech/v1p1beta1;speech\370\001" + + "\001\242\002\003GCSb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.cloud.speech.v1p1beta1.SpeechResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.protobuf.WrappersProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor, + new java.lang.String[] { "Config", "Audio", }); + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor, + new java.lang.String[] { "Config", "Audio", "OutputConfig", }); + internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_descriptor, + new java.lang.String[] { "GcsUri", "OutputType", }); + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor, + new java.lang.String[] { "StreamingConfig", "AudioContent", "StreamingRequest", }); + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor, + new java.lang.String[] { "Config", "SingleUtterance", "InterimResults", }); + internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor, + new java.lang.String[] { "Encoding", "SampleRateHertz", "AudioChannelCount", "EnableSeparateRecognitionPerChannel", "LanguageCode", "AlternativeLanguageCodes", "MaxAlternatives", "ProfanityFilter", "Adaptation", "TranscriptNormalization", "SpeechContexts", "EnableWordTimeOffsets", "EnableWordConfidence", "EnableAutomaticPunctuation", "EnableSpokenPunctuation", "EnableSpokenEmojis", "EnableSpeakerDiarization", "DiarizationSpeakerCount", "DiarizationConfig", "Metadata", "Model", "UseEnhanced", }); + internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor, + new java.lang.String[] { "EnableSpeakerDiarization", "MinSpeakerCount", "MaxSpeakerCount", "SpeakerTag", }); + internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor, + new java.lang.String[] { "InteractionType", "IndustryNaicsCodeOfAudio", "MicrophoneDistance", "OriginalMediaType", "RecordingDeviceType", "RecordingDeviceName", "OriginalMimeType", "ObfuscatedId", "AudioTopic", }); + internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_speech_v1p1beta1_SpeechContext_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor, + new java.lang.String[] { "Phrases", "Boost", }); + internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor, + new java.lang.String[] { "Content", "Uri", "AudioSource", }); + internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor, + new java.lang.String[] { "Results", "TotalBilledTime", }); + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor, + new java.lang.String[] { "Results", "TotalBilledTime", "OutputConfig", "OutputError", }); + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor, + new java.lang.String[] { "ProgressPercent", "StartTime", "LastUpdateTime", "Uri", "OutputConfig", }); + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor, + new java.lang.String[] { "Error", "Results", "SpeechEventType", "TotalBilledTime", }); + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor, + new java.lang.String[] { "Alternatives", "IsFinal", "Stability", "ResultEndTime", "ChannelTag", "LanguageCode", }); + internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor, + new java.lang.String[] { "Alternatives", "ChannelTag", "ResultEndTime", "LanguageCode", }); + internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor, + new java.lang.String[] { "Transcript", "Confidence", "Words", }); + internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor, + new java.lang.String[] { "StartTime", "EndTime", "Word", "Confidence", "SpeakerTag", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.cloud.speech.v1p1beta1.SpeechResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.protobuf.WrappersProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternative.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternative.java new file mode 100644 index 000000000000..d016049a2b08 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternative.java @@ -0,0 +1,1211 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Alternative hypotheses (a.k.a. n-best list).
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} + */ +public final class SpeechRecognitionAlternative extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) + SpeechRecognitionAlternativeOrBuilder { +private static final long serialVersionUID = 0L; + // Use SpeechRecognitionAlternative.newBuilder() to construct. + private SpeechRecognitionAlternative(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SpeechRecognitionAlternative() { + transcript_ = ""; + words_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SpeechRecognitionAlternative(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SpeechRecognitionAlternative( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + transcript_ = s; + break; + } + case 21: { + + confidence_ = input.readFloat(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + words_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + words_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.WordInfo.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + words_ = java.util.Collections.unmodifiableList(words_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.class, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder.class); + } + + public static final int TRANSCRIPT_FIELD_NUMBER = 1; + private volatile java.lang.Object transcript_; + /** + *
+   * Transcript text representing the words that the user spoke.
+   * In languages that use spaces to separate words, the transcript might have a
+   * leading space if it isn't the first result. You can concatenate each result
+   * to obtain the full transcript without using a separator.
+   * 
+ * + * string transcript = 1; + * @return The transcript. + */ + @java.lang.Override + public java.lang.String getTranscript() { + java.lang.Object ref = transcript_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + transcript_ = s; + return s; + } + } + /** + *
+   * Transcript text representing the words that the user spoke.
+   * In languages that use spaces to separate words, the transcript might have a
+   * leading space if it isn't the first result. You can concatenate each result
+   * to obtain the full transcript without using a separator.
+   * 
+ * + * string transcript = 1; + * @return The bytes for transcript. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTranscriptBytes() { + java.lang.Object ref = transcript_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + transcript_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIDENCE_FIELD_NUMBER = 2; + private float confidence_; + /** + *
+   * The confidence estimate between 0.0 and 1.0. A higher number
+   * indicates an estimated greater likelihood that the recognized words are
+   * correct. This field is set only for the top alternative of a non-streaming
+   * result or, of a streaming result where `is_final=true`.
+   * This field is not guaranteed to be accurate and users should not rely on it
+   * to be always provided.
+   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+   * 
+ * + * float confidence = 2; + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + + public static final int WORDS_FIELD_NUMBER = 3; + private java.util.List words_; + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + @java.lang.Override + public java.util.List getWordsList() { + return words_; + } + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + @java.lang.Override + public java.util.List + getWordsOrBuilderList() { + return words_; + } + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + @java.lang.Override + public int getWordsCount() { + return words_.size(); + } + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.WordInfo getWords(int index) { + return words_.get(index); + } + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder getWordsOrBuilder( + int index) { + return words_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(transcript_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, transcript_); + } + if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { + output.writeFloat(2, confidence_); + } + for (int i = 0; i < words_.size(); i++) { + output.writeMessage(3, words_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(transcript_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, transcript_); + } + if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, confidence_); + } + for (int i = 0; i < words_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, words_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative other = (com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) obj; + + if (!getTranscript() + .equals(other.getTranscript())) return false; + if (java.lang.Float.floatToIntBits(getConfidence()) + != java.lang.Float.floatToIntBits( + other.getConfidence())) return false; + if (!getWordsList() + .equals(other.getWordsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TRANSCRIPT_FIELD_NUMBER; + hash = (53 * hash) + getTranscript().hashCode(); + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + if (getWordsCount() > 0) { + hash = (37 * hash) + WORDS_FIELD_NUMBER; + hash = (53 * hash) + getWordsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Alternative hypotheses (a.k.a. n-best list).
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.class, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getWordsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + transcript_ = ""; + + confidence_ = 0F; + + if (wordsBuilder_ == null) { + words_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + wordsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative build() { + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative buildPartial() { + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative result = new com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative(this); + int from_bitField0_ = bitField0_; + result.transcript_ = transcript_; + result.confidence_ = confidence_; + if (wordsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + words_ = java.util.Collections.unmodifiableList(words_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.words_ = words_; + } else { + result.words_ = wordsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative other) { + if (other == com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()) return this; + if (!other.getTranscript().isEmpty()) { + transcript_ = other.transcript_; + onChanged(); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + if (wordsBuilder_ == null) { + if (!other.words_.isEmpty()) { + if (words_.isEmpty()) { + words_ = other.words_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWordsIsMutable(); + words_.addAll(other.words_); + } + onChanged(); + } + } else { + if (!other.words_.isEmpty()) { + if (wordsBuilder_.isEmpty()) { + wordsBuilder_.dispose(); + wordsBuilder_ = null; + words_ = other.words_; + bitField0_ = (bitField0_ & ~0x00000001); + wordsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getWordsFieldBuilder() : null; + } else { + wordsBuilder_.addAllMessages(other.words_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object transcript_ = ""; + /** + *
+     * Transcript text representing the words that the user spoke.
+     * In languages that use spaces to separate words, the transcript might have a
+     * leading space if it isn't the first result. You can concatenate each result
+     * to obtain the full transcript without using a separator.
+     * 
+ * + * string transcript = 1; + * @return The transcript. + */ + public java.lang.String getTranscript() { + java.lang.Object ref = transcript_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + transcript_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Transcript text representing the words that the user spoke.
+     * In languages that use spaces to separate words, the transcript might have a
+     * leading space if it isn't the first result. You can concatenate each result
+     * to obtain the full transcript without using a separator.
+     * 
+ * + * string transcript = 1; + * @return The bytes for transcript. + */ + public com.google.protobuf.ByteString + getTranscriptBytes() { + java.lang.Object ref = transcript_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + transcript_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Transcript text representing the words that the user spoke.
+     * In languages that use spaces to separate words, the transcript might have a
+     * leading space if it isn't the first result. You can concatenate each result
+     * to obtain the full transcript without using a separator.
+     * 
+ * + * string transcript = 1; + * @param value The transcript to set. + * @return This builder for chaining. + */ + public Builder setTranscript( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + transcript_ = value; + onChanged(); + return this; + } + /** + *
+     * Transcript text representing the words that the user spoke.
+     * In languages that use spaces to separate words, the transcript might have a
+     * leading space if it isn't the first result. You can concatenate each result
+     * to obtain the full transcript without using a separator.
+     * 
+ * + * string transcript = 1; + * @return This builder for chaining. + */ + public Builder clearTranscript() { + + transcript_ = getDefaultInstance().getTranscript(); + onChanged(); + return this; + } + /** + *
+     * Transcript text representing the words that the user spoke.
+     * In languages that use spaces to separate words, the transcript might have a
+     * leading space if it isn't the first result. You can concatenate each result
+     * to obtain the full transcript without using a separator.
+     * 
+ * + * string transcript = 1; + * @param value The bytes for transcript to set. + * @return This builder for chaining. + */ + public Builder setTranscriptBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + transcript_ = value; + onChanged(); + return this; + } + + private float confidence_ ; + /** + *
+     * The confidence estimate between 0.0 and 1.0. A higher number
+     * indicates an estimated greater likelihood that the recognized words are
+     * correct. This field is set only for the top alternative of a non-streaming
+     * result or, of a streaming result where `is_final=true`.
+     * This field is not guaranteed to be accurate and users should not rely on it
+     * to be always provided.
+     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+     * 
+ * + * float confidence = 2; + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + /** + *
+     * The confidence estimate between 0.0 and 1.0. A higher number
+     * indicates an estimated greater likelihood that the recognized words are
+     * correct. This field is set only for the top alternative of a non-streaming
+     * result or, of a streaming result where `is_final=true`.
+     * This field is not guaranteed to be accurate and users should not rely on it
+     * to be always provided.
+     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+     * 
+ * + * float confidence = 2; + * @param value The confidence to set. + * @return This builder for chaining. + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * The confidence estimate between 0.0 and 1.0. A higher number
+     * indicates an estimated greater likelihood that the recognized words are
+     * correct. This field is set only for the top alternative of a non-streaming
+     * result or, of a streaming result where `is_final=true`.
+     * This field is not guaranteed to be accurate and users should not rely on it
+     * to be always provided.
+     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+     * 
+ * + * float confidence = 2; + * @return This builder for chaining. + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + + private java.util.List words_ = + java.util.Collections.emptyList(); + private void ensureWordsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + words_ = new java.util.ArrayList(words_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.WordInfo, com.google.cloud.speech.v1p1beta1.WordInfo.Builder, com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder> wordsBuilder_; + + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public java.util.List getWordsList() { + if (wordsBuilder_ == null) { + return java.util.Collections.unmodifiableList(words_); + } else { + return wordsBuilder_.getMessageList(); + } + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public int getWordsCount() { + if (wordsBuilder_ == null) { + return words_.size(); + } else { + return wordsBuilder_.getCount(); + } + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public com.google.cloud.speech.v1p1beta1.WordInfo getWords(int index) { + if (wordsBuilder_ == null) { + return words_.get(index); + } else { + return wordsBuilder_.getMessage(index); + } + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public Builder setWords( + int index, com.google.cloud.speech.v1p1beta1.WordInfo value) { + if (wordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.set(index, value); + onChanged(); + } else { + wordsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public Builder setWords( + int index, com.google.cloud.speech.v1p1beta1.WordInfo.Builder builderForValue) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + words_.set(index, builderForValue.build()); + onChanged(); + } else { + wordsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public Builder addWords(com.google.cloud.speech.v1p1beta1.WordInfo value) { + if (wordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.add(value); + onChanged(); + } else { + wordsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public Builder addWords( + int index, com.google.cloud.speech.v1p1beta1.WordInfo value) { + if (wordsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWordsIsMutable(); + words_.add(index, value); + onChanged(); + } else { + wordsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public Builder addWords( + com.google.cloud.speech.v1p1beta1.WordInfo.Builder builderForValue) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + words_.add(builderForValue.build()); + onChanged(); + } else { + wordsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public Builder addWords( + int index, com.google.cloud.speech.v1p1beta1.WordInfo.Builder builderForValue) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + words_.add(index, builderForValue.build()); + onChanged(); + } else { + wordsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public Builder addAllWords( + java.lang.Iterable values) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, words_); + onChanged(); + } else { + wordsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public Builder clearWords() { + if (wordsBuilder_ == null) { + words_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + wordsBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public Builder removeWords(int index) { + if (wordsBuilder_ == null) { + ensureWordsIsMutable(); + words_.remove(index); + onChanged(); + } else { + wordsBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public com.google.cloud.speech.v1p1beta1.WordInfo.Builder getWordsBuilder( + int index) { + return getWordsFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder getWordsOrBuilder( + int index) { + if (wordsBuilder_ == null) { + return words_.get(index); } else { + return wordsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public java.util.List + getWordsOrBuilderList() { + if (wordsBuilder_ != null) { + return wordsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(words_); + } + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public com.google.cloud.speech.v1p1beta1.WordInfo.Builder addWordsBuilder() { + return getWordsFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.WordInfo.getDefaultInstance()); + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public com.google.cloud.speech.v1p1beta1.WordInfo.Builder addWordsBuilder( + int index) { + return getWordsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.WordInfo.getDefaultInstance()); + } + /** + *
+     * A list of word-specific information for each recognized word.
+     * Note: When `enable_speaker_diarization` is true, you will see all the words
+     * from the beginning of the audio.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + public java.util.List + getWordsBuilderList() { + return getWordsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.WordInfo, com.google.cloud.speech.v1p1beta1.WordInfo.Builder, com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder> + getWordsFieldBuilder() { + if (wordsBuilder_ == null) { + wordsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.WordInfo, com.google.cloud.speech.v1p1beta1.WordInfo.Builder, com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder>( + words_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + words_ = null; + } + return wordsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) + private static final com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative(); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeechRecognitionAlternative parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SpeechRecognitionAlternative(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternativeOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternativeOrBuilder.java new file mode 100644 index 000000000000..24dc349ab976 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternativeOrBuilder.java @@ -0,0 +1,105 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface SpeechRecognitionAlternativeOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Transcript text representing the words that the user spoke.
+   * In languages that use spaces to separate words, the transcript might have a
+   * leading space if it isn't the first result. You can concatenate each result
+   * to obtain the full transcript without using a separator.
+   * 
+ * + * string transcript = 1; + * @return The transcript. + */ + java.lang.String getTranscript(); + /** + *
+   * Transcript text representing the words that the user spoke.
+   * In languages that use spaces to separate words, the transcript might have a
+   * leading space if it isn't the first result. You can concatenate each result
+   * to obtain the full transcript without using a separator.
+   * 
+ * + * string transcript = 1; + * @return The bytes for transcript. + */ + com.google.protobuf.ByteString + getTranscriptBytes(); + + /** + *
+   * The confidence estimate between 0.0 and 1.0. A higher number
+   * indicates an estimated greater likelihood that the recognized words are
+   * correct. This field is set only for the top alternative of a non-streaming
+   * result or, of a streaming result where `is_final=true`.
+   * This field is not guaranteed to be accurate and users should not rely on it
+   * to be always provided.
+   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+   * 
+ * + * float confidence = 2; + * @return The confidence. + */ + float getConfidence(); + + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + java.util.List + getWordsList(); + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + com.google.cloud.speech.v1p1beta1.WordInfo getWords(int index); + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + int getWordsCount(); + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + java.util.List + getWordsOrBuilderList(); + /** + *
+   * A list of word-specific information for each recognized word.
+   * Note: When `enable_speaker_diarization` is true, you will see all the words
+   * from the beginning of the audio.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; + */ + com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder getWordsOrBuilder( + int index); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResult.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResult.java new file mode 100644 index 000000000000..9636912bbe44 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResult.java @@ -0,0 +1,1457 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * A speech recognition result corresponding to a portion of the audio.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechRecognitionResult} + */ +public final class SpeechRecognitionResult extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) + SpeechRecognitionResultOrBuilder { +private static final long serialVersionUID = 0L; + // Use SpeechRecognitionResult.newBuilder() to construct. + private SpeechRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SpeechRecognitionResult() { + alternatives_ = java.util.Collections.emptyList(); + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SpeechRecognitionResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SpeechRecognitionResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + alternatives_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + alternatives_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.parser(), extensionRegistry)); + break; + } + case 16: { + + channelTag_ = input.readInt32(); + break; + } + case 34: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (resultEndTime_ != null) { + subBuilder = resultEndTime_.toBuilder(); + } + resultEndTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resultEndTime_); + resultEndTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + alternatives_ = java.util.Collections.unmodifiableList(alternatives_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.class, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder.class); + } + + public static final int ALTERNATIVES_FIELD_NUMBER = 1; + private java.util.List alternatives_; + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public java.util.List getAlternativesList() { + return alternatives_; + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public java.util.List + getAlternativesOrBuilderList() { + return alternatives_; + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public int getAlternativesCount() { + return alternatives_.size(); + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index) { + return alternatives_.get(index); + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( + int index) { + return alternatives_.get(index); + } + + public static final int CHANNEL_TAG_FIELD_NUMBER = 2; + private int channelTag_; + /** + *
+   * For multi-channel audio, this is the channel number corresponding to the
+   * recognized result for the audio from that channel.
+   * For audio_channel_count = N, its output values can range from '1' to 'N'.
+   * 
+ * + * int32 channel_tag = 2; + * @return The channelTag. + */ + @java.lang.Override + public int getChannelTag() { + return channelTag_; + } + + public static final int RESULT_END_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Duration resultEndTime_; + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return Whether the resultEndTime field is set. + */ + @java.lang.Override + public boolean hasResultEndTime() { + return resultEndTime_ != null; + } + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return The resultEndTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getResultEndTime() { + return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; + } + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { + return getResultEndTime(); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 5; + private volatile java.lang.Object languageCode_; + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < alternatives_.size(); i++) { + output.writeMessage(1, alternatives_.get(i)); + } + if (channelTag_ != 0) { + output.writeInt32(2, channelTag_); + } + if (resultEndTime_ != null) { + output.writeMessage(4, getResultEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, languageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < alternatives_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, alternatives_.get(i)); + } + if (channelTag_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, channelTag_); + } + if (resultEndTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getResultEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult other = (com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult) obj; + + if (!getAlternativesList() + .equals(other.getAlternativesList())) return false; + if (getChannelTag() + != other.getChannelTag()) return false; + if (hasResultEndTime() != other.hasResultEndTime()) return false; + if (hasResultEndTime()) { + if (!getResultEndTime() + .equals(other.getResultEndTime())) return false; + } + if (!getLanguageCode() + .equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAlternativesCount() > 0) { + hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; + hash = (53 * hash) + getAlternativesList().hashCode(); + } + hash = (37 * hash) + CHANNEL_TAG_FIELD_NUMBER; + hash = (53 * hash) + getChannelTag(); + if (hasResultEndTime()) { + hash = (37 * hash) + RESULT_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResultEndTime().hashCode(); + } + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A speech recognition result corresponding to a portion of the audio.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechRecognitionResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.class, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAlternativesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (alternativesBuilder_ == null) { + alternatives_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + alternativesBuilder_.clear(); + } + channelTag_ = 0; + + if (resultEndTimeBuilder_ == null) { + resultEndTime_ = null; + } else { + resultEndTime_ = null; + resultEndTimeBuilder_ = null; + } + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult build() { + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult buildPartial() { + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult result = new com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult(this); + int from_bitField0_ = bitField0_; + if (alternativesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + alternatives_ = java.util.Collections.unmodifiableList(alternatives_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.alternatives_ = alternatives_; + } else { + result.alternatives_ = alternativesBuilder_.build(); + } + result.channelTag_ = channelTag_; + if (resultEndTimeBuilder_ == null) { + result.resultEndTime_ = resultEndTime_; + } else { + result.resultEndTime_ = resultEndTimeBuilder_.build(); + } + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult other) { + if (other == com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()) return this; + if (alternativesBuilder_ == null) { + if (!other.alternatives_.isEmpty()) { + if (alternatives_.isEmpty()) { + alternatives_ = other.alternatives_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAlternativesIsMutable(); + alternatives_.addAll(other.alternatives_); + } + onChanged(); + } + } else { + if (!other.alternatives_.isEmpty()) { + if (alternativesBuilder_.isEmpty()) { + alternativesBuilder_.dispose(); + alternativesBuilder_ = null; + alternatives_ = other.alternatives_; + bitField0_ = (bitField0_ & ~0x00000001); + alternativesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAlternativesFieldBuilder() : null; + } else { + alternativesBuilder_.addAllMessages(other.alternatives_); + } + } + } + if (other.getChannelTag() != 0) { + setChannelTag(other.getChannelTag()); + } + if (other.hasResultEndTime()) { + mergeResultEndTime(other.getResultEndTime()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List alternatives_ = + java.util.Collections.emptyList(); + private void ensureAlternativesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + alternatives_ = new java.util.ArrayList(alternatives_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> alternativesBuilder_; + + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public java.util.List getAlternativesList() { + if (alternativesBuilder_ == null) { + return java.util.Collections.unmodifiableList(alternatives_); + } else { + return alternativesBuilder_.getMessageList(); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public int getAlternativesCount() { + if (alternativesBuilder_ == null) { + return alternatives_.size(); + } else { + return alternativesBuilder_.getCount(); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index) { + if (alternativesBuilder_ == null) { + return alternatives_.get(index); + } else { + return alternativesBuilder_.getMessage(index); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder setAlternatives( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { + if (alternativesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativesIsMutable(); + alternatives_.set(index, value); + onChanged(); + } else { + alternativesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder setAlternatives( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.set(index, builderForValue.build()); + onChanged(); + } else { + alternativesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { + if (alternativesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativesIsMutable(); + alternatives_.add(value); + onChanged(); + } else { + alternativesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { + if (alternativesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativesIsMutable(); + alternatives_.add(index, value); + onChanged(); + } else { + alternativesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives( + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.add(builderForValue.build()); + onChanged(); + } else { + alternativesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.add(index, builderForValue.build()); + onChanged(); + } else { + alternativesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAllAlternatives( + java.lang.Iterable values) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, alternatives_); + onChanged(); + } else { + alternativesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder clearAlternatives() { + if (alternativesBuilder_ == null) { + alternatives_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + alternativesBuilder_.clear(); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder removeAlternatives(int index) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.remove(index); + onChanged(); + } else { + alternativesBuilder_.remove(index); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder getAlternativesBuilder( + int index) { + return getAlternativesFieldBuilder().getBuilder(index); + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( + int index) { + if (alternativesBuilder_ == null) { + return alternatives_.get(index); } else { + return alternativesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public java.util.List + getAlternativesOrBuilderList() { + if (alternativesBuilder_ != null) { + return alternativesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(alternatives_); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder addAlternativesBuilder() { + return getAlternativesFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()); + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder addAlternativesBuilder( + int index) { + return getAlternativesFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()); + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public java.util.List + getAlternativesBuilderList() { + return getAlternativesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> + getAlternativesFieldBuilder() { + if (alternativesBuilder_ == null) { + alternativesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder>( + alternatives_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + alternatives_ = null; + } + return alternativesBuilder_; + } + + private int channelTag_ ; + /** + *
+     * For multi-channel audio, this is the channel number corresponding to the
+     * recognized result for the audio from that channel.
+     * For audio_channel_count = N, its output values can range from '1' to 'N'.
+     * 
+ * + * int32 channel_tag = 2; + * @return The channelTag. + */ + @java.lang.Override + public int getChannelTag() { + return channelTag_; + } + /** + *
+     * For multi-channel audio, this is the channel number corresponding to the
+     * recognized result for the audio from that channel.
+     * For audio_channel_count = N, its output values can range from '1' to 'N'.
+     * 
+ * + * int32 channel_tag = 2; + * @param value The channelTag to set. + * @return This builder for chaining. + */ + public Builder setChannelTag(int value) { + + channelTag_ = value; + onChanged(); + return this; + } + /** + *
+     * For multi-channel audio, this is the channel number corresponding to the
+     * recognized result for the audio from that channel.
+     * For audio_channel_count = N, its output values can range from '1' to 'N'.
+     * 
+ * + * int32 channel_tag = 2; + * @return This builder for chaining. + */ + public Builder clearChannelTag() { + + channelTag_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration resultEndTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> resultEndTimeBuilder_; + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return Whether the resultEndTime field is set. + */ + public boolean hasResultEndTime() { + return resultEndTimeBuilder_ != null || resultEndTime_ != null; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return The resultEndTime. + */ + public com.google.protobuf.Duration getResultEndTime() { + if (resultEndTimeBuilder_ == null) { + return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; + } else { + return resultEndTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder setResultEndTime(com.google.protobuf.Duration value) { + if (resultEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resultEndTime_ = value; + onChanged(); + } else { + resultEndTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder setResultEndTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (resultEndTimeBuilder_ == null) { + resultEndTime_ = builderForValue.build(); + onChanged(); + } else { + resultEndTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder mergeResultEndTime(com.google.protobuf.Duration value) { + if (resultEndTimeBuilder_ == null) { + if (resultEndTime_ != null) { + resultEndTime_ = + com.google.protobuf.Duration.newBuilder(resultEndTime_).mergeFrom(value).buildPartial(); + } else { + resultEndTime_ = value; + } + onChanged(); + } else { + resultEndTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder clearResultEndTime() { + if (resultEndTimeBuilder_ == null) { + resultEndTime_ = null; + onChanged(); + } else { + resultEndTime_ = null; + resultEndTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public com.google.protobuf.Duration.Builder getResultEndTimeBuilder() { + + onChanged(); + return getResultEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { + if (resultEndTimeBuilder_ != null) { + return resultEndTimeBuilder_.getMessageOrBuilder(); + } else { + return resultEndTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; + } + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getResultEndTimeFieldBuilder() { + if (resultEndTimeBuilder_ == null) { + resultEndTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getResultEndTime(), + getParentForChildren(), + isClean()); + resultEndTime_ = null; + } + return resultEndTimeBuilder_; + } + + private java.lang.Object languageCode_ = ""; + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) + private static final com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult(); + } + + public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SpeechRecognitionResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SpeechRecognitionResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResultOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResultOrBuilder.java new file mode 100644 index 000000000000..55e3c978e3c9 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResultOrBuilder.java @@ -0,0 +1,134 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface SpeechRecognitionResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + java.util.List + getAlternativesList(); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + int getAlternativesCount(); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + java.util.List + getAlternativesOrBuilderList(); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( + int index); + + /** + *
+   * For multi-channel audio, this is the channel number corresponding to the
+   * recognized result for the audio from that channel.
+   * For audio_channel_count = N, its output values can range from '1' to 'N'.
+   * 
+ * + * int32 channel_tag = 2; + * @return The channelTag. + */ + int getChannelTag(); + + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return Whether the resultEndTime field is set. + */ + boolean hasResultEndTime(); + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return The resultEndTime. + */ + com.google.protobuf.Duration getResultEndTime(); + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder(); + + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString + getLanguageCodeBytes(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java new file mode 100644 index 000000000000..64362624dc97 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java @@ -0,0 +1,148 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/resource.proto + +package com.google.cloud.speech.v1p1beta1; + +public final class SpeechResourceProto { + private SpeechResourceProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_CustomClass_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n,google/cloud/speech/v1p1beta1/resource" + + ".proto\022\035google.cloud.speech.v1p1beta1\032\031g" + + "oogle/api/resource.proto\"\203\002\n\013CustomClass" + + "\022\014\n\004name\030\001 \001(\t\022\027\n\017custom_class_id\030\002 \001(\t\022" + + "C\n\005items\030\003 \003(\01324.google.cloud.speech.v1p" + + "1beta1.CustomClass.ClassItem\032\032\n\tClassIte" + + "m\022\r\n\005value\030\001 \001(\t:l\352Ai\n!speech.googleapis" + + ".com/CustomClass\022Dprojects/{project}/loc" + + "ations/{location}/customClasses/{custom_" + + "class}\"\371\001\n\tPhraseSet\022\014\n\004name\030\001 \001(\t\022@\n\007ph" + + "rases\030\002 \003(\0132/.google.cloud.speech.v1p1be" + + "ta1.PhraseSet.Phrase\022\r\n\005boost\030\004 \001(\002\032&\n\006P" + + "hrase\022\r\n\005value\030\001 \001(\t\022\r\n\005boost\030\002 \001(\002:e\352Ab" + + "\n\037speech.googleapis.com/PhraseSet\022?proje" + + "cts/{project}/locations/{location}/phras" + + "eSets/{phrase_set}\"\332\001\n\020SpeechAdaptation\022" + + "=\n\013phrase_sets\030\001 \003(\0132(.google.cloud.spee" + + "ch.v1p1beta1.PhraseSet\022C\n\025phrase_set_ref" + + "erences\030\002 \003(\tB$\372A!\n\037speech.googleapis.co" + + "m/PhraseSet\022B\n\016custom_classes\030\003 \003(\0132*.go" + + "ogle.cloud.speech.v1p1beta1.CustomClass\"" + + "\252\001\n\027TranscriptNormalization\022M\n\007entries\030\001" + + " \003(\0132<.google.cloud.speech.v1p1beta1.Tra" + + "nscriptNormalization.Entry\032@\n\005Entry\022\016\n\006s" + + "earch\030\001 \001(\t\022\017\n\007replace\030\002 \001(\t\022\026\n\016case_sen" + + "sitive\030\003 \001(\010B\210\001\n!com.google.cloud.speech" + + ".v1p1beta1B\023SpeechResourceProtoP\001ZCgoogl" + + "e.golang.org/genproto/googleapis/cloud/s" + + "peech/v1p1beta1;speech\370\001\001\242\002\003GCSb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.ResourceProto.getDescriptor(), + }); + internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_speech_v1p1beta1_CustomClass_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor, + new java.lang.String[] { "Name", "CustomClassId", "Items", }); + internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor = + internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor, + new java.lang.String[] { "Value", }); + internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor, + new java.lang.String[] { "Name", "Phrases", "Boost", }); + internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor = + internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor, + new java.lang.String[] { "Value", "Boost", }); + internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor, + new java.lang.String[] { "PhraseSets", "PhraseSetReferences", "CustomClasses", }); + internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor, + new java.lang.String[] { "Entries", }); + internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_descriptor = + internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_descriptor, + new java.lang.String[] { "Search", "Replace", "CaseSensitive", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.ResourceProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java new file mode 100644 index 000000000000..cdf053e413d7 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java @@ -0,0 +1,921 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Provides information to the recognizer that specifies how to process the
+ * request.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} + */ +public final class StreamingRecognitionConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) + StreamingRecognitionConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use StreamingRecognitionConfig.newBuilder() to construct. + private StreamingRecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StreamingRecognitionConfig() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StreamingRecognitionConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StreamingRecognitionConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder subBuilder = null; + if (config_ != null) { + subBuilder = config_.toBuilder(); + } + config_ = input.readMessage(com.google.cloud.speech.v1p1beta1.RecognitionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(config_); + config_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + + singleUtterance_ = input.readBool(); + break; + } + case 24: { + + interimResults_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.class, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder.class); + } + + public static final int CONFIG_FIELD_NUMBER = 1; + private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + @java.lang.Override + public boolean hasConfig() { + return config_ != null; + } + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { + return config_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; + } + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { + return getConfig(); + } + + public static final int SINGLE_UTTERANCE_FIELD_NUMBER = 2; + private boolean singleUtterance_; + /** + *
+   * If `false` or omitted, the recognizer will perform continuous
+   * recognition (continuing to wait for and process audio even if the user
+   * pauses speaking) until the client closes the input stream (gRPC API) or
+   * until the maximum time limit has been reached. May return multiple
+   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
+   * If `true`, the recognizer will detect a single spoken utterance. When it
+   * detects that the user has paused or stopped speaking, it will return an
+   * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
+   * more than one `StreamingRecognitionResult` with the `is_final` flag set to
+   * `true`.
+   * The `single_utterance` field can only be used with specified models,
+   * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
+   * must be set to:
+   * * `command_and_search`
+   * * `phone_call` AND additional field `useEnhanced`=`true`
+   * * The `model` field is left undefined. In this case the API auto-selects
+   *   a model based on any other parameters that you set in
+   *   `RecognitionConfig`.
+   * 
+ * + * bool single_utterance = 2; + * @return The singleUtterance. + */ + @java.lang.Override + public boolean getSingleUtterance() { + return singleUtterance_; + } + + public static final int INTERIM_RESULTS_FIELD_NUMBER = 3; + private boolean interimResults_; + /** + *
+   * If `true`, interim results (tentative hypotheses) may be
+   * returned as they become available (these interim results are indicated with
+   * the `is_final=false` flag).
+   * If `false` or omitted, only `is_final=true` result(s) are returned.
+   * 
+ * + * bool interim_results = 3; + * @return The interimResults. + */ + @java.lang.Override + public boolean getInterimResults() { + return interimResults_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (config_ != null) { + output.writeMessage(1, getConfig()); + } + if (singleUtterance_ != false) { + output.writeBool(2, singleUtterance_); + } + if (interimResults_ != false) { + output.writeBool(3, interimResults_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (config_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getConfig()); + } + if (singleUtterance_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, singleUtterance_); + } + if (interimResults_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, interimResults_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig other = (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) obj; + + if (hasConfig() != other.hasConfig()) return false; + if (hasConfig()) { + if (!getConfig() + .equals(other.getConfig())) return false; + } + if (getSingleUtterance() + != other.getSingleUtterance()) return false; + if (getInterimResults() + != other.getInterimResults()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + hash = (37 * hash) + SINGLE_UTTERANCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSingleUtterance()); + hash = (37 * hash) + INTERIM_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getInterimResults()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.class, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (configBuilder_ == null) { + config_ = null; + } else { + config_ = null; + configBuilder_ = null; + } + singleUtterance_ = false; + + interimResults_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig build() { + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig buildPartial() { + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig result = new com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig(this); + if (configBuilder_ == null) { + result.config_ = config_; + } else { + result.config_ = configBuilder_.build(); + } + result.singleUtterance_ = singleUtterance_; + result.interimResults_ = interimResults_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig other) { + if (other == com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance()) return this; + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + if (other.getSingleUtterance() != false) { + setSingleUtterance(other.getSingleUtterance()); + } + if (other.getInterimResults() != false) { + setInterimResults(other.getInterimResults()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> configBuilder_; + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + public boolean hasConfig() { + return configBuilder_ != null || config_ != null; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { + if (configBuilder_ == null) { + return config_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setConfig( + com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { + if (configBuilder_ == null) { + if (config_ != null) { + config_ = + com.google.cloud.speech.v1p1beta1.RecognitionConfig.newBuilder(config_).mergeFrom(value).buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + configBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + config_ = null; + onChanged(); + } else { + config_ = null; + configBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder getConfigBuilder() { + + onChanged(); + return getConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null ? + com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; + } + } + /** + *
+     * Required. Provides information to the recognizer that specifies how to
+     * process the request.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder>( + getConfig(), + getParentForChildren(), + isClean()); + config_ = null; + } + return configBuilder_; + } + + private boolean singleUtterance_ ; + /** + *
+     * If `false` or omitted, the recognizer will perform continuous
+     * recognition (continuing to wait for and process audio even if the user
+     * pauses speaking) until the client closes the input stream (gRPC API) or
+     * until the maximum time limit has been reached. May return multiple
+     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
+     * If `true`, the recognizer will detect a single spoken utterance. When it
+     * detects that the user has paused or stopped speaking, it will return an
+     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
+     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
+     * `true`.
+     * The `single_utterance` field can only be used with specified models,
+     * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
+     * must be set to:
+     * * `command_and_search`
+     * * `phone_call` AND additional field `useEnhanced`=`true`
+     * * The `model` field is left undefined. In this case the API auto-selects
+     *   a model based on any other parameters that you set in
+     *   `RecognitionConfig`.
+     * 
+ * + * bool single_utterance = 2; + * @return The singleUtterance. + */ + @java.lang.Override + public boolean getSingleUtterance() { + return singleUtterance_; + } + /** + *
+     * If `false` or omitted, the recognizer will perform continuous
+     * recognition (continuing to wait for and process audio even if the user
+     * pauses speaking) until the client closes the input stream (gRPC API) or
+     * until the maximum time limit has been reached. May return multiple
+     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
+     * If `true`, the recognizer will detect a single spoken utterance. When it
+     * detects that the user has paused or stopped speaking, it will return an
+     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
+     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
+     * `true`.
+     * The `single_utterance` field can only be used with specified models,
+     * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
+     * must be set to:
+     * * `command_and_search`
+     * * `phone_call` AND additional field `useEnhanced`=`true`
+     * * The `model` field is left undefined. In this case the API auto-selects
+     *   a model based on any other parameters that you set in
+     *   `RecognitionConfig`.
+     * 
+ * + * bool single_utterance = 2; + * @param value The singleUtterance to set. + * @return This builder for chaining. + */ + public Builder setSingleUtterance(boolean value) { + + singleUtterance_ = value; + onChanged(); + return this; + } + /** + *
+     * If `false` or omitted, the recognizer will perform continuous
+     * recognition (continuing to wait for and process audio even if the user
+     * pauses speaking) until the client closes the input stream (gRPC API) or
+     * until the maximum time limit has been reached. May return multiple
+     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
+     * If `true`, the recognizer will detect a single spoken utterance. When it
+     * detects that the user has paused or stopped speaking, it will return an
+     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
+     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
+     * `true`.
+     * The `single_utterance` field can only be used with specified models,
+     * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
+     * must be set to:
+     * * `command_and_search`
+     * * `phone_call` AND additional field `useEnhanced`=`true`
+     * * The `model` field is left undefined. In this case the API auto-selects
+     *   a model based on any other parameters that you set in
+     *   `RecognitionConfig`.
+     * 
+ * + * bool single_utterance = 2; + * @return This builder for chaining. + */ + public Builder clearSingleUtterance() { + + singleUtterance_ = false; + onChanged(); + return this; + } + + private boolean interimResults_ ; + /** + *
+     * If `true`, interim results (tentative hypotheses) may be
+     * returned as they become available (these interim results are indicated with
+     * the `is_final=false` flag).
+     * If `false` or omitted, only `is_final=true` result(s) are returned.
+     * 
+ * + * bool interim_results = 3; + * @return The interimResults. + */ + @java.lang.Override + public boolean getInterimResults() { + return interimResults_; + } + /** + *
+     * If `true`, interim results (tentative hypotheses) may be
+     * returned as they become available (these interim results are indicated with
+     * the `is_final=false` flag).
+     * If `false` or omitted, only `is_final=true` result(s) are returned.
+     * 
+ * + * bool interim_results = 3; + * @param value The interimResults to set. + * @return This builder for chaining. + */ + public Builder setInterimResults(boolean value) { + + interimResults_ = value; + onChanged(); + return this; + } + /** + *
+     * If `true`, interim results (tentative hypotheses) may be
+     * returned as they become available (these interim results are indicated with
+     * the `is_final=false` flag).
+     * If `false` or omitted, only `is_final=true` result(s) are returned.
+     * 
+ * + * bool interim_results = 3; + * @return This builder for chaining. + */ + public Builder clearInterimResults() { + + interimResults_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) + private static final com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig(); + } + + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingRecognitionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingRecognitionConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java new file mode 100644 index 000000000000..73a8d60b1e89 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface StreamingRecognitionConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the config field is set. + */ + boolean hasConfig(); + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The config. + */ + com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig(); + /** + *
+   * Required. Provides information to the recognizer that specifies how to
+   * process the request.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder(); + + /** + *
+   * If `false` or omitted, the recognizer will perform continuous
+   * recognition (continuing to wait for and process audio even if the user
+   * pauses speaking) until the client closes the input stream (gRPC API) or
+   * until the maximum time limit has been reached. May return multiple
+   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
+   * If `true`, the recognizer will detect a single spoken utterance. When it
+   * detects that the user has paused or stopped speaking, it will return an
+   * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
+   * more than one `StreamingRecognitionResult` with the `is_final` flag set to
+   * `true`.
+   * The `single_utterance` field can only be used with specified models,
+   * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
+   * must be set to:
+   * * `command_and_search`
+   * * `phone_call` AND additional field `useEnhanced`=`true`
+   * * The `model` field is left undefined. In this case the API auto-selects
+   *   a model based on any other parameters that you set in
+   *   `RecognitionConfig`.
+   * 
+ * + * bool single_utterance = 2; + * @return The singleUtterance. + */ + boolean getSingleUtterance(); + + /** + *
+   * If `true`, interim results (tentative hypotheses) may be
+   * returned as they become available (these interim results are indicated with
+   * the `is_final=false` flag).
+   * If `false` or omitted, only `is_final=true` result(s) are returned.
+   * 
+ * + * bool interim_results = 3; + * @return The interimResults. + */ + boolean getInterimResults(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResult.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResult.java new file mode 100644 index 000000000000..21fdf7d844b0 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResult.java @@ -0,0 +1,1654 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * A streaming speech recognition result corresponding to a portion of the audio
+ * that is currently being processed.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognitionResult} + */ +public final class StreamingRecognitionResult extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) + StreamingRecognitionResultOrBuilder { +private static final long serialVersionUID = 0L; + // Use StreamingRecognitionResult.newBuilder() to construct. + private StreamingRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StreamingRecognitionResult() { + alternatives_ = java.util.Collections.emptyList(); + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StreamingRecognitionResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StreamingRecognitionResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + alternatives_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + alternatives_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.parser(), extensionRegistry)); + break; + } + case 16: { + + isFinal_ = input.readBool(); + break; + } + case 29: { + + stability_ = input.readFloat(); + break; + } + case 34: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (resultEndTime_ != null) { + subBuilder = resultEndTime_.toBuilder(); + } + resultEndTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resultEndTime_); + resultEndTime_ = subBuilder.buildPartial(); + } + + break; + } + case 40: { + + channelTag_ = input.readInt32(); + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + alternatives_ = java.util.Collections.unmodifiableList(alternatives_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.class, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder.class); + } + + public static final int ALTERNATIVES_FIELD_NUMBER = 1; + private java.util.List alternatives_; + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public java.util.List getAlternativesList() { + return alternatives_; + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public java.util.List + getAlternativesOrBuilderList() { + return alternatives_; + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public int getAlternativesCount() { + return alternatives_.size(); + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index) { + return alternatives_.get(index); + } + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( + int index) { + return alternatives_.get(index); + } + + public static final int IS_FINAL_FIELD_NUMBER = 2; + private boolean isFinal_; + /** + *
+   * If `false`, this `StreamingRecognitionResult` represents an
+   * interim result that may change. If `true`, this is the final time the
+   * speech service will return this particular `StreamingRecognitionResult`,
+   * the recognizer will not return any further hypotheses for this portion of
+   * the transcript and corresponding audio.
+   * 
+ * + * bool is_final = 2; + * @return The isFinal. + */ + @java.lang.Override + public boolean getIsFinal() { + return isFinal_; + } + + public static final int STABILITY_FIELD_NUMBER = 3; + private float stability_; + /** + *
+   * An estimate of the likelihood that the recognizer will not
+   * change its guess about this interim result. Values range from 0.0
+   * (completely unstable) to 1.0 (completely stable).
+   * This field is only provided for interim results (`is_final=false`).
+   * The default of 0.0 is a sentinel value indicating `stability` was not set.
+   * 
+ * + * float stability = 3; + * @return The stability. + */ + @java.lang.Override + public float getStability() { + return stability_; + } + + public static final int RESULT_END_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Duration resultEndTime_; + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return Whether the resultEndTime field is set. + */ + @java.lang.Override + public boolean hasResultEndTime() { + return resultEndTime_ != null; + } + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return The resultEndTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getResultEndTime() { + return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; + } + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { + return getResultEndTime(); + } + + public static final int CHANNEL_TAG_FIELD_NUMBER = 5; + private int channelTag_; + /** + *
+   * For multi-channel audio, this is the channel number corresponding to the
+   * recognized result for the audio from that channel.
+   * For audio_channel_count = N, its output values can range from '1' to 'N'.
+   * 
+ * + * int32 channel_tag = 5; + * @return The channelTag. + */ + @java.lang.Override + public int getChannelTag() { + return channelTag_; + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 6; + private volatile java.lang.Object languageCode_; + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The languageCode. + */ + @java.lang.Override + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } + } + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for languageCode. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < alternatives_.size(); i++) { + output.writeMessage(1, alternatives_.get(i)); + } + if (isFinal_ != false) { + output.writeBool(2, isFinal_); + } + if (java.lang.Float.floatToRawIntBits(stability_) != 0) { + output.writeFloat(3, stability_); + } + if (resultEndTime_ != null) { + output.writeMessage(4, getResultEndTime()); + } + if (channelTag_ != 0) { + output.writeInt32(5, channelTag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, languageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < alternatives_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, alternatives_.get(i)); + } + if (isFinal_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, isFinal_); + } + if (java.lang.Float.floatToRawIntBits(stability_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, stability_); + } + if (resultEndTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getResultEndTime()); + } + if (channelTag_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, channelTag_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, languageCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult other = (com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult) obj; + + if (!getAlternativesList() + .equals(other.getAlternativesList())) return false; + if (getIsFinal() + != other.getIsFinal()) return false; + if (java.lang.Float.floatToIntBits(getStability()) + != java.lang.Float.floatToIntBits( + other.getStability())) return false; + if (hasResultEndTime() != other.hasResultEndTime()) return false; + if (hasResultEndTime()) { + if (!getResultEndTime() + .equals(other.getResultEndTime())) return false; + } + if (getChannelTag() + != other.getChannelTag()) return false; + if (!getLanguageCode() + .equals(other.getLanguageCode())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAlternativesCount() > 0) { + hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; + hash = (53 * hash) + getAlternativesList().hashCode(); + } + hash = (37 * hash) + IS_FINAL_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsFinal()); + hash = (37 * hash) + STABILITY_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getStability()); + if (hasResultEndTime()) { + hash = (37 * hash) + RESULT_END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getResultEndTime().hashCode(); + } + hash = (37 * hash) + CHANNEL_TAG_FIELD_NUMBER; + hash = (53 * hash) + getChannelTag(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A streaming speech recognition result corresponding to a portion of the audio
+   * that is currently being processed.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognitionResult} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.class, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAlternativesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (alternativesBuilder_ == null) { + alternatives_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + alternativesBuilder_.clear(); + } + isFinal_ = false; + + stability_ = 0F; + + if (resultEndTimeBuilder_ == null) { + resultEndTime_ = null; + } else { + resultEndTime_ = null; + resultEndTimeBuilder_ = null; + } + channelTag_ = 0; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult build() { + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult buildPartial() { + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult result = new com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult(this); + int from_bitField0_ = bitField0_; + if (alternativesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + alternatives_ = java.util.Collections.unmodifiableList(alternatives_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.alternatives_ = alternatives_; + } else { + result.alternatives_ = alternativesBuilder_.build(); + } + result.isFinal_ = isFinal_; + result.stability_ = stability_; + if (resultEndTimeBuilder_ == null) { + result.resultEndTime_ = resultEndTime_; + } else { + result.resultEndTime_ = resultEndTimeBuilder_.build(); + } + result.channelTag_ = channelTag_; + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult other) { + if (other == com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.getDefaultInstance()) return this; + if (alternativesBuilder_ == null) { + if (!other.alternatives_.isEmpty()) { + if (alternatives_.isEmpty()) { + alternatives_ = other.alternatives_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAlternativesIsMutable(); + alternatives_.addAll(other.alternatives_); + } + onChanged(); + } + } else { + if (!other.alternatives_.isEmpty()) { + if (alternativesBuilder_.isEmpty()) { + alternativesBuilder_.dispose(); + alternativesBuilder_ = null; + alternatives_ = other.alternatives_; + bitField0_ = (bitField0_ & ~0x00000001); + alternativesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAlternativesFieldBuilder() : null; + } else { + alternativesBuilder_.addAllMessages(other.alternatives_); + } + } + } + if (other.getIsFinal() != false) { + setIsFinal(other.getIsFinal()); + } + if (other.getStability() != 0F) { + setStability(other.getStability()); + } + if (other.hasResultEndTime()) { + mergeResultEndTime(other.getResultEndTime()); + } + if (other.getChannelTag() != 0) { + setChannelTag(other.getChannelTag()); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List alternatives_ = + java.util.Collections.emptyList(); + private void ensureAlternativesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + alternatives_ = new java.util.ArrayList(alternatives_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> alternativesBuilder_; + + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public java.util.List getAlternativesList() { + if (alternativesBuilder_ == null) { + return java.util.Collections.unmodifiableList(alternatives_); + } else { + return alternativesBuilder_.getMessageList(); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public int getAlternativesCount() { + if (alternativesBuilder_ == null) { + return alternatives_.size(); + } else { + return alternativesBuilder_.getCount(); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index) { + if (alternativesBuilder_ == null) { + return alternatives_.get(index); + } else { + return alternativesBuilder_.getMessage(index); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder setAlternatives( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { + if (alternativesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativesIsMutable(); + alternatives_.set(index, value); + onChanged(); + } else { + alternativesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder setAlternatives( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.set(index, builderForValue.build()); + onChanged(); + } else { + alternativesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { + if (alternativesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativesIsMutable(); + alternatives_.add(value); + onChanged(); + } else { + alternativesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { + if (alternativesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAlternativesIsMutable(); + alternatives_.add(index, value); + onChanged(); + } else { + alternativesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives( + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.add(builderForValue.build()); + onChanged(); + } else { + alternativesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAlternatives( + int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.add(index, builderForValue.build()); + onChanged(); + } else { + alternativesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder addAllAlternatives( + java.lang.Iterable values) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, alternatives_); + onChanged(); + } else { + alternativesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder clearAlternatives() { + if (alternativesBuilder_ == null) { + alternatives_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + alternativesBuilder_.clear(); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public Builder removeAlternatives(int index) { + if (alternativesBuilder_ == null) { + ensureAlternativesIsMutable(); + alternatives_.remove(index); + onChanged(); + } else { + alternativesBuilder_.remove(index); + } + return this; + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder getAlternativesBuilder( + int index) { + return getAlternativesFieldBuilder().getBuilder(index); + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( + int index) { + if (alternativesBuilder_ == null) { + return alternatives_.get(index); } else { + return alternativesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public java.util.List + getAlternativesOrBuilderList() { + if (alternativesBuilder_ != null) { + return alternativesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(alternatives_); + } + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder addAlternativesBuilder() { + return getAlternativesFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()); + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder addAlternativesBuilder( + int index) { + return getAlternativesFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()); + } + /** + *
+     * May contain one or more recognition hypotheses (up to the
+     * maximum specified in `max_alternatives`).
+     * These alternatives are ordered in terms of accuracy, with the top (first)
+     * alternative being the most probable, as ranked by the recognizer.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + public java.util.List + getAlternativesBuilderList() { + return getAlternativesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> + getAlternativesFieldBuilder() { + if (alternativesBuilder_ == null) { + alternativesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder>( + alternatives_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + alternatives_ = null; + } + return alternativesBuilder_; + } + + private boolean isFinal_ ; + /** + *
+     * If `false`, this `StreamingRecognitionResult` represents an
+     * interim result that may change. If `true`, this is the final time the
+     * speech service will return this particular `StreamingRecognitionResult`,
+     * the recognizer will not return any further hypotheses for this portion of
+     * the transcript and corresponding audio.
+     * 
+ * + * bool is_final = 2; + * @return The isFinal. + */ + @java.lang.Override + public boolean getIsFinal() { + return isFinal_; + } + /** + *
+     * If `false`, this `StreamingRecognitionResult` represents an
+     * interim result that may change. If `true`, this is the final time the
+     * speech service will return this particular `StreamingRecognitionResult`,
+     * the recognizer will not return any further hypotheses for this portion of
+     * the transcript and corresponding audio.
+     * 
+ * + * bool is_final = 2; + * @param value The isFinal to set. + * @return This builder for chaining. + */ + public Builder setIsFinal(boolean value) { + + isFinal_ = value; + onChanged(); + return this; + } + /** + *
+     * If `false`, this `StreamingRecognitionResult` represents an
+     * interim result that may change. If `true`, this is the final time the
+     * speech service will return this particular `StreamingRecognitionResult`,
+     * the recognizer will not return any further hypotheses for this portion of
+     * the transcript and corresponding audio.
+     * 
+ * + * bool is_final = 2; + * @return This builder for chaining. + */ + public Builder clearIsFinal() { + + isFinal_ = false; + onChanged(); + return this; + } + + private float stability_ ; + /** + *
+     * An estimate of the likelihood that the recognizer will not
+     * change its guess about this interim result. Values range from 0.0
+     * (completely unstable) to 1.0 (completely stable).
+     * This field is only provided for interim results (`is_final=false`).
+     * The default of 0.0 is a sentinel value indicating `stability` was not set.
+     * 
+ * + * float stability = 3; + * @return The stability. + */ + @java.lang.Override + public float getStability() { + return stability_; + } + /** + *
+     * An estimate of the likelihood that the recognizer will not
+     * change its guess about this interim result. Values range from 0.0
+     * (completely unstable) to 1.0 (completely stable).
+     * This field is only provided for interim results (`is_final=false`).
+     * The default of 0.0 is a sentinel value indicating `stability` was not set.
+     * 
+ * + * float stability = 3; + * @param value The stability to set. + * @return This builder for chaining. + */ + public Builder setStability(float value) { + + stability_ = value; + onChanged(); + return this; + } + /** + *
+     * An estimate of the likelihood that the recognizer will not
+     * change its guess about this interim result. Values range from 0.0
+     * (completely unstable) to 1.0 (completely stable).
+     * This field is only provided for interim results (`is_final=false`).
+     * The default of 0.0 is a sentinel value indicating `stability` was not set.
+     * 
+ * + * float stability = 3; + * @return This builder for chaining. + */ + public Builder clearStability() { + + stability_ = 0F; + onChanged(); + return this; + } + + private com.google.protobuf.Duration resultEndTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> resultEndTimeBuilder_; + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return Whether the resultEndTime field is set. + */ + public boolean hasResultEndTime() { + return resultEndTimeBuilder_ != null || resultEndTime_ != null; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return The resultEndTime. + */ + public com.google.protobuf.Duration getResultEndTime() { + if (resultEndTimeBuilder_ == null) { + return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; + } else { + return resultEndTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder setResultEndTime(com.google.protobuf.Duration value) { + if (resultEndTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resultEndTime_ = value; + onChanged(); + } else { + resultEndTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder setResultEndTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (resultEndTimeBuilder_ == null) { + resultEndTime_ = builderForValue.build(); + onChanged(); + } else { + resultEndTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder mergeResultEndTime(com.google.protobuf.Duration value) { + if (resultEndTimeBuilder_ == null) { + if (resultEndTime_ != null) { + resultEndTime_ = + com.google.protobuf.Duration.newBuilder(resultEndTime_).mergeFrom(value).buildPartial(); + } else { + resultEndTime_ = value; + } + onChanged(); + } else { + resultEndTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public Builder clearResultEndTime() { + if (resultEndTimeBuilder_ == null) { + resultEndTime_ = null; + onChanged(); + } else { + resultEndTime_ = null; + resultEndTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public com.google.protobuf.Duration.Builder getResultEndTimeBuilder() { + + onChanged(); + return getResultEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { + if (resultEndTimeBuilder_ != null) { + return resultEndTimeBuilder_.getMessageOrBuilder(); + } else { + return resultEndTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; + } + } + /** + *
+     * Time offset of the end of this result relative to the
+     * beginning of the audio.
+     * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getResultEndTimeFieldBuilder() { + if (resultEndTimeBuilder_ == null) { + resultEndTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getResultEndTime(), + getParentForChildren(), + isClean()); + resultEndTime_ = null; + } + return resultEndTimeBuilder_; + } + + private int channelTag_ ; + /** + *
+     * For multi-channel audio, this is the channel number corresponding to the
+     * recognized result for the audio from that channel.
+     * For audio_channel_count = N, its output values can range from '1' to 'N'.
+     * 
+ * + * int32 channel_tag = 5; + * @return The channelTag. + */ + @java.lang.Override + public int getChannelTag() { + return channelTag_; + } + /** + *
+     * For multi-channel audio, this is the channel number corresponding to the
+     * recognized result for the audio from that channel.
+     * For audio_channel_count = N, its output values can range from '1' to 'N'.
+     * 
+ * + * int32 channel_tag = 5; + * @param value The channelTag to set. + * @return This builder for chaining. + */ + public Builder setChannelTag(int value) { + + channelTag_ = value; + onChanged(); + return this; + } + /** + *
+     * For multi-channel audio, this is the channel number corresponding to the
+     * recognized result for the audio from that channel.
+     * For audio_channel_count = N, its output values can range from '1' to 'N'.
+     * 
+ * + * int32 channel_tag = 5; + * @return This builder for chaining. + */ + public Builder clearChannelTag() { + + channelTag_ = 0; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The languageCode. + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for languageCode. + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + *
+     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+     * of the language in this result. This language code was detected to have
+     * the most likelihood of being spoken in the audio.
+     * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The bytes for languageCode to set. + * @return This builder for chaining. + */ + public Builder setLanguageCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) + private static final com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult(); + } + + public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingRecognitionResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingRecognitionResult(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResultOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResultOrBuilder.java new file mode 100644 index 000000000000..3d6da9c0a6f4 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResultOrBuilder.java @@ -0,0 +1,162 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface StreamingRecognitionResultOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + java.util.List + getAlternativesList(); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + int getAlternativesCount(); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + java.util.List + getAlternativesOrBuilderList(); + /** + *
+   * May contain one or more recognition hypotheses (up to the
+   * maximum specified in `max_alternatives`).
+   * These alternatives are ordered in terms of accuracy, with the top (first)
+   * alternative being the most probable, as ranked by the recognizer.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; + */ + com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( + int index); + + /** + *
+   * If `false`, this `StreamingRecognitionResult` represents an
+   * interim result that may change. If `true`, this is the final time the
+   * speech service will return this particular `StreamingRecognitionResult`,
+   * the recognizer will not return any further hypotheses for this portion of
+   * the transcript and corresponding audio.
+   * 
+ * + * bool is_final = 2; + * @return The isFinal. + */ + boolean getIsFinal(); + + /** + *
+   * An estimate of the likelihood that the recognizer will not
+   * change its guess about this interim result. Values range from 0.0
+   * (completely unstable) to 1.0 (completely stable).
+   * This field is only provided for interim results (`is_final=false`).
+   * The default of 0.0 is a sentinel value indicating `stability` was not set.
+   * 
+ * + * float stability = 3; + * @return The stability. + */ + float getStability(); + + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return Whether the resultEndTime field is set. + */ + boolean hasResultEndTime(); + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + * @return The resultEndTime. + */ + com.google.protobuf.Duration getResultEndTime(); + /** + *
+   * Time offset of the end of this result relative to the
+   * beginning of the audio.
+   * 
+ * + * .google.protobuf.Duration result_end_time = 4; + */ + com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder(); + + /** + *
+   * For multi-channel audio, this is the channel number corresponding to the
+   * recognized result for the audio from that channel.
+   * For audio_channel_count = N, its output values can range from '1' to 'N'.
+   * 
+ * + * int32 channel_tag = 5; + * @return The channelTag. + */ + int getChannelTag(); + + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + *
+   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
+   * of the language in this result. This language code was detected to have
+   * the most likelihood of being spoken in the audio.
+   * 
+ * + * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString + getLanguageCodeBytes(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequest.java new file mode 100644 index 000000000000..5c7c200e1200 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequest.java @@ -0,0 +1,955 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * The top-level message sent by the client for the `StreamingRecognize` method.
+ * Multiple `StreamingRecognizeRequest` messages are sent. The first message
+ * must contain a `streaming_config` message and must not contain
+ * `audio_content`. All subsequent messages must contain `audio_content` and
+ * must not contain a `streaming_config` message.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} + */ +public final class StreamingRecognizeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) + StreamingRecognizeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use StreamingRecognizeRequest.newBuilder() to construct. + private StreamingRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StreamingRecognizeRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StreamingRecognizeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StreamingRecognizeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder subBuilder = null; + if (streamingRequestCase_ == 1) { + subBuilder = ((com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_).toBuilder(); + } + streamingRequest_ = + input.readMessage(com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_); + streamingRequest_ = subBuilder.buildPartial(); + } + streamingRequestCase_ = 1; + break; + } + case 18: { + streamingRequest_ = input.readBytes(); + streamingRequestCase_ = 2; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.class, com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.Builder.class); + } + + private int streamingRequestCase_ = 0; + private java.lang.Object streamingRequest_; + public enum StreamingRequestCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STREAMING_CONFIG(1), + AUDIO_CONTENT(2), + STREAMINGREQUEST_NOT_SET(0); + private final int value; + private StreamingRequestCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StreamingRequestCase valueOf(int value) { + return forNumber(value); + } + + public static StreamingRequestCase forNumber(int value) { + switch (value) { + case 1: return STREAMING_CONFIG; + case 2: return AUDIO_CONTENT; + case 0: return STREAMINGREQUEST_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public StreamingRequestCase + getStreamingRequestCase() { + return StreamingRequestCase.forNumber( + streamingRequestCase_); + } + + public static final int STREAMING_CONFIG_FIELD_NUMBER = 1; + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request. The first `StreamingRecognizeRequest` message must contain a
+   * `streaming_config`  message.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + * @return Whether the streamingConfig field is set. + */ + @java.lang.Override + public boolean hasStreamingConfig() { + return streamingRequestCase_ == 1; + } + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request. The first `StreamingRecognizeRequest` message must contain a
+   * `streaming_config`  message.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + * @return The streamingConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getStreamingConfig() { + if (streamingRequestCase_ == 1) { + return (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_; + } + return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); + } + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request. The first `StreamingRecognizeRequest` message must contain a
+   * `streaming_config`  message.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder() { + if (streamingRequestCase_ == 1) { + return (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_; + } + return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); + } + + public static final int AUDIO_CONTENT_FIELD_NUMBER = 2; + /** + *
+   * The audio data to be recognized. Sequential chunks of audio data are sent
+   * in sequential `StreamingRecognizeRequest` messages. The first
+   * `StreamingRecognizeRequest` message must not contain `audio_content` data
+   * and all subsequent `StreamingRecognizeRequest` messages must contain
+   * `audio_content` data. The audio bytes must be encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation (not base64). See
+   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * 
+ * + * bytes audio_content = 2; + * @return Whether the audioContent field is set. + */ + @java.lang.Override + public boolean hasAudioContent() { + return streamingRequestCase_ == 2; + } + /** + *
+   * The audio data to be recognized. Sequential chunks of audio data are sent
+   * in sequential `StreamingRecognizeRequest` messages. The first
+   * `StreamingRecognizeRequest` message must not contain `audio_content` data
+   * and all subsequent `StreamingRecognizeRequest` messages must contain
+   * `audio_content` data. The audio bytes must be encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation (not base64). See
+   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * 
+ * + * bytes audio_content = 2; + * @return The audioContent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAudioContent() { + if (streamingRequestCase_ == 2) { + return (com.google.protobuf.ByteString) streamingRequest_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (streamingRequestCase_ == 1) { + output.writeMessage(1, (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_); + } + if (streamingRequestCase_ == 2) { + output.writeBytes( + 2, (com.google.protobuf.ByteString) streamingRequest_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (streamingRequestCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_); + } + if (streamingRequestCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize( + 2, (com.google.protobuf.ByteString) streamingRequest_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest other = (com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) obj; + + if (!getStreamingRequestCase().equals(other.getStreamingRequestCase())) return false; + switch (streamingRequestCase_) { + case 1: + if (!getStreamingConfig() + .equals(other.getStreamingConfig())) return false; + break; + case 2: + if (!getAudioContent() + .equals(other.getAudioContent())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (streamingRequestCase_) { + case 1: + hash = (37 * hash) + STREAMING_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getStreamingConfig().hashCode(); + break; + case 2: + hash = (37 * hash) + AUDIO_CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getAudioContent().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The top-level message sent by the client for the `StreamingRecognize` method.
+   * Multiple `StreamingRecognizeRequest` messages are sent. The first message
+   * must contain a `streaming_config` message and must not contain
+   * `audio_content`. All subsequent messages must contain `audio_content` and
+   * must not contain a `streaming_config` message.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) + com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.class, com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + streamingRequestCase_ = 0; + streamingRequest_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest build() { + com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest result = new com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest(this); + if (streamingRequestCase_ == 1) { + if (streamingConfigBuilder_ == null) { + result.streamingRequest_ = streamingRequest_; + } else { + result.streamingRequest_ = streamingConfigBuilder_.build(); + } + } + if (streamingRequestCase_ == 2) { + result.streamingRequest_ = streamingRequest_; + } + result.streamingRequestCase_ = streamingRequestCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.getDefaultInstance()) return this; + switch (other.getStreamingRequestCase()) { + case STREAMING_CONFIG: { + mergeStreamingConfig(other.getStreamingConfig()); + break; + } + case AUDIO_CONTENT: { + setAudioContent(other.getAudioContent()); + break; + } + case STREAMINGREQUEST_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int streamingRequestCase_ = 0; + private java.lang.Object streamingRequest_; + public StreamingRequestCase + getStreamingRequestCase() { + return StreamingRequestCase.forNumber( + streamingRequestCase_); + } + + public Builder clearStreamingRequest() { + streamingRequestCase_ = 0; + streamingRequest_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder> streamingConfigBuilder_; + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + * @return Whether the streamingConfig field is set. + */ + @java.lang.Override + public boolean hasStreamingConfig() { + return streamingRequestCase_ == 1; + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + * @return The streamingConfig. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getStreamingConfig() { + if (streamingConfigBuilder_ == null) { + if (streamingRequestCase_ == 1) { + return (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_; + } + return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); + } else { + if (streamingRequestCase_ == 1) { + return streamingConfigBuilder_.getMessage(); + } + return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); + } + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + */ + public Builder setStreamingConfig(com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig value) { + if (streamingConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamingRequest_ = value; + onChanged(); + } else { + streamingConfigBuilder_.setMessage(value); + } + streamingRequestCase_ = 1; + return this; + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + */ + public Builder setStreamingConfig( + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder builderForValue) { + if (streamingConfigBuilder_ == null) { + streamingRequest_ = builderForValue.build(); + onChanged(); + } else { + streamingConfigBuilder_.setMessage(builderForValue.build()); + } + streamingRequestCase_ = 1; + return this; + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + */ + public Builder mergeStreamingConfig(com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig value) { + if (streamingConfigBuilder_ == null) { + if (streamingRequestCase_ == 1 && + streamingRequest_ != com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance()) { + streamingRequest_ = com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.newBuilder((com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_) + .mergeFrom(value).buildPartial(); + } else { + streamingRequest_ = value; + } + onChanged(); + } else { + if (streamingRequestCase_ == 1) { + streamingConfigBuilder_.mergeFrom(value); + } else { + streamingConfigBuilder_.setMessage(value); + } + } + streamingRequestCase_ = 1; + return this; + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + */ + public Builder clearStreamingConfig() { + if (streamingConfigBuilder_ == null) { + if (streamingRequestCase_ == 1) { + streamingRequestCase_ = 0; + streamingRequest_ = null; + onChanged(); + } + } else { + if (streamingRequestCase_ == 1) { + streamingRequestCase_ = 0; + streamingRequest_ = null; + } + streamingConfigBuilder_.clear(); + } + return this; + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + */ + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder getStreamingConfigBuilder() { + return getStreamingConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder() { + if ((streamingRequestCase_ == 1) && (streamingConfigBuilder_ != null)) { + return streamingConfigBuilder_.getMessageOrBuilder(); + } else { + if (streamingRequestCase_ == 1) { + return (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_; + } + return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); + } + } + /** + *
+     * Provides information to the recognizer that specifies how to process the
+     * request. The first `StreamingRecognizeRequest` message must contain a
+     * `streaming_config`  message.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder> + getStreamingConfigFieldBuilder() { + if (streamingConfigBuilder_ == null) { + if (!(streamingRequestCase_ == 1)) { + streamingRequest_ = com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); + } + streamingConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder>( + (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_, + getParentForChildren(), + isClean()); + streamingRequest_ = null; + } + streamingRequestCase_ = 1; + onChanged();; + return streamingConfigBuilder_; + } + + /** + *
+     * The audio data to be recognized. Sequential chunks of audio data are sent
+     * in sequential `StreamingRecognizeRequest` messages. The first
+     * `StreamingRecognizeRequest` message must not contain `audio_content` data
+     * and all subsequent `StreamingRecognizeRequest` messages must contain
+     * `audio_content` data. The audio bytes must be encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation (not base64). See
+     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * 
+ * + * bytes audio_content = 2; + * @return Whether the audioContent field is set. + */ + public boolean hasAudioContent() { + return streamingRequestCase_ == 2; + } + /** + *
+     * The audio data to be recognized. Sequential chunks of audio data are sent
+     * in sequential `StreamingRecognizeRequest` messages. The first
+     * `StreamingRecognizeRequest` message must not contain `audio_content` data
+     * and all subsequent `StreamingRecognizeRequest` messages must contain
+     * `audio_content` data. The audio bytes must be encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation (not base64). See
+     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * 
+ * + * bytes audio_content = 2; + * @return The audioContent. + */ + public com.google.protobuf.ByteString getAudioContent() { + if (streamingRequestCase_ == 2) { + return (com.google.protobuf.ByteString) streamingRequest_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + *
+     * The audio data to be recognized. Sequential chunks of audio data are sent
+     * in sequential `StreamingRecognizeRequest` messages. The first
+     * `StreamingRecognizeRequest` message must not contain `audio_content` data
+     * and all subsequent `StreamingRecognizeRequest` messages must contain
+     * `audio_content` data. The audio bytes must be encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation (not base64). See
+     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * 
+ * + * bytes audio_content = 2; + * @param value The audioContent to set. + * @return This builder for chaining. + */ + public Builder setAudioContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + streamingRequestCase_ = 2; + streamingRequest_ = value; + onChanged(); + return this; + } + /** + *
+     * The audio data to be recognized. Sequential chunks of audio data are sent
+     * in sequential `StreamingRecognizeRequest` messages. The first
+     * `StreamingRecognizeRequest` message must not contain `audio_content` data
+     * and all subsequent `StreamingRecognizeRequest` messages must contain
+     * `audio_content` data. The audio bytes must be encoded as specified in
+     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+     * pure binary representation (not base64). See
+     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+     * 
+ * + * bytes audio_content = 2; + * @return This builder for chaining. + */ + public Builder clearAudioContent() { + if (streamingRequestCase_ == 2) { + streamingRequestCase_ = 0; + streamingRequest_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) + private static final com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingRecognizeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingRecognizeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java new file mode 100644 index 000000000000..e77bf66cfcba --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java @@ -0,0 +1,77 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface StreamingRecognizeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request. The first `StreamingRecognizeRequest` message must contain a
+   * `streaming_config`  message.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + * @return Whether the streamingConfig field is set. + */ + boolean hasStreamingConfig(); + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request. The first `StreamingRecognizeRequest` message must contain a
+   * `streaming_config`  message.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + * @return The streamingConfig. + */ + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getStreamingConfig(); + /** + *
+   * Provides information to the recognizer that specifies how to process the
+   * request. The first `StreamingRecognizeRequest` message must contain a
+   * `streaming_config`  message.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; + */ + com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder(); + + /** + *
+   * The audio data to be recognized. Sequential chunks of audio data are sent
+   * in sequential `StreamingRecognizeRequest` messages. The first
+   * `StreamingRecognizeRequest` message must not contain `audio_content` data
+   * and all subsequent `StreamingRecognizeRequest` messages must contain
+   * `audio_content` data. The audio bytes must be encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation (not base64). See
+   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * 
+ * + * bytes audio_content = 2; + * @return Whether the audioContent field is set. + */ + boolean hasAudioContent(); + /** + *
+   * The audio data to be recognized. Sequential chunks of audio data are sent
+   * in sequential `StreamingRecognizeRequest` messages. The first
+   * `StreamingRecognizeRequest` message must not contain `audio_content` data
+   * and all subsequent `StreamingRecognizeRequest` messages must contain
+   * `audio_content` data. The audio bytes must be encoded as specified in
+   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
+   * pure binary representation (not base64). See
+   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
+   * 
+ * + * bytes audio_content = 2; + * @return The audioContent. + */ + com.google.protobuf.ByteString getAudioContent(); + + public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.StreamingRequestCase getStreamingRequestCase(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java new file mode 100644 index 000000000000..cf81fdc8c87a --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java @@ -0,0 +1,1771 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * `StreamingRecognizeResponse` is the only message returned to the client by
+ * `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
+ * messages are streamed back to the client. If there is no recognizable
+ * audio, and `single_utterance` is set to false, then no messages are streamed
+ * back to the client.
+ * Here's an example of a series of `StreamingRecognizeResponse`s that might be
+ * returned while processing audio:
+ * 1. results { alternatives { transcript: "tube" } stability: 0.01 }
+ * 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
+ * 3. results { alternatives { transcript: "to be" } stability: 0.9 }
+ *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
+ * 4. results { alternatives { transcript: "to be or not to be"
+ *                             confidence: 0.92 }
+ *              alternatives { transcript: "to bee or not to bee" }
+ *              is_final: true }
+ * 5. results { alternatives { transcript: " that's" } stability: 0.01 }
+ * 6. results { alternatives { transcript: " that is" } stability: 0.9 }
+ *    results { alternatives { transcript: " the question" } stability: 0.01 }
+ * 7. results { alternatives { transcript: " that is the question"
+ *                             confidence: 0.98 }
+ *              alternatives { transcript: " that was the question" }
+ *              is_final: true }
+ * Notes:
+ * - Only two of the above responses #4 and #7 contain final results; they are
+ *   indicated by `is_final: true`. Concatenating these together generates the
+ *   full transcript: "to be or not to be that is the question".
+ * - The others contain interim `results`. #3 and #6 contain two interim
+ *   `results`: the first portion has a high stability and is less likely to
+ *   change; the second portion has a low stability and is very likely to
+ *   change. A UI designer might choose to show only high stability `results`.
+ * - The specific `stability` and `confidence` values shown above are only for
+ *   illustrative purposes. Actual values may vary.
+ * - In each response, only one of these fields will be set:
+ *     `error`,
+ *     `speech_event_type`, or
+ *     one or more (repeated) `results`.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} + */ +public final class StreamingRecognizeResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) + StreamingRecognizeResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use StreamingRecognizeResponse.newBuilder() to construct. + private StreamingRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StreamingRecognizeResponse() { + results_ = java.util.Collections.emptyList(); + speechEventType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StreamingRecognizeResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StreamingRecognizeResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.rpc.Status.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + results_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.parser(), extensionRegistry)); + break; + } + case 32: { + int rawValue = input.readEnum(); + + speechEventType_ = rawValue; + break; + } + case 42: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (totalBilledTime_ != null) { + subBuilder = totalBilledTime_.toBuilder(); + } + totalBilledTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(totalBilledTime_); + totalBilledTime_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.class, com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.Builder.class); + } + + /** + *
+   * Indicates the type of speech event.
+   * 
+ * + * Protobuf enum {@code google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType} + */ + public enum SpeechEventType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * No speech event specified.
+     * 
+ * + * SPEECH_EVENT_UNSPECIFIED = 0; + */ + SPEECH_EVENT_UNSPECIFIED(0), + /** + *
+     * This event indicates that the server has detected the end of the user's
+     * speech utterance and expects no additional speech. Therefore, the server
+     * will not process additional audio (although it may subsequently return
+     * additional results). The client should stop sending additional audio
+     * data, half-close the gRPC connection, and wait for any additional results
+     * until the server closes the gRPC connection. This event is only sent if
+     * `single_utterance` was set to `true`, and is not used otherwise.
+     * 
+ * + * END_OF_SINGLE_UTTERANCE = 1; + */ + END_OF_SINGLE_UTTERANCE(1), + UNRECOGNIZED(-1), + ; + + /** + *
+     * No speech event specified.
+     * 
+ * + * SPEECH_EVENT_UNSPECIFIED = 0; + */ + public static final int SPEECH_EVENT_UNSPECIFIED_VALUE = 0; + /** + *
+     * This event indicates that the server has detected the end of the user's
+     * speech utterance and expects no additional speech. Therefore, the server
+     * will not process additional audio (although it may subsequently return
+     * additional results). The client should stop sending additional audio
+     * data, half-close the gRPC connection, and wait for any additional results
+     * until the server closes the gRPC connection. This event is only sent if
+     * `single_utterance` was set to `true`, and is not used otherwise.
+     * 
+ * + * END_OF_SINGLE_UTTERANCE = 1; + */ + public static final int END_OF_SINGLE_UTTERANCE_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SpeechEventType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static SpeechEventType forNumber(int value) { + switch (value) { + case 0: return SPEECH_EVENT_UNSPECIFIED; + case 1: return END_OF_SINGLE_UTTERANCE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + SpeechEventType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public SpeechEventType findValueByNumber(int number) { + return SpeechEventType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.getDescriptor().getEnumTypes().get(0); + } + + private static final SpeechEventType[] VALUES = values(); + + public static SpeechEventType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private SpeechEventType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType) + } + + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.rpc.Status error_; + /** + *
+   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+   * specifies the error for the operation.
+   * 
+ * + * .google.rpc.Status error = 1; + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + /** + *
+   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+   * specifies the error for the operation.
+   * 
+ * + * .google.rpc.Status error = 1; + * @return The error. + */ + @java.lang.Override + public com.google.rpc.Status getError() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + /** + *
+   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+   * specifies the error for the operation.
+   * 
+ * + * .google.rpc.Status error = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + return getError(); + } + + public static final int RESULTS_FIELD_NUMBER = 2; + private java.util.List results_; + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + @java.lang.Override + public java.util.List getResultsList() { + return results_; + } + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + @java.lang.Override + public java.util.List + getResultsOrBuilderList() { + return results_; + } + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + @java.lang.Override + public int getResultsCount() { + return results_.size(); + } + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getResults(int index) { + return results_.get(index); + } + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( + int index) { + return results_.get(index); + } + + public static final int SPEECH_EVENT_TYPE_FIELD_NUMBER = 4; + private int speechEventType_; + /** + *
+   * Indicates the type of speech event.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return The enum numeric value on the wire for speechEventType. + */ + @java.lang.Override public int getSpeechEventTypeValue() { + return speechEventType_; + } + /** + *
+   * Indicates the type of speech event.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return The speechEventType. + */ + @java.lang.Override public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType result = com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.valueOf(speechEventType_); + return result == null ? com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.UNRECOGNIZED : result; + } + + public static final int TOTAL_BILLED_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Duration totalBilledTime_; + /** + *
+   * When available, billed audio seconds for the stream.
+   * Set only if this is the last response in the stream.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + * @return Whether the totalBilledTime field is set. + */ + @java.lang.Override + public boolean hasTotalBilledTime() { + return totalBilledTime_ != null; + } + /** + *
+   * When available, billed audio seconds for the stream.
+   * Set only if this is the last response in the stream.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + * @return The totalBilledTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getTotalBilledTime() { + return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } + /** + *
+   * When available, billed audio seconds for the stream.
+   * Set only if this is the last response in the stream.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { + return getTotalBilledTime(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (error_ != null) { + output.writeMessage(1, getError()); + } + for (int i = 0; i < results_.size(); i++) { + output.writeMessage(2, results_.get(i)); + } + if (speechEventType_ != com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.SPEECH_EVENT_UNSPECIFIED.getNumber()) { + output.writeEnum(4, speechEventType_); + } + if (totalBilledTime_ != null) { + output.writeMessage(5, getTotalBilledTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getError()); + } + for (int i = 0; i < results_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, results_.get(i)); + } + if (speechEventType_ != com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.SPEECH_EVENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, speechEventType_); + } + if (totalBilledTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getTotalBilledTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse other = (com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) obj; + + if (hasError() != other.hasError()) return false; + if (hasError()) { + if (!getError() + .equals(other.getError())) return false; + } + if (!getResultsList() + .equals(other.getResultsList())) return false; + if (speechEventType_ != other.speechEventType_) return false; + if (hasTotalBilledTime() != other.hasTotalBilledTime()) return false; + if (hasTotalBilledTime()) { + if (!getTotalBilledTime() + .equals(other.getTotalBilledTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + if (getResultsCount() > 0) { + hash = (37 * hash) + RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getResultsList().hashCode(); + } + hash = (37 * hash) + SPEECH_EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + speechEventType_; + if (hasTotalBilledTime()) { + hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; + hash = (53 * hash) + getTotalBilledTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * `StreamingRecognizeResponse` is the only message returned to the client by
+   * `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
+   * messages are streamed back to the client. If there is no recognizable
+   * audio, and `single_utterance` is set to false, then no messages are streamed
+   * back to the client.
+   * Here's an example of a series of `StreamingRecognizeResponse`s that might be
+   * returned while processing audio:
+   * 1. results { alternatives { transcript: "tube" } stability: 0.01 }
+   * 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
+   * 3. results { alternatives { transcript: "to be" } stability: 0.9 }
+   *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
+   * 4. results { alternatives { transcript: "to be or not to be"
+   *                             confidence: 0.92 }
+   *              alternatives { transcript: "to bee or not to bee" }
+   *              is_final: true }
+   * 5. results { alternatives { transcript: " that's" } stability: 0.01 }
+   * 6. results { alternatives { transcript: " that is" } stability: 0.9 }
+   *    results { alternatives { transcript: " the question" } stability: 0.01 }
+   * 7. results { alternatives { transcript: " that is the question"
+   *                             confidence: 0.98 }
+   *              alternatives { transcript: " that was the question" }
+   *              is_final: true }
+   * Notes:
+   * - Only two of the above responses #4 and #7 contain final results; they are
+   *   indicated by `is_final: true`. Concatenating these together generates the
+   *   full transcript: "to be or not to be that is the question".
+   * - The others contain interim `results`. #3 and #6 contain two interim
+   *   `results`: the first portion has a high stability and is less likely to
+   *   change; the second portion has a low stability and is very likely to
+   *   change. A UI designer might choose to show only high stability `results`.
+   * - The specific `stability` and `confidence` values shown above are only for
+   *   illustrative purposes. Actual values may vary.
+   * - In each response, only one of these fields will be set:
+   *     `error`,
+   *     `speech_event_type`, or
+   *     one or more (repeated) `results`.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) + com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.class, com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getResultsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (errorBuilder_ == null) { + error_ = null; + } else { + error_ = null; + errorBuilder_ = null; + } + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + resultsBuilder_.clear(); + } + speechEventType_ = 0; + + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = null; + } else { + totalBilledTime_ = null; + totalBilledTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse build() { + com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse buildPartial() { + com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse result = new com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse(this); + int from_bitField0_ = bitField0_; + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.build(); + } + if (resultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + results_ = java.util.Collections.unmodifiableList(results_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.results_ = results_; + } else { + result.results_ = resultsBuilder_.build(); + } + result.speechEventType_ = speechEventType_; + if (totalBilledTimeBuilder_ == null) { + result.totalBilledTime_ = totalBilledTime_; + } else { + result.totalBilledTime_ = totalBilledTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse other) { + if (other == com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.getDefaultInstance()) return this; + if (other.hasError()) { + mergeError(other.getError()); + } + if (resultsBuilder_ == null) { + if (!other.results_.isEmpty()) { + if (results_.isEmpty()) { + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResultsIsMutable(); + results_.addAll(other.results_); + } + onChanged(); + } + } else { + if (!other.results_.isEmpty()) { + if (resultsBuilder_.isEmpty()) { + resultsBuilder_.dispose(); + resultsBuilder_ = null; + results_ = other.results_; + bitField0_ = (bitField0_ & ~0x00000001); + resultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getResultsFieldBuilder() : null; + } else { + resultsBuilder_.addAllMessages(other.results_); + } + } + } + if (other.speechEventType_ != 0) { + setSpeechEventTypeValue(other.getSpeechEventTypeValue()); + } + if (other.hasTotalBilledTime()) { + mergeTotalBilledTime(other.getTotalBilledTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.rpc.Status error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + * @return The error. + */ + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + public Builder setError( + com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? + com.google.rpc.Status.getDefaultInstance() : error_; + } + } + /** + *
+     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+     * specifies the error for the operation.
+     * 
+ * + * .google.rpc.Status error = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getError(), + getParentForChildren(), + isClean()); + error_ = null; + } + return errorBuilder_; + } + + private java.util.List results_ = + java.util.Collections.emptyList(); + private void ensureResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + results_ = new java.util.ArrayList(results_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder> resultsBuilder_; + + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public java.util.List getResultsList() { + if (resultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(results_); + } else { + return resultsBuilder_.getMessageList(); + } + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public int getResultsCount() { + if (resultsBuilder_ == null) { + return results_.size(); + } else { + return resultsBuilder_.getCount(); + } + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getResults(int index) { + if (resultsBuilder_ == null) { + return results_.get(index); + } else { + return resultsBuilder_.getMessage(index); + } + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public Builder setResults( + int index, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.set(index, value); + onChanged(); + } else { + resultsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public Builder setResults( + int index, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.set(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public Builder addResults(com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(value); + onChanged(); + } else { + resultsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public Builder addResults( + int index, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult value) { + if (resultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResultsIsMutable(); + results_.add(index, value); + onChanged(); + } else { + resultsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public Builder addResults( + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public Builder addResults( + int index, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder builderForValue) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.add(index, builderForValue.build()); + onChanged(); + } else { + resultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public Builder addAllResults( + java.lang.Iterable values) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, results_); + onChanged(); + } else { + resultsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public Builder clearResults() { + if (resultsBuilder_ == null) { + results_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resultsBuilder_.clear(); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public Builder removeResults(int index) { + if (resultsBuilder_ == null) { + ensureResultsIsMutable(); + results_.remove(index); + onChanged(); + } else { + resultsBuilder_.remove(index); + } + return this; + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder getResultsBuilder( + int index) { + return getResultsFieldBuilder().getBuilder(index); + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( + int index) { + if (resultsBuilder_ == null) { + return results_.get(index); } else { + return resultsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public java.util.List + getResultsOrBuilderList() { + if (resultsBuilder_ != null) { + return resultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(results_); + } + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder addResultsBuilder() { + return getResultsFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.getDefaultInstance()); + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder addResultsBuilder( + int index) { + return getResultsFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.getDefaultInstance()); + } + /** + *
+     * This repeated list contains zero or more results that
+     * correspond to consecutive portions of the audio currently being processed.
+     * It contains zero or one `is_final=true` result (the newly settled portion),
+     * followed by zero or more `is_final=false` results (the interim results).
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + public java.util.List + getResultsBuilderList() { + return getResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder> + getResultsFieldBuilder() { + if (resultsBuilder_ == null) { + resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder>( + results_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + results_ = null; + } + return resultsBuilder_; + } + + private int speechEventType_ = 0; + /** + *
+     * Indicates the type of speech event.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return The enum numeric value on the wire for speechEventType. + */ + @java.lang.Override public int getSpeechEventTypeValue() { + return speechEventType_; + } + /** + *
+     * Indicates the type of speech event.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @param value The enum numeric value on the wire for speechEventType to set. + * @return This builder for chaining. + */ + public Builder setSpeechEventTypeValue(int value) { + + speechEventType_ = value; + onChanged(); + return this; + } + /** + *
+     * Indicates the type of speech event.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return The speechEventType. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType() { + @SuppressWarnings("deprecation") + com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType result = com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.valueOf(speechEventType_); + return result == null ? com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.UNRECOGNIZED : result; + } + /** + *
+     * Indicates the type of speech event.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @param value The speechEventType to set. + * @return This builder for chaining. + */ + public Builder setSpeechEventType(com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType value) { + if (value == null) { + throw new NullPointerException(); + } + + speechEventType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Indicates the type of speech event.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return This builder for chaining. + */ + public Builder clearSpeechEventType() { + + speechEventType_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Duration totalBilledTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalBilledTimeBuilder_; + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + * @return Whether the totalBilledTime field is set. + */ + public boolean hasTotalBilledTime() { + return totalBilledTimeBuilder_ != null || totalBilledTime_ != null; + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + * @return The totalBilledTime. + */ + public com.google.protobuf.Duration getTotalBilledTime() { + if (totalBilledTimeBuilder_ == null) { + return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } else { + return totalBilledTimeBuilder_.getMessage(); + } + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + public Builder setTotalBilledTime(com.google.protobuf.Duration value) { + if (totalBilledTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + totalBilledTime_ = value; + onChanged(); + } else { + totalBilledTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + public Builder setTotalBilledTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = builderForValue.build(); + onChanged(); + } else { + totalBilledTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + public Builder mergeTotalBilledTime(com.google.protobuf.Duration value) { + if (totalBilledTimeBuilder_ == null) { + if (totalBilledTime_ != null) { + totalBilledTime_ = + com.google.protobuf.Duration.newBuilder(totalBilledTime_).mergeFrom(value).buildPartial(); + } else { + totalBilledTime_ = value; + } + onChanged(); + } else { + totalBilledTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + public Builder clearTotalBilledTime() { + if (totalBilledTimeBuilder_ == null) { + totalBilledTime_ = null; + onChanged(); + } else { + totalBilledTime_ = null; + totalBilledTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + public com.google.protobuf.Duration.Builder getTotalBilledTimeBuilder() { + + onChanged(); + return getTotalBilledTimeFieldBuilder().getBuilder(); + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { + if (totalBilledTimeBuilder_ != null) { + return totalBilledTimeBuilder_.getMessageOrBuilder(); + } else { + return totalBilledTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; + } + } + /** + *
+     * When available, billed audio seconds for the stream.
+     * Set only if this is the last response in the stream.
+     * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getTotalBilledTimeFieldBuilder() { + if (totalBilledTimeBuilder_ == null) { + totalBilledTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getTotalBilledTime(), + getParentForChildren(), + isClean()); + totalBilledTime_ = null; + } + return totalBilledTimeBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) + private static final com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse(); + } + + public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingRecognizeResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingRecognizeResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java new file mode 100644 index 000000000000..f8b30e4274ea --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java @@ -0,0 +1,147 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface StreamingRecognizeResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+   * specifies the error for the operation.
+   * 
+ * + * .google.rpc.Status error = 1; + * @return Whether the error field is set. + */ + boolean hasError(); + /** + *
+   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+   * specifies the error for the operation.
+   * 
+ * + * .google.rpc.Status error = 1; + * @return The error. + */ + com.google.rpc.Status getError(); + /** + *
+   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
+   * specifies the error for the operation.
+   * 
+ * + * .google.rpc.Status error = 1; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); + + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + java.util.List + getResultsList(); + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getResults(int index); + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + int getResultsCount(); + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + java.util.List + getResultsOrBuilderList(); + /** + *
+   * This repeated list contains zero or more results that
+   * correspond to consecutive portions of the audio currently being processed.
+   * It contains zero or one `is_final=true` result (the newly settled portion),
+   * followed by zero or more `is_final=false` results (the interim results).
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; + */ + com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( + int index); + + /** + *
+   * Indicates the type of speech event.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return The enum numeric value on the wire for speechEventType. + */ + int getSpeechEventTypeValue(); + /** + *
+   * Indicates the type of speech event.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; + * @return The speechEventType. + */ + com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType(); + + /** + *
+   * When available, billed audio seconds for the stream.
+   * Set only if this is the last response in the stream.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + * @return Whether the totalBilledTime field is set. + */ + boolean hasTotalBilledTime(); + /** + *
+   * When available, billed audio seconds for the stream.
+   * Set only if this is the last response in the stream.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + * @return The totalBilledTime. + */ + com.google.protobuf.Duration getTotalBilledTime(); + /** + *
+   * When available, billed audio seconds for the stream.
+   * Set only if this is the last response in the stream.
+   * 
+ * + * .google.protobuf.Duration total_billed_time = 5; + */ + com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalization.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalization.java new file mode 100644 index 000000000000..1f54a67cb8e7 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalization.java @@ -0,0 +1,1838 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/resource.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Transcription normalization configuration. Use transcription normalization
+ * to automatically replace parts of the transcript with phrases of your
+ * choosing. For StreamingRecognize, this normalization only applies to stable
+ * partial transcripts (stability > 0.8) and final transcripts.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.TranscriptNormalization} + */ +public final class TranscriptNormalization extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.TranscriptNormalization) + TranscriptNormalizationOrBuilder { +private static final long serialVersionUID = 0L; + // Use TranscriptNormalization.newBuilder() to construct. + private TranscriptNormalization(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TranscriptNormalization() { + entries_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TranscriptNormalization(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TranscriptNormalization( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + entries_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + entries_.add( + input.readMessage(com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.class, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder.class); + } + + public interface EntryOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * What to replace. Max length is 100 characters.
+     * 
+ * + * string search = 1; + * @return The search. + */ + java.lang.String getSearch(); + /** + *
+     * What to replace. Max length is 100 characters.
+     * 
+ * + * string search = 1; + * @return The bytes for search. + */ + com.google.protobuf.ByteString + getSearchBytes(); + + /** + *
+     * What to replace with. Max length is 100 characters.
+     * 
+ * + * string replace = 2; + * @return The replace. + */ + java.lang.String getReplace(); + /** + *
+     * What to replace with. Max length is 100 characters.
+     * 
+ * + * string replace = 2; + * @return The bytes for replace. + */ + com.google.protobuf.ByteString + getReplaceBytes(); + + /** + *
+     * Whether the search is case sensitive.
+     * 
+ * + * bool case_sensitive = 3; + * @return The caseSensitive. + */ + boolean getCaseSensitive(); + } + /** + *
+   * A single replacement configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} + */ + public static final class Entry extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) + EntryOrBuilder { + private static final long serialVersionUID = 0L; + // Use Entry.newBuilder() to construct. + private Entry(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Entry() { + search_ = ""; + replace_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Entry(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Entry( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + search_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + replace_ = s; + break; + } + case 24: { + + caseSensitive_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.class, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder.class); + } + + public static final int SEARCH_FIELD_NUMBER = 1; + private volatile java.lang.Object search_; + /** + *
+     * What to replace. Max length is 100 characters.
+     * 
+ * + * string search = 1; + * @return The search. + */ + @java.lang.Override + public java.lang.String getSearch() { + java.lang.Object ref = search_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + search_ = s; + return s; + } + } + /** + *
+     * What to replace. Max length is 100 characters.
+     * 
+ * + * string search = 1; + * @return The bytes for search. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSearchBytes() { + java.lang.Object ref = search_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + search_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPLACE_FIELD_NUMBER = 2; + private volatile java.lang.Object replace_; + /** + *
+     * What to replace with. Max length is 100 characters.
+     * 
+ * + * string replace = 2; + * @return The replace. + */ + @java.lang.Override + public java.lang.String getReplace() { + java.lang.Object ref = replace_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + replace_ = s; + return s; + } + } + /** + *
+     * What to replace with. Max length is 100 characters.
+     * 
+ * + * string replace = 2; + * @return The bytes for replace. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getReplaceBytes() { + java.lang.Object ref = replace_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + replace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CASE_SENSITIVE_FIELD_NUMBER = 3; + private boolean caseSensitive_; + /** + *
+     * Whether the search is case sensitive.
+     * 
+ * + * bool case_sensitive = 3; + * @return The caseSensitive. + */ + @java.lang.Override + public boolean getCaseSensitive() { + return caseSensitive_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(search_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, search_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replace_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, replace_); + } + if (caseSensitive_ != false) { + output.writeBool(3, caseSensitive_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(search_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, search_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replace_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, replace_); + } + if (caseSensitive_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, caseSensitive_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry other = (com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) obj; + + if (!getSearch() + .equals(other.getSearch())) return false; + if (!getReplace() + .equals(other.getReplace())) return false; + if (getCaseSensitive() + != other.getCaseSensitive()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SEARCH_FIELD_NUMBER; + hash = (53 * hash) + getSearch().hashCode(); + hash = (37 * hash) + REPLACE_FIELD_NUMBER; + hash = (53 * hash) + getReplace().hashCode(); + hash = (37 * hash) + CASE_SENSITIVE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCaseSensitive()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * A single replacement configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.class, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + search_ = ""; + + replace_ = ""; + + caseSensitive_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry build() { + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry buildPartial() { + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry result = new com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry(this); + result.search_ = search_; + result.replace_ = replace_; + result.caseSensitive_ = caseSensitive_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry other) { + if (other == com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.getDefaultInstance()) return this; + if (!other.getSearch().isEmpty()) { + search_ = other.search_; + onChanged(); + } + if (!other.getReplace().isEmpty()) { + replace_ = other.replace_; + onChanged(); + } + if (other.getCaseSensitive() != false) { + setCaseSensitive(other.getCaseSensitive()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object search_ = ""; + /** + *
+       * What to replace. Max length is 100 characters.
+       * 
+ * + * string search = 1; + * @return The search. + */ + public java.lang.String getSearch() { + java.lang.Object ref = search_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + search_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * What to replace. Max length is 100 characters.
+       * 
+ * + * string search = 1; + * @return The bytes for search. + */ + public com.google.protobuf.ByteString + getSearchBytes() { + java.lang.Object ref = search_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + search_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * What to replace. Max length is 100 characters.
+       * 
+ * + * string search = 1; + * @param value The search to set. + * @return This builder for chaining. + */ + public Builder setSearch( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + search_ = value; + onChanged(); + return this; + } + /** + *
+       * What to replace. Max length is 100 characters.
+       * 
+ * + * string search = 1; + * @return This builder for chaining. + */ + public Builder clearSearch() { + + search_ = getDefaultInstance().getSearch(); + onChanged(); + return this; + } + /** + *
+       * What to replace. Max length is 100 characters.
+       * 
+ * + * string search = 1; + * @param value The bytes for search to set. + * @return This builder for chaining. + */ + public Builder setSearchBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + search_ = value; + onChanged(); + return this; + } + + private java.lang.Object replace_ = ""; + /** + *
+       * What to replace with. Max length is 100 characters.
+       * 
+ * + * string replace = 2; + * @return The replace. + */ + public java.lang.String getReplace() { + java.lang.Object ref = replace_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + replace_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * What to replace with. Max length is 100 characters.
+       * 
+ * + * string replace = 2; + * @return The bytes for replace. + */ + public com.google.protobuf.ByteString + getReplaceBytes() { + java.lang.Object ref = replace_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + replace_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * What to replace with. Max length is 100 characters.
+       * 
+ * + * string replace = 2; + * @param value The replace to set. + * @return This builder for chaining. + */ + public Builder setReplace( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + replace_ = value; + onChanged(); + return this; + } + /** + *
+       * What to replace with. Max length is 100 characters.
+       * 
+ * + * string replace = 2; + * @return This builder for chaining. + */ + public Builder clearReplace() { + + replace_ = getDefaultInstance().getReplace(); + onChanged(); + return this; + } + /** + *
+       * What to replace with. Max length is 100 characters.
+       * 
+ * + * string replace = 2; + * @param value The bytes for replace to set. + * @return This builder for chaining. + */ + public Builder setReplaceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + replace_ = value; + onChanged(); + return this; + } + + private boolean caseSensitive_ ; + /** + *
+       * Whether the search is case sensitive.
+       * 
+ * + * bool case_sensitive = 3; + * @return The caseSensitive. + */ + @java.lang.Override + public boolean getCaseSensitive() { + return caseSensitive_; + } + /** + *
+       * Whether the search is case sensitive.
+       * 
+ * + * bool case_sensitive = 3; + * @param value The caseSensitive to set. + * @return This builder for chaining. + */ + public Builder setCaseSensitive(boolean value) { + + caseSensitive_ = value; + onChanged(); + return this; + } + /** + *
+       * Whether the search is case sensitive.
+       * 
+ * + * bool case_sensitive = 3; + * @return This builder for chaining. + */ + public Builder clearCaseSensitive() { + + caseSensitive_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) + private static final com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry(); + } + + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Entry parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Entry(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int ENTRIES_FIELD_NUMBER = 1; + private java.util.List entries_; + /** + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + /** + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + @java.lang.Override + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + /** + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + /** + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry getEntries(int index) { + return entries_.get(index); + } + /** + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder getEntriesOrBuilder( + int index) { + return entries_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < entries_.size(); i++) { + output.writeMessage(1, entries_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < entries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, entries_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.TranscriptNormalization)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.TranscriptNormalization other = (com.google.cloud.speech.v1p1beta1.TranscriptNormalization) obj; + + if (!getEntriesList() + .equals(other.getEntriesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEntriesCount() > 0) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getEntriesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.TranscriptNormalization prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Transcription normalization configuration. Use transcription normalization
+   * to automatically replace parts of the transcript with phrases of your
+   * choosing. For StreamingRecognize, this normalization only applies to stable
+   * partial transcripts (stability > 0.8) and final transcripts.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.TranscriptNormalization} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.TranscriptNormalization) + com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.class, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.TranscriptNormalization.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getEntriesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + entriesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.TranscriptNormalization.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization build() { + com.google.cloud.speech.v1p1beta1.TranscriptNormalization result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization buildPartial() { + com.google.cloud.speech.v1p1beta1.TranscriptNormalization result = new com.google.cloud.speech.v1p1beta1.TranscriptNormalization(this); + int from_bitField0_ = bitField0_; + if (entriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entries_ = entries_; + } else { + result.entries_ = entriesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.TranscriptNormalization) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.TranscriptNormalization)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.TranscriptNormalization other) { + if (other == com.google.cloud.speech.v1p1beta1.TranscriptNormalization.getDefaultInstance()) return this; + if (entriesBuilder_ == null) { + if (!other.entries_.isEmpty()) { + if (entries_.isEmpty()) { + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntriesIsMutable(); + entries_.addAll(other.entries_); + } + onChanged(); + } + } else { + if (!other.entries_.isEmpty()) { + if (entriesBuilder_.isEmpty()) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + entriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getEntriesFieldBuilder() : null; + } else { + entriesBuilder_.addAllMessages(other.entries_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.TranscriptNormalization parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.TranscriptNormalization) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List entries_ = + java.util.Collections.emptyList(); + private void ensureEntriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entries_ = new java.util.ArrayList(entries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder> entriesBuilder_; + + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public java.util.List getEntriesList() { + if (entriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entries_); + } else { + return entriesBuilder_.getMessageList(); + } + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public int getEntriesCount() { + if (entriesBuilder_ == null) { + return entries_.size(); + } else { + return entriesBuilder_.getCount(); + } + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry getEntries(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessage(index); + } + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public Builder setEntries( + int index, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.set(index, value); + onChanged(); + } else { + entriesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public Builder setEntries( + int index, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.set(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public Builder addEntries(com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(value); + onChanged(); + } else { + entriesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public Builder addEntries( + int index, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(index, value); + onChanged(); + } else { + entriesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public Builder addEntries( + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public Builder addEntries( + int index, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public Builder addAllEntries( + java.lang.Iterable values) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, entries_); + onChanged(); + } else { + entriesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public Builder clearEntries() { + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entriesBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public Builder removeEntries(int index) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.remove(index); + onChanged(); + } else { + entriesBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder getEntriesBuilder( + int index) { + return getEntriesFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder getEntriesOrBuilder( + int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); } else { + return entriesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public java.util.List + getEntriesOrBuilderList() { + if (entriesBuilder_ != null) { + return entriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entries_); + } + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder addEntriesBuilder() { + return getEntriesFieldBuilder().addBuilder( + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.getDefaultInstance()); + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder addEntriesBuilder( + int index) { + return getEntriesFieldBuilder().addBuilder( + index, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.getDefaultInstance()); + } + /** + *
+     * A list of replacement entries. We will perform replacement with one entry
+     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+     * => "mountain dog"] will never be applied because we will always process the
+     * first entry before it. At most 100 entries.
+     * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + public java.util.List + getEntriesBuilderList() { + return getEntriesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder> + getEntriesFieldBuilder() { + if (entriesBuilder_ == null) { + entriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder>( + entries_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + entries_ = null; + } + return entriesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.TranscriptNormalization) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.TranscriptNormalization) + private static final com.google.cloud.speech.v1p1beta1.TranscriptNormalization DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.TranscriptNormalization(); + } + + public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TranscriptNormalization parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TranscriptNormalization(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptNormalization getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalizationOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalizationOrBuilder.java new file mode 100644 index 000000000000..fa51b40b7003 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalizationOrBuilder.java @@ -0,0 +1,68 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/resource.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface TranscriptNormalizationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.TranscriptNormalization) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + java.util.List + getEntriesList(); + /** + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry getEntries(int index); + /** + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + int getEntriesCount(); + /** + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + java.util.List + getEntriesOrBuilderList(); + /** + *
+   * A list of replacement entries. We will perform replacement with one entry
+   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
+   * => "mountain dog"] will never be applied because we will always process the
+   * first entry before it. At most 100 entries.
+   * 
+ * + * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; + */ + com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder getEntriesOrBuilder( + int index); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfig.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfig.java new file mode 100644 index 000000000000..25b03d6ffdc1 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfig.java @@ -0,0 +1,732 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Specifies an optional destination for the recognition results.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.TranscriptOutputConfig} + */ +public final class TranscriptOutputConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.TranscriptOutputConfig) + TranscriptOutputConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use TranscriptOutputConfig.newBuilder() to construct. + private TranscriptOutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TranscriptOutputConfig() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TranscriptOutputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TranscriptOutputConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + outputTypeCase_ = 1; + outputType_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.class, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder.class); + } + + private int outputTypeCase_ = 0; + private java.lang.Object outputType_; + public enum OutputTypeCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_URI(1), + OUTPUTTYPE_NOT_SET(0); + private final int value; + private OutputTypeCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OutputTypeCase valueOf(int value) { + return forNumber(value); + } + + public static OutputTypeCase forNumber(int value) { + switch (value) { + case 1: return GCS_URI; + case 0: return OUTPUTTYPE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OutputTypeCase + getOutputTypeCase() { + return OutputTypeCase.forNumber( + outputTypeCase_); + } + + public static final int GCS_URI_FIELD_NUMBER = 1; + /** + *
+   * Specifies a Cloud Storage URI for the recognition results. Must be
+   * specified in the format: `gs://bucket_name/object_name`, and the bucket
+   * must already exist.
+   * 
+ * + * string gcs_uri = 1; + * @return Whether the gcsUri field is set. + */ + public boolean hasGcsUri() { + return outputTypeCase_ == 1; + } + /** + *
+   * Specifies a Cloud Storage URI for the recognition results. Must be
+   * specified in the format: `gs://bucket_name/object_name`, and the bucket
+   * must already exist.
+   * 
+ * + * string gcs_uri = 1; + * @return The gcsUri. + */ + public java.lang.String getGcsUri() { + java.lang.Object ref = ""; + if (outputTypeCase_ == 1) { + ref = outputType_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (outputTypeCase_ == 1) { + outputType_ = s; + } + return s; + } + } + /** + *
+   * Specifies a Cloud Storage URI for the recognition results. Must be
+   * specified in the format: `gs://bucket_name/object_name`, and the bucket
+   * must already exist.
+   * 
+ * + * string gcs_uri = 1; + * @return The bytes for gcsUri. + */ + public com.google.protobuf.ByteString + getGcsUriBytes() { + java.lang.Object ref = ""; + if (outputTypeCase_ == 1) { + ref = outputType_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (outputTypeCase_ == 1) { + outputType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (outputTypeCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (outputTypeCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig other = (com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig) obj; + + if (!getOutputTypeCase().equals(other.getOutputTypeCase())) return false; + switch (outputTypeCase_) { + case 1: + if (!getGcsUri() + .equals(other.getGcsUri())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (outputTypeCase_) { + case 1: + hash = (37 * hash) + GCS_URI_FIELD_NUMBER; + hash = (53 * hash) + getGcsUri().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Specifies an optional destination for the recognition results.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.TranscriptOutputConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.TranscriptOutputConfig) + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.class, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + outputTypeCase_ = 0; + outputType_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig build() { + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig buildPartial() { + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig result = new com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig(this); + if (outputTypeCase_ == 1) { + result.outputType_ = outputType_; + } + result.outputTypeCase_ = outputTypeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig other) { + if (other == com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance()) return this; + switch (other.getOutputTypeCase()) { + case GCS_URI: { + outputTypeCase_ = 1; + outputType_ = other.outputType_; + onChanged(); + break; + } + case OUTPUTTYPE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int outputTypeCase_ = 0; + private java.lang.Object outputType_; + public OutputTypeCase + getOutputTypeCase() { + return OutputTypeCase.forNumber( + outputTypeCase_); + } + + public Builder clearOutputType() { + outputTypeCase_ = 0; + outputType_ = null; + onChanged(); + return this; + } + + + /** + *
+     * Specifies a Cloud Storage URI for the recognition results. Must be
+     * specified in the format: `gs://bucket_name/object_name`, and the bucket
+     * must already exist.
+     * 
+ * + * string gcs_uri = 1; + * @return Whether the gcsUri field is set. + */ + @java.lang.Override + public boolean hasGcsUri() { + return outputTypeCase_ == 1; + } + /** + *
+     * Specifies a Cloud Storage URI for the recognition results. Must be
+     * specified in the format: `gs://bucket_name/object_name`, and the bucket
+     * must already exist.
+     * 
+ * + * string gcs_uri = 1; + * @return The gcsUri. + */ + @java.lang.Override + public java.lang.String getGcsUri() { + java.lang.Object ref = ""; + if (outputTypeCase_ == 1) { + ref = outputType_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (outputTypeCase_ == 1) { + outputType_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Specifies a Cloud Storage URI for the recognition results. Must be
+     * specified in the format: `gs://bucket_name/object_name`, and the bucket
+     * must already exist.
+     * 
+ * + * string gcs_uri = 1; + * @return The bytes for gcsUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGcsUriBytes() { + java.lang.Object ref = ""; + if (outputTypeCase_ == 1) { + ref = outputType_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (outputTypeCase_ == 1) { + outputType_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Specifies a Cloud Storage URI for the recognition results. Must be
+     * specified in the format: `gs://bucket_name/object_name`, and the bucket
+     * must already exist.
+     * 
+ * + * string gcs_uri = 1; + * @param value The gcsUri to set. + * @return This builder for chaining. + */ + public Builder setGcsUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputTypeCase_ = 1; + outputType_ = value; + onChanged(); + return this; + } + /** + *
+     * Specifies a Cloud Storage URI for the recognition results. Must be
+     * specified in the format: `gs://bucket_name/object_name`, and the bucket
+     * must already exist.
+     * 
+ * + * string gcs_uri = 1; + * @return This builder for chaining. + */ + public Builder clearGcsUri() { + if (outputTypeCase_ == 1) { + outputTypeCase_ = 0; + outputType_ = null; + onChanged(); + } + return this; + } + /** + *
+     * Specifies a Cloud Storage URI for the recognition results. Must be
+     * specified in the format: `gs://bucket_name/object_name`, and the bucket
+     * must already exist.
+     * 
+ * + * string gcs_uri = 1; + * @param value The bytes for gcsUri to set. + * @return This builder for chaining. + */ + public Builder setGcsUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputTypeCase_ = 1; + outputType_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.TranscriptOutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.TranscriptOutputConfig) + private static final com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig(); + } + + public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TranscriptOutputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TranscriptOutputConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfigOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfigOrBuilder.java new file mode 100644 index 000000000000..3733fac7b5f9 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfigOrBuilder.java @@ -0,0 +1,46 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface TranscriptOutputConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.TranscriptOutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Specifies a Cloud Storage URI for the recognition results. Must be
+   * specified in the format: `gs://bucket_name/object_name`, and the bucket
+   * must already exist.
+   * 
+ * + * string gcs_uri = 1; + * @return Whether the gcsUri field is set. + */ + boolean hasGcsUri(); + /** + *
+   * Specifies a Cloud Storage URI for the recognition results. Must be
+   * specified in the format: `gs://bucket_name/object_name`, and the bucket
+   * must already exist.
+   * 
+ * + * string gcs_uri = 1; + * @return The gcsUri. + */ + java.lang.String getGcsUri(); + /** + *
+   * Specifies a Cloud Storage URI for the recognition results. Must be
+   * specified in the format: `gs://bucket_name/object_name`, and the bucket
+   * must already exist.
+   * 
+ * + * string gcs_uri = 1; + * @return The bytes for gcsUri. + */ + com.google.protobuf.ByteString + getGcsUriBytes(); + + public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.OutputTypeCase getOutputTypeCase(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java new file mode 100644 index 000000000000..7ed5cddc895e --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java @@ -0,0 +1,997 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Message sent by the client for the `UpdateCustomClass` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} + */ +public final class UpdateCustomClassRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) + UpdateCustomClassRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateCustomClassRequest.newBuilder() to construct. + private UpdateCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateCustomClassRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UpdateCustomClassRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateCustomClassRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.cloud.speech.v1p1beta1.CustomClass.Builder subBuilder = null; + if (customClass_ != null) { + subBuilder = customClass_.toBuilder(); + } + customClass_ = input.readMessage(com.google.cloud.speech.v1p1beta1.CustomClass.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(customClass_); + customClass_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.Builder.class); + } + + public static final int CUSTOM_CLASS_FIELD_NUMBER = 1; + private com.google.cloud.speech.v1p1beta1.CustomClass customClass_; + /** + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the customClass field is set. + */ + @java.lang.Override + public boolean hasCustomClass() { + return customClass_ != null; + } + /** + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClass. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass() { + return customClass_ == null ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() : customClass_; + } + /** + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder() { + return getCustomClass(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (customClass_ != null) { + output.writeMessage(1, getCustomClass()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (customClass_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getCustomClass()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest other = (com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) obj; + + if (hasCustomClass() != other.hasCustomClass()) return false; + if (hasCustomClass()) { + if (!getCustomClass() + .equals(other.getCustomClass())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask() + .equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCustomClass()) { + hash = (37 * hash) + CUSTOM_CLASS_FIELD_NUMBER; + hash = (53 * hash) + getCustomClass().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `UpdateCustomClass` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (customClassBuilder_ == null) { + customClass_ = null; + } else { + customClass_ = null; + customClassBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest build() { + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest result = new com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest(this); + if (customClassBuilder_ == null) { + result.customClass_ = customClass_; + } else { + result.customClass_ = customClassBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.getDefaultInstance()) return this; + if (other.hasCustomClass()) { + mergeCustomClass(other.getCustomClass()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.speech.v1p1beta1.CustomClass customClass_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> customClassBuilder_; + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the customClass field is set. + */ + public boolean hasCustomClass() { + return customClassBuilder_ != null || customClass_ != null; + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClass. + */ + public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass() { + if (customClassBuilder_ == null) { + return customClass_ == null ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() : customClass_; + } else { + return customClassBuilder_.getMessage(); + } + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setCustomClass(com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customClass_ = value; + onChanged(); + } else { + customClassBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setCustomClass( + com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { + if (customClassBuilder_ == null) { + customClass_ = builderForValue.build(); + onChanged(); + } else { + customClassBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeCustomClass(com.google.cloud.speech.v1p1beta1.CustomClass value) { + if (customClassBuilder_ == null) { + if (customClass_ != null) { + customClass_ = + com.google.cloud.speech.v1p1beta1.CustomClass.newBuilder(customClass_).mergeFrom(value).buildPartial(); + } else { + customClass_ = value; + } + onChanged(); + } else { + customClassBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearCustomClass() { + if (customClassBuilder_ == null) { + customClass_ = null; + onChanged(); + } else { + customClass_ = null; + customClassBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassBuilder() { + + onChanged(); + return getCustomClassFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder() { + if (customClassBuilder_ != null) { + return customClassBuilder_.getMessageOrBuilder(); + } else { + return customClass_ == null ? + com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() : customClass_; + } + } + /** + *
+     * Required. The custom class to update.
+     * The custom class's `name` field is used to identify the custom class to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> + getCustomClassFieldBuilder() { + if (customClassBuilder_ == null) { + customClassBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( + getCustomClass(), + getParentForChildren(), + isClean()); + customClass_ = null; + } + return customClassBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) + private static final com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateCustomClassRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateCustomClassRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java new file mode 100644 index 000000000000..5ffdf4623cc2 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface UpdateCustomClassRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the customClass field is set. + */ + boolean hasCustomClass(); + /** + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The customClass. + */ + com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass(); + /** + *
+   * Required. The custom class to update.
+   * The custom class's `name` field is used to identify the custom class to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder(); + + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java new file mode 100644 index 000000000000..3c5a6f5250e8 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java @@ -0,0 +1,997 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Message sent by the client for the `UpdatePhraseSet` method.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} + */ +public final class UpdatePhraseSetRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) + UpdatePhraseSetRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdatePhraseSetRequest.newBuilder() to construct. + private UpdatePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdatePhraseSetRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UpdatePhraseSetRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdatePhraseSetRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder subBuilder = null; + if (phraseSet_ != null) { + subBuilder = phraseSet_.toBuilder(); + } + phraseSet_ = input.readMessage(com.google.cloud.speech.v1p1beta1.PhraseSet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(phraseSet_); + phraseSet_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.Builder.class); + } + + public static final int PHRASE_SET_FIELD_NUMBER = 1; + private com.google.cloud.speech.v1p1beta1.PhraseSet phraseSet_; + /** + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the phraseSet field is set. + */ + @java.lang.Override + public boolean hasPhraseSet() { + return phraseSet_ != null; + } + /** + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSet. + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet() { + return phraseSet_ == null ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() : phraseSet_; + } + /** + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder() { + return getPhraseSet(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (phraseSet_ != null) { + output.writeMessage(1, getPhraseSet()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (phraseSet_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getPhraseSet()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest other = (com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) obj; + + if (hasPhraseSet() != other.hasPhraseSet()) return false; + if (hasPhraseSet()) { + if (!getPhraseSet() + .equals(other.getPhraseSet())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask() + .equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasPhraseSet()) { + hash = (37 * hash) + PHRASE_SET_FIELD_NUMBER; + hash = (53 * hash) + getPhraseSet().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message sent by the client for the `UpdatePhraseSet` method.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (phraseSetBuilder_ == null) { + phraseSet_ = null; + } else { + phraseSet_ = null; + phraseSetBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest build() { + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest buildPartial() { + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest result = new com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest(this); + if (phraseSetBuilder_ == null) { + result.phraseSet_ = phraseSet_; + } else { + result.phraseSet_ = phraseSetBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest other) { + if (other == com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.getDefaultInstance()) return this; + if (other.hasPhraseSet()) { + mergePhraseSet(other.getPhraseSet()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.speech.v1p1beta1.PhraseSet phraseSet_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> phraseSetBuilder_; + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the phraseSet field is set. + */ + public boolean hasPhraseSet() { + return phraseSetBuilder_ != null || phraseSet_ != null; + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSet. + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet() { + if (phraseSetBuilder_ == null) { + return phraseSet_ == null ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() : phraseSet_; + } else { + return phraseSetBuilder_.getMessage(); + } + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPhraseSet(com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + phraseSet_ = value; + onChanged(); + } else { + phraseSetBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setPhraseSet( + com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { + if (phraseSetBuilder_ == null) { + phraseSet_ = builderForValue.build(); + onChanged(); + } else { + phraseSetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergePhraseSet(com.google.cloud.speech.v1p1beta1.PhraseSet value) { + if (phraseSetBuilder_ == null) { + if (phraseSet_ != null) { + phraseSet_ = + com.google.cloud.speech.v1p1beta1.PhraseSet.newBuilder(phraseSet_).mergeFrom(value).buildPartial(); + } else { + phraseSet_ = value; + } + onChanged(); + } else { + phraseSetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearPhraseSet() { + if (phraseSetBuilder_ == null) { + phraseSet_ = null; + onChanged(); + } else { + phraseSet_ = null; + phraseSetBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder getPhraseSetBuilder() { + + onChanged(); + return getPhraseSetFieldBuilder().getBuilder(); + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder() { + if (phraseSetBuilder_ != null) { + return phraseSetBuilder_.getMessageOrBuilder(); + } else { + return phraseSet_ == null ? + com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() : phraseSet_; + } + } + /** + *
+     * Required. The phrase set to update.
+     * The phrase set's `name` field is used to identify the set to be
+     * updated. Format:
+     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+     * Speech-to-Text supports three locations: `global`, `us` (US North America),
+     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+     * endpoint, use the `global` location. To specify a region, use a
+     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+     * with matching `us` or `eu` location value.
+     * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> + getPhraseSetFieldBuilder() { + if (phraseSetBuilder_ == null) { + phraseSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder>( + getPhraseSet(), + getParentForChildren(), + isClean()); + phraseSet_ = null; + } + return phraseSetBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * The list of fields to be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) + private static final com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest(); + } + + public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdatePhraseSetRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdatePhraseSetRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java new file mode 100644 index 000000000000..ae3c2a999eb0 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface UpdatePhraseSetRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return Whether the phraseSet field is set. + */ + boolean hasPhraseSet(); + /** + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return The phraseSet. + */ + com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet(); + /** + *
+   * Required. The phrase set to update.
+   * The phrase set's `name` field is used to identify the set to be
+   * updated. Format:
+   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+   * Speech-to-Text supports three locations: `global`, `us` (US North America),
+   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
+   * endpoint, use the `global` location. To specify a region, use a
+   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
+   * with matching `us` or `eu` location value.
+   * 
+ * + * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder(); + + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The list of fields to be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java new file mode 100644 index 000000000000..57c082189d6f --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java @@ -0,0 +1,1389 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +/** + *
+ * Word-specific information for recognized words.
+ * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.WordInfo} + */ +public final class WordInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.WordInfo) + WordInfoOrBuilder { +private static final long serialVersionUID = 0L; + // Use WordInfo.newBuilder() to construct. + private WordInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private WordInfo() { + word_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new WordInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WordInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + word_ = s; + break; + } + case 37: { + + confidence_ = input.readFloat(); + break; + } + case 40: { + + speakerTag_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.WordInfo.class, com.google.cloud.speech.v1p1beta1.WordInfo.Builder.class); + } + + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Duration startTime_; + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the start of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration start_time = 1; + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the start of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration start_time = 1; + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getStartTime() { + return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; + } + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the start of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Duration endTime_; + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the end of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration end_time = 2; + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the end of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration end_time = 2; + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getEndTime() { + return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; + } + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the end of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int WORD_FIELD_NUMBER = 3; + private volatile java.lang.Object word_; + /** + *
+   * The word corresponding to this set of information.
+   * 
+ * + * string word = 3; + * @return The word. + */ + @java.lang.Override + public java.lang.String getWord() { + java.lang.Object ref = word_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + word_ = s; + return s; + } + } + /** + *
+   * The word corresponding to this set of information.
+   * 
+ * + * string word = 3; + * @return The bytes for word. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getWordBytes() { + java.lang.Object ref = word_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + word_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIDENCE_FIELD_NUMBER = 4; + private float confidence_; + /** + *
+   * The confidence estimate between 0.0 and 1.0. A higher number
+   * indicates an estimated greater likelihood that the recognized words are
+   * correct. This field is set only for the top alternative of a non-streaming
+   * result or, of a streaming result where `is_final=true`.
+   * This field is not guaranteed to be accurate and users should not rely on it
+   * to be always provided.
+   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+   * 
+ * + * float confidence = 4; + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + + public static final int SPEAKER_TAG_FIELD_NUMBER = 5; + private int speakerTag_; + /** + *
+   * Output only. A distinct integer value is assigned for every speaker within
+   * the audio. This field specifies which one of those speakers was detected to
+   * have spoken this word. Value ranges from '1' to diarization_speaker_count.
+   * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
+   * top alternative.
+   * 
+ * + * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The speakerTag. + */ + @java.lang.Override + public int getSpeakerTag() { + return speakerTag_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (startTime_ != null) { + output.writeMessage(1, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(word_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, word_); + } + if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { + output.writeFloat(4, confidence_); + } + if (speakerTag_ != 0) { + output.writeInt32(5, speakerTag_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(word_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, word_); + } + if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, confidence_); + } + if (speakerTag_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, speakerTag_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.speech.v1p1beta1.WordInfo)) { + return super.equals(obj); + } + com.google.cloud.speech.v1p1beta1.WordInfo other = (com.google.cloud.speech.v1p1beta1.WordInfo) obj; + + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime() + .equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime() + .equals(other.getEndTime())) return false; + } + if (!getWord() + .equals(other.getWord())) return false; + if (java.lang.Float.floatToIntBits(getConfidence()) + != java.lang.Float.floatToIntBits( + other.getConfidence())) return false; + if (getSpeakerTag() + != other.getSpeakerTag()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + WORD_FIELD_NUMBER; + hash = (53 * hash) + getWord().hashCode(); + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; + hash = (53 * hash) + getSpeakerTag(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.WordInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.WordInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.WordInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Word-specific information for recognized words.
+   * 
+ * + * Protobuf type {@code google.cloud.speech.v1p1beta1.WordInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.WordInfo) + com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.speech.v1p1beta1.WordInfo.class, com.google.cloud.speech.v1p1beta1.WordInfo.Builder.class); + } + + // Construct using com.google.cloud.speech.v1p1beta1.WordInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + word_ = ""; + + confidence_ = 0F; + + speakerTag_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.WordInfo getDefaultInstanceForType() { + return com.google.cloud.speech.v1p1beta1.WordInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.WordInfo build() { + com.google.cloud.speech.v1p1beta1.WordInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.WordInfo buildPartial() { + com.google.cloud.speech.v1p1beta1.WordInfo result = new com.google.cloud.speech.v1p1beta1.WordInfo(this); + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.word_ = word_; + result.confidence_ = confidence_; + result.speakerTag_ = speakerTag_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.speech.v1p1beta1.WordInfo) { + return mergeFrom((com.google.cloud.speech.v1p1beta1.WordInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.WordInfo other) { + if (other == com.google.cloud.speech.v1p1beta1.WordInfo.getDefaultInstance()) return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getWord().isEmpty()) { + word_ = other.word_; + onChanged(); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + if (other.getSpeakerTag() != 0) { + setSpeakerTag(other.getSpeakerTag()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.speech.v1p1beta1.WordInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.speech.v1p1beta1.WordInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Duration startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> startTimeBuilder_; + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + * @return The startTime. + */ + public com.google.protobuf.Duration getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Duration value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + public Builder setStartTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Duration value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Duration.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + public com.google.protobuf.Duration.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : startTime_; + } + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the start of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getStartTime(), + getParentForChildren(), + isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Duration endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> endTimeBuilder_; + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + * @return The endTime. + */ + public com.google.protobuf.Duration getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Duration value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + public Builder setEndTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Duration value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Duration.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + public com.google.protobuf.Duration.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : endTime_; + } + } + /** + *
+     * Time offset relative to the beginning of the audio,
+     * and corresponding to the end of the spoken word.
+     * This field is only set if `enable_word_time_offsets=true` and only
+     * in the top hypothesis.
+     * This is an experimental feature and the accuracy of the time offset can
+     * vary.
+     * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getEndTime(), + getParentForChildren(), + isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object word_ = ""; + /** + *
+     * The word corresponding to this set of information.
+     * 
+ * + * string word = 3; + * @return The word. + */ + public java.lang.String getWord() { + java.lang.Object ref = word_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + word_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The word corresponding to this set of information.
+     * 
+ * + * string word = 3; + * @return The bytes for word. + */ + public com.google.protobuf.ByteString + getWordBytes() { + java.lang.Object ref = word_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + word_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The word corresponding to this set of information.
+     * 
+ * + * string word = 3; + * @param value The word to set. + * @return This builder for chaining. + */ + public Builder setWord( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + word_ = value; + onChanged(); + return this; + } + /** + *
+     * The word corresponding to this set of information.
+     * 
+ * + * string word = 3; + * @return This builder for chaining. + */ + public Builder clearWord() { + + word_ = getDefaultInstance().getWord(); + onChanged(); + return this; + } + /** + *
+     * The word corresponding to this set of information.
+     * 
+ * + * string word = 3; + * @param value The bytes for word to set. + * @return This builder for chaining. + */ + public Builder setWordBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + word_ = value; + onChanged(); + return this; + } + + private float confidence_ ; + /** + *
+     * The confidence estimate between 0.0 and 1.0. A higher number
+     * indicates an estimated greater likelihood that the recognized words are
+     * correct. This field is set only for the top alternative of a non-streaming
+     * result or, of a streaming result where `is_final=true`.
+     * This field is not guaranteed to be accurate and users should not rely on it
+     * to be always provided.
+     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+     * 
+ * + * float confidence = 4; + * @return The confidence. + */ + @java.lang.Override + public float getConfidence() { + return confidence_; + } + /** + *
+     * The confidence estimate between 0.0 and 1.0. A higher number
+     * indicates an estimated greater likelihood that the recognized words are
+     * correct. This field is set only for the top alternative of a non-streaming
+     * result or, of a streaming result where `is_final=true`.
+     * This field is not guaranteed to be accurate and users should not rely on it
+     * to be always provided.
+     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+     * 
+ * + * float confidence = 4; + * @param value The confidence to set. + * @return This builder for chaining. + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * The confidence estimate between 0.0 and 1.0. A higher number
+     * indicates an estimated greater likelihood that the recognized words are
+     * correct. This field is set only for the top alternative of a non-streaming
+     * result or, of a streaming result where `is_final=true`.
+     * This field is not guaranteed to be accurate and users should not rely on it
+     * to be always provided.
+     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+     * 
+ * + * float confidence = 4; + * @return This builder for chaining. + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + + private int speakerTag_ ; + /** + *
+     * Output only. A distinct integer value is assigned for every speaker within
+     * the audio. This field specifies which one of those speakers was detected to
+     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
+     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
+     * top alternative.
+     * 
+ * + * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The speakerTag. + */ + @java.lang.Override + public int getSpeakerTag() { + return speakerTag_; + } + /** + *
+     * Output only. A distinct integer value is assigned for every speaker within
+     * the audio. This field specifies which one of those speakers was detected to
+     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
+     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
+     * top alternative.
+     * 
+ * + * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param value The speakerTag to set. + * @return This builder for chaining. + */ + public Builder setSpeakerTag(int value) { + + speakerTag_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. A distinct integer value is assigned for every speaker within
+     * the audio. This field specifies which one of those speakers was detected to
+     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
+     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
+     * top alternative.
+     * 
+ * + * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return This builder for chaining. + */ + public Builder clearSpeakerTag() { + + speakerTag_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.WordInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.WordInfo) + private static final com.google.cloud.speech.v1p1beta1.WordInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.WordInfo(); + } + + public static com.google.cloud.speech.v1p1beta1.WordInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WordInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WordInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.speech.v1p1beta1.WordInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java new file mode 100644 index 000000000000..b811f0f3088d --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java @@ -0,0 +1,143 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/speech/v1p1beta1/cloud_speech.proto + +package com.google.cloud.speech.v1p1beta1; + +public interface WordInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.WordInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the start of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration start_time = 1; + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the start of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration start_time = 1; + * @return The startTime. + */ + com.google.protobuf.Duration getStartTime(); + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the start of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration start_time = 1; + */ + com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder(); + + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the end of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration end_time = 2; + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the end of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration end_time = 2; + * @return The endTime. + */ + com.google.protobuf.Duration getEndTime(); + /** + *
+   * Time offset relative to the beginning of the audio,
+   * and corresponding to the end of the spoken word.
+   * This field is only set if `enable_word_time_offsets=true` and only
+   * in the top hypothesis.
+   * This is an experimental feature and the accuracy of the time offset can
+   * vary.
+   * 
+ * + * .google.protobuf.Duration end_time = 2; + */ + com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder(); + + /** + *
+   * The word corresponding to this set of information.
+   * 
+ * + * string word = 3; + * @return The word. + */ + java.lang.String getWord(); + /** + *
+   * The word corresponding to this set of information.
+   * 
+ * + * string word = 3; + * @return The bytes for word. + */ + com.google.protobuf.ByteString + getWordBytes(); + + /** + *
+   * The confidence estimate between 0.0 and 1.0. A higher number
+   * indicates an estimated greater likelihood that the recognized words are
+   * correct. This field is set only for the top alternative of a non-streaming
+   * result or, of a streaming result where `is_final=true`.
+   * This field is not guaranteed to be accurate and users should not rely on it
+   * to be always provided.
+   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
+   * 
+ * + * float confidence = 4; + * @return The confidence. + */ + float getConfidence(); + + /** + *
+   * Output only. A distinct integer value is assigned for every speaker within
+   * the audio. This field specifies which one of those speakers was detected to
+   * have spoken this word. Value ranges from '1' to diarization_speaker_count.
+   * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
+   * top alternative.
+   * 
+ * + * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return The speakerTag. + */ + int getSpeakerTag(); +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto new file mode 100644 index 000000000000..9bf36fccf208 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto @@ -0,0 +1,929 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/speech/v1p1beta1/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech"; +option java_multiple_files = true; +option java_outer_classname = "SpeechProto"; +option java_package = "com.google.cloud.speech.v1p1beta1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech API. +service Speech { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Performs synchronous speech recognition: receive results after all audio + // has been sent and processed. + rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { + option (google.api.http) = { + post: "/v1p1beta1/speech:recognize" + body: "*" + }; + option (google.api.method_signature) = "config,audio"; + } + + // Performs asynchronous speech recognition: receive results via the + // google.longrunning.Operations interface. Returns either an + // `Operation.error` or an `Operation.response` which contains + // a `LongRunningRecognizeResponse` message. + // For more information on asynchronous speech recognition, see the + // [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + rpc LongRunningRecognize(LongRunningRecognizeRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p1beta1/speech:longrunningrecognize" + body: "*" + }; + option (google.api.method_signature) = "config,audio"; + option (google.longrunning.operation_info) = { + response_type: "LongRunningRecognizeResponse" + metadata_type: "LongRunningRecognizeMetadata" + }; + } + + // Performs bidirectional streaming speech recognition: receive results while + // sending audio. This method is only available via the gRPC API (not REST). + rpc StreamingRecognize(stream StreamingRecognizeRequest) returns (stream StreamingRecognizeResponse) { + } +} + +// The top-level message sent by the client for the `Recognize` method. +message RecognizeRequest { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The audio data to be recognized. + RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The top-level message sent by the client for the `LongRunningRecognize` +// method. +message LongRunningRecognizeRequest { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The audio data to be recognized. + RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies an optional destination for the recognition results. + TranscriptOutputConfig output_config = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies an optional destination for the recognition results. +message TranscriptOutputConfig { + oneof output_type { + // Specifies a Cloud Storage URI for the recognition results. Must be + // specified in the format: `gs://bucket_name/object_name`, and the bucket + // must already exist. + string gcs_uri = 1; + } +} + +// The top-level message sent by the client for the `StreamingRecognize` method. +// Multiple `StreamingRecognizeRequest` messages are sent. The first message +// must contain a `streaming_config` message and must not contain +// `audio_content`. All subsequent messages must contain `audio_content` and +// must not contain a `streaming_config` message. +message StreamingRecognizeRequest { + // The streaming request, which is either a streaming config or audio content. + oneof streaming_request { + // Provides information to the recognizer that specifies how to process the + // request. The first `StreamingRecognizeRequest` message must contain a + // `streaming_config` message. + StreamingRecognitionConfig streaming_config = 1; + + // The audio data to be recognized. Sequential chunks of audio data are sent + // in sequential `StreamingRecognizeRequest` messages. The first + // `StreamingRecognizeRequest` message must not contain `audio_content` data + // and all subsequent `StreamingRecognizeRequest` messages must contain + // `audio_content` data. The audio bytes must be encoded as specified in + // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + // pure binary representation (not base64). See + // [content limits](https://cloud.google.com/speech-to-text/quotas#content). + bytes audio_content = 2; + } +} + +// Provides information to the recognizer that specifies how to process the +// request. +message StreamingRecognitionConfig { + // Required. Provides information to the recognizer that specifies how to + // process the request. + RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // If `false` or omitted, the recognizer will perform continuous + // recognition (continuing to wait for and process audio even if the user + // pauses speaking) until the client closes the input stream (gRPC API) or + // until the maximum time limit has been reached. May return multiple + // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. + // + // If `true`, the recognizer will detect a single spoken utterance. When it + // detects that the user has paused or stopped speaking, it will return an + // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no + // more than one `StreamingRecognitionResult` with the `is_final` flag set to + // `true`. + // + // The `single_utterance` field can only be used with specified models, + // otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] + // must be set to: + // + // * `command_and_search` + // * `phone_call` AND additional field `useEnhanced`=`true` + // * The `model` field is left undefined. In this case the API auto-selects + // a model based on any other parameters that you set in + // `RecognitionConfig`. + bool single_utterance = 2; + + // If `true`, interim results (tentative hypotheses) may be + // returned as they become available (these interim results are indicated with + // the `is_final=false` flag). + // If `false` or omitted, only `is_final=true` result(s) are returned. + bool interim_results = 3; +} + +// Provides information to the recognizer that specifies how to process the +// request. +message RecognitionConfig { + // The encoding of the audio data sent in the request. + // + // All encodings support only 1 channel (mono) audio, unless the + // `audio_channel_count` and `enable_separate_recognition_per_channel` fields + // are set. + // + // For best results, the audio source should be captured and transmitted using + // a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech + // recognition can be reduced if lossy codecs are used to capture or transmit + // audio, particularly if background noise is present. Lossy codecs include + // `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`, + // and `WEBM_OPUS`. + // + // The `FLAC` and `WAV` audio file formats include a header that describes the + // included audio content. You can request recognition for `WAV` files that + // contain either `LINEAR16` or `MULAW` encoded audio. + // If you send `FLAC` or `WAV` audio file format in + // your request, you do not need to specify an `AudioEncoding`; the audio + // encoding format is determined from the file header. If you specify + // an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the + // encoding configuration must match the encoding described in the audio + // header; otherwise the request returns an + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code. + enum AudioEncoding { + // Not specified. + ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + LINEAR16 = 1; + + // `FLAC` (Free Lossless Audio + // Codec) is the recommended encoding because it is + // lossless--therefore recognition is not compromised--and + // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream + // encoding supports 16-bit and 24-bit samples, however, not all fields in + // `STREAMINFO` are supported. + FLAC = 2; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + MULAW = 3; + + // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. + AMR = 4; + + // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. + AMR_WB = 5; + + // Opus encoded audio frames in Ogg container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). + // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. + OGG_OPUS = 6; + + // Although the use of lossy encodings is not recommended, if a very low + // bitrate encoding is required, `OGG_OPUS` is highly preferred over + // Speex encoding. The [Speex](https://speex.org/) encoding supported by + // Cloud Speech API has a header byte in each block, as in MIME type + // `audio/x-speex-with-header-byte`. + // It is a variant of the RTP Speex encoding defined in + // [RFC 5574](https://tools.ietf.org/html/rfc5574). + // The stream is a sequence of blocks, one block per RTP packet. Each block + // starts with a byte containing the length of the block, in bytes, followed + // by one or more frames of Speex data, padded to an integral number of + // bytes (octets) as specified in RFC 5574. In other words, each RTP header + // is replaced with a single byte containing the block length. Only Speex + // wideband is supported. `sample_rate_hertz` must be 16000. + SPEEX_WITH_HEADER_BYTE = 7; + + // MP3 audio. MP3 encoding is a Beta feature and only available in + // v1p1beta1. Support all standard MP3 bitrates (which range from 32-320 + // kbps). When using this encoding, `sample_rate_hertz` has to match the + // sample rate of the file being used. + MP3 = 8; + + // Opus encoded audio frames in WebM container + // ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be + // one of 8000, 12000, 16000, 24000, or 48000. + WEBM_OPUS = 9; + } + + // Encoding of audio data sent in all `RecognitionAudio` messages. + // This field is optional for `FLAC` and `WAV` audio files and required + // for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding]. + AudioEncoding encoding = 1; + + // Sample rate in Hertz of the audio data sent in all + // `RecognitionAudio` messages. Valid values are: 8000-48000. + // 16000 is optimal. For best results, set the sampling rate of the audio + // source to 16000 Hz. If that's not possible, use the native sample rate of + // the audio source (instead of re-sampling). + // This field is optional for FLAC and WAV audio files, but is + // required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding]. + int32 sample_rate_hertz = 2; + + // The number of channels in the input audio data. + // ONLY set this for MULTI-CHANNEL recognition. + // Valid values for LINEAR16 and FLAC are `1`-`8`. + // Valid values for OGG_OPUS are '1'-'254'. + // Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. + // If `0` or omitted, defaults to one channel (mono). + // Note: We only recognize the first channel by default. + // To perform independent recognition on each channel set + // `enable_separate_recognition_per_channel` to 'true'. + int32 audio_channel_count = 7; + + // This needs to be set to `true` explicitly and `audio_channel_count` > 1 + // to get each channel recognized separately. The recognition result will + // contain a `channel_tag` field to state which channel that result belongs + // to. If this is not true, we will only recognize the first channel. The + // request is billed cumulatively for all channels recognized: + // `audio_channel_count` multiplied by the length of the audio. + bool enable_separate_recognition_per_channel = 12; + + // Required. The language of the supplied audio as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + // Example: "en-US". + // See [Language + // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + // of the currently supported language codes. + string language_code = 3 [(google.api.field_behavior) = REQUIRED]; + + // A list of up to 3 additional + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, + // listing possible alternative languages of the supplied audio. + // See [Language + // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list + // of the currently supported language codes. If alternative languages are + // listed, recognition result will contain recognition in the most likely + // language detected including the main language_code. The recognition result + // will include the language tag of the language detected in the audio. Note: + // This feature is only supported for Voice Command and Voice Search use cases + // and performance may vary for other use cases (e.g., phone call + // transcription). + repeated string alternative_language_codes = 18; + + // Maximum number of recognition hypotheses to be returned. + // Specifically, the maximum number of `SpeechRecognitionAlternative` messages + // within each `SpeechRecognitionResult`. + // The server may return fewer than `max_alternatives`. + // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of + // one. If omitted, will return a maximum of one. + int32 max_alternatives = 4; + + // If set to `true`, the server will attempt to filter out + // profanities, replacing all but the initial character in each filtered word + // with asterisks, e.g. "f***". If set to `false` or omitted, profanities + // won't be filtered out. + bool profanity_filter = 5; + + // Speech adaptation configuration improves the accuracy of speech + // recognition. For more information, see the [speech + // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation) + // documentation. + // When speech adaptation is set it supersedes the `speech_contexts` field. + SpeechAdaptation adaptation = 20; + + // Use transcription normalization to automatically replace parts of the + // transcript with phrases of your choosing. For StreamingRecognize, this + // normalization only applies to stable partial transcripts (stability > 0.8) + // and final transcripts. + TranscriptNormalization transcript_normalization = 24; + + // Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext]. + // A means to provide context to assist the speech recognition. For more + // information, see + // [speech + // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation). + repeated SpeechContext speech_contexts = 6; + + // If `true`, the top result includes a list of words and + // the start and end time offsets (timestamps) for those words. If + // `false`, no word-level time offset information is returned. The default is + // `false`. + bool enable_word_time_offsets = 8; + + // If `true`, the top result includes a list of words and the + // confidence for those words. If `false`, no word-level confidence + // information is returned. The default is `false`. + bool enable_word_confidence = 15; + + // If 'true', adds punctuation to recognition result hypotheses. + // This feature is only available in select languages. Setting this for + // requests in other languages has no effect at all. + // The default 'false' value does not add punctuation to result hypotheses. + bool enable_automatic_punctuation = 11; + + // The spoken punctuation behavior for the call + // If not set, uses default behavior based on model of choice + // e.g. command_and_search will enable spoken punctuation by default + // If 'true', replaces spoken punctuation with the corresponding symbols in + // the request. For example, "how are you question mark" becomes "how are + // you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation + // for support. If 'false', spoken punctuation is not replaced. + google.protobuf.BoolValue enable_spoken_punctuation = 22; + + // The spoken emoji behavior for the call + // If not set, uses default behavior based on model of choice + // If 'true', adds spoken emoji formatting for the request. This will replace + // spoken emojis with the corresponding Unicode symbols in the final + // transcript. If 'false', spoken emojis are not replaced. + google.protobuf.BoolValue enable_spoken_emojis = 23; + + // If 'true', enables speaker detection for each recognized word in + // the top alternative of the recognition result using a speaker_tag provided + // in the WordInfo. + // Note: Use diarization_config instead. + bool enable_speaker_diarization = 16 [deprecated = true]; + + // If set, specifies the estimated number of speakers in the conversation. + // Defaults to '2'. Ignored unless enable_speaker_diarization is set to true. + // Note: Use diarization_config instead. + int32 diarization_speaker_count = 17 [deprecated = true]; + + // Config to enable speaker diarization and set additional + // parameters to make diarization better suited for your application. + // Note: When this is enabled, we send all the words from the beginning of the + // audio for the top alternative in every consecutive STREAMING responses. + // This is done in order to improve our speaker tags as our models learn to + // identify the speakers in the conversation over time. + // For non-streaming requests, the diarization results will be provided only + // in the top alternative of the FINAL SpeechRecognitionResult. + SpeakerDiarizationConfig diarization_config = 19; + + // Metadata regarding this request. + RecognitionMetadata metadata = 9; + + // Which model to select for the given request. Select the model + // best suited to your domain to get best results. If a model is not + // explicitly specified, then we auto-select a model based on the parameters + // in the RecognitionConfig. + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + //
ModelDescription
latest_longBest for long form content like media or conversation.
latest_shortBest for short form content like commands or single shot directed + // speech.
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically + // recorded at an 8khz sampling rate).
videoBest for audio that originated from video or includes multiple + // speakers. Ideally the audio is recorded at a 16khz or greater + // sampling rate. This is a premium model that costs more than the + // standard rate.
defaultBest for audio that is not one of the specific audio models. + // For example, long-form audio. Ideally the audio is high-fidelity, + // recorded at a 16khz or greater sampling rate.
medical_conversationBest for audio that originated from a conversation between a + // medical provider and patient.
medical_dictationBest for audio that originated from dictation notes by a medical + // provider.
+ string model = 13; + + // Set to true to use an enhanced model for speech recognition. + // If `use_enhanced` is set to true and the `model` field is not set, then + // an appropriate enhanced model is chosen if an enhanced model exists for + // the audio. + // + // If `use_enhanced` is true and an enhanced version of the specified model + // does not exist, then the speech is recognized using the standard version + // of the specified model. + bool use_enhanced = 14; +} + +// Config to enable speaker diarization. +message SpeakerDiarizationConfig { + // If 'true', enables speaker detection for each recognized word in + // the top alternative of the recognition result using a speaker_tag provided + // in the WordInfo. + bool enable_speaker_diarization = 1; + + // Minimum number of speakers in the conversation. This range gives you more + // flexibility by allowing the system to automatically determine the correct + // number of speakers. If not set, the default value is 2. + int32 min_speaker_count = 2; + + // Maximum number of speakers in the conversation. This range gives you more + // flexibility by allowing the system to automatically determine the correct + // number of speakers. If not set, the default value is 6. + int32 max_speaker_count = 3; + + // Output only. Unused. + int32 speaker_tag = 5 [ + deprecated = true, + (google.api.field_behavior) = OUTPUT_ONLY + ]; +} + +// Description of audio data to be recognized. +message RecognitionMetadata { + option deprecated = true; + + // Use case categories that the audio recognition request can be described + // by. + enum InteractionType { + // Use case is either unknown or is something other than one of the other + // values below. + INTERACTION_TYPE_UNSPECIFIED = 0; + + // Multiple people in a conversation or discussion. For example in a + // meeting with two or more people actively participating. Typically + // all the primary people speaking would be in the same room (if not, + // see PHONE_CALL) + DISCUSSION = 1; + + // One or more persons lecturing or presenting to others, mostly + // uninterrupted. + PRESENTATION = 2; + + // A phone-call or video-conference in which two or more people, who are + // not in the same room, are actively participating. + PHONE_CALL = 3; + + // A recorded message intended for another person to listen to. + VOICEMAIL = 4; + + // Professionally produced audio (eg. TV Show, Podcast). + PROFESSIONALLY_PRODUCED = 5; + + // Transcribe spoken questions and queries into text. + VOICE_SEARCH = 6; + + // Transcribe voice commands, such as for controlling a device. + VOICE_COMMAND = 7; + + // Transcribe speech to text to create a written document, such as a + // text-message, email or report. + DICTATION = 8; + } + + // Enumerates the types of capture settings describing an audio file. + enum MicrophoneDistance { + // Audio type is not known. + MICROPHONE_DISTANCE_UNSPECIFIED = 0; + + // The audio was captured from a closely placed microphone. Eg. phone, + // dictaphone, or handheld microphone. Generally if there speaker is within + // 1 meter of the microphone. + NEARFIELD = 1; + + // The speaker if within 3 meters of the microphone. + MIDFIELD = 2; + + // The speaker is more than 3 meters away from the microphone. + FARFIELD = 3; + } + + // The original media the speech was recorded on. + enum OriginalMediaType { + // Unknown original media type. + ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; + + // The speech data is an audio recording. + AUDIO = 1; + + // The speech data originally recorded on a video. + VIDEO = 2; + } + + // The type of device the speech was recorded with. + enum RecordingDeviceType { + // The recording device is unknown. + RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; + + // Speech was recorded on a smartphone. + SMARTPHONE = 1; + + // Speech was recorded using a personal computer or tablet. + PC = 2; + + // Speech was recorded over a phone line. + PHONE_LINE = 3; + + // Speech was recorded in a vehicle. + VEHICLE = 4; + + // Speech was recorded outdoors. + OTHER_OUTDOOR_DEVICE = 5; + + // Speech was recorded indoors. + OTHER_INDOOR_DEVICE = 6; + } + + // The use case most closely describing the audio content to be recognized. + InteractionType interaction_type = 1; + + // The industry vertical to which this speech recognition request most + // closely applies. This is most indicative of the topics contained + // in the audio. Use the 6-digit NAICS code to identify the industry + // vertical - see https://www.naics.com/search/. + uint32 industry_naics_code_of_audio = 3; + + // The audio type that most closely describes the audio being recognized. + MicrophoneDistance microphone_distance = 4; + + // The original media the speech was recorded on. + OriginalMediaType original_media_type = 5; + + // The type of device the speech was recorded with. + RecordingDeviceType recording_device_type = 6; + + // The device used to make the recording. Examples 'Nexus 5X' or + // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or + // 'Cardioid Microphone'. + string recording_device_name = 7; + + // Mime type of the original audio file. For example `audio/m4a`, + // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. + // A list of possible audio mime types is maintained at + // http://www.iana.org/assignments/media-types/media-types.xhtml#audio + string original_mime_type = 8; + + // Obfuscated (privacy-protected) ID of the user, to identify number of + // unique users using the service. + int64 obfuscated_id = 9 [deprecated = true]; + + // Description of the content. Eg. "Recordings of federal supreme court + // hearings from 2012". + string audio_topic = 10; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message SpeechContext { + // A list of strings containing words and phrases "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + // + // List items can also be set to classes for groups of words that represent + // common concepts that occur in natural language. For example, rather than + // providing phrase hints for every month of the year, using the $MONTH class + // improves the likelihood of correctly transcribing audio that includes + // months. + repeated string phrases = 1; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Negative boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost will simply be ignored. Though `boost` can + // accept a wide range of positive values, most use cases are best served with + // values between 0 and 20. We recommend using a binary search approach to + // finding the optimal value for your use case. + float boost = 4; +} + +// Contains audio data in the encoding specified in the `RecognitionConfig`. +// Either `content` or `uri` must be supplied. Supplying both or neither +// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See +// [content limits](https://cloud.google.com/speech-to-text/quotas#content). +message RecognitionAudio { + // The audio source, which is either inline content or a Google Cloud + // Storage uri. + oneof audio_source { + // The audio data bytes encoded as specified in + // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a + // pure binary representation, whereas JSON representations use base64. + bytes content = 1; + + // URI that points to a file that contains audio data bytes as specified in + // `RecognitionConfig`. The file must not be compressed (for example, gzip). + // Currently, only Google Cloud Storage URIs are + // supported, which must be specified in the following format: + // `gs://bucket_name/object_name` (other URI formats return + // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see + // [Request URIs](https://cloud.google.com/storage/docs/reference-uris). + string uri = 2; + } +} + +// The only message returned to the client by the `Recognize` method. It +// contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. +message RecognizeResponse { + // Sequential list of transcription results corresponding to + // sequential portions of audio. + repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; +} + +// The only message returned to the client by the `LongRunningRecognize` method. +// It contains the result as zero or more sequential `SpeechRecognitionResult` +// messages. It is included in the `result.response` field of the `Operation` +// returned by the `GetOperation` call of the `google::longrunning::Operations` +// service. +message LongRunningRecognizeResponse { + // Sequential list of transcription results corresponding to + // sequential portions of audio. + repeated SpeechRecognitionResult results = 2; + + // When available, billed audio seconds for the corresponding request. + google.protobuf.Duration total_billed_time = 3; + + // Original output config if present in the request. + TranscriptOutputConfig output_config = 6; + + // If the transcript output fails this field contains the relevant error. + google.rpc.Status output_error = 7; +} + +// Describes the progress of a long-running `LongRunningRecognize` call. It is +// included in the `metadata` field of the `Operation` returned by the +// `GetOperation` call of the `google::longrunning::Operations` service. +message LongRunningRecognizeMetadata { + // Approximate percentage of audio processed thus far. Guaranteed to be 100 + // when the audio is fully processed and the results are available. + int32 progress_percent = 1; + + // Time when the request was received. + google.protobuf.Timestamp start_time = 2; + + // Time of the most recent processing update. + google.protobuf.Timestamp last_update_time = 3; + + // Output only. The URI of the audio file being transcribed. Empty if the audio was sent + // as byte content. + string uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A copy of the TranscriptOutputConfig if it was set in the request. + TranscriptOutputConfig output_config = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `StreamingRecognizeResponse` is the only message returned to the client by +// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` +// messages are streamed back to the client. If there is no recognizable +// audio, and `single_utterance` is set to false, then no messages are streamed +// back to the client. +// +// Here's an example of a series of `StreamingRecognizeResponse`s that might be +// returned while processing audio: +// +// 1. results { alternatives { transcript: "tube" } stability: 0.01 } +// +// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } +// +// 3. results { alternatives { transcript: "to be" } stability: 0.9 } +// results { alternatives { transcript: " or not to be" } stability: 0.01 } +// +// 4. results { alternatives { transcript: "to be or not to be" +// confidence: 0.92 } +// alternatives { transcript: "to bee or not to bee" } +// is_final: true } +// +// 5. results { alternatives { transcript: " that's" } stability: 0.01 } +// +// 6. results { alternatives { transcript: " that is" } stability: 0.9 } +// results { alternatives { transcript: " the question" } stability: 0.01 } +// +// 7. results { alternatives { transcript: " that is the question" +// confidence: 0.98 } +// alternatives { transcript: " that was the question" } +// is_final: true } +// +// Notes: +// +// - Only two of the above responses #4 and #7 contain final results; they are +// indicated by `is_final: true`. Concatenating these together generates the +// full transcript: "to be or not to be that is the question". +// +// - The others contain interim `results`. #3 and #6 contain two interim +// `results`: the first portion has a high stability and is less likely to +// change; the second portion has a low stability and is very likely to +// change. A UI designer might choose to show only high stability `results`. +// +// - The specific `stability` and `confidence` values shown above are only for +// illustrative purposes. Actual values may vary. +// +// - In each response, only one of these fields will be set: +// `error`, +// `speech_event_type`, or +// one or more (repeated) `results`. +message StreamingRecognizeResponse { + // Indicates the type of speech event. + enum SpeechEventType { + // No speech event specified. + SPEECH_EVENT_UNSPECIFIED = 0; + + // This event indicates that the server has detected the end of the user's + // speech utterance and expects no additional speech. Therefore, the server + // will not process additional audio (although it may subsequently return + // additional results). The client should stop sending additional audio + // data, half-close the gRPC connection, and wait for any additional results + // until the server closes the gRPC connection. This event is only sent if + // `single_utterance` was set to `true`, and is not used otherwise. + END_OF_SINGLE_UTTERANCE = 1; + } + + // If set, returns a [google.rpc.Status][google.rpc.Status] message that + // specifies the error for the operation. + google.rpc.Status error = 1; + + // This repeated list contains zero or more results that + // correspond to consecutive portions of the audio currently being processed. + // It contains zero or one `is_final=true` result (the newly settled portion), + // followed by zero or more `is_final=false` results (the interim results). + repeated StreamingRecognitionResult results = 2; + + // Indicates the type of speech event. + SpeechEventType speech_event_type = 4; + + // When available, billed audio seconds for the stream. + // Set only if this is the last response in the stream. + google.protobuf.Duration total_billed_time = 5; +} + +// A streaming speech recognition result corresponding to a portion of the audio +// that is currently being processed. +message StreamingRecognitionResult { + // May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // If `false`, this `StreamingRecognitionResult` represents an + // interim result that may change. If `true`, this is the final time the + // speech service will return this particular `StreamingRecognitionResult`, + // the recognizer will not return any further hypotheses for this portion of + // the transcript and corresponding audio. + bool is_final = 2; + + // An estimate of the likelihood that the recognizer will not + // change its guess about this interim result. Values range from 0.0 + // (completely unstable) to 1.0 (completely stable). + // This field is only provided for interim results (`is_final=false`). + // The default of 0.0 is a sentinel value indicating `stability` was not set. + float stability = 3; + + // Time offset of the end of this result relative to the + // beginning of the audio. + google.protobuf.Duration result_end_time = 4; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For audio_channel_count = N, its output values can range from '1' to 'N'. + int32 channel_tag = 5; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag + // of the language in this result. This language code was detected to have + // the most likelihood of being spoken in the audio. + string language_code = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A speech recognition result corresponding to a portion of the audio. +message SpeechRecognitionResult { + // May contain one or more recognition hypotheses (up to the + // maximum specified in `max_alternatives`). + // These alternatives are ordered in terms of accuracy, with the top (first) + // alternative being the most probable, as ranked by the recognizer. + repeated SpeechRecognitionAlternative alternatives = 1; + + // For multi-channel audio, this is the channel number corresponding to the + // recognized result for the audio from that channel. + // For audio_channel_count = N, its output values can range from '1' to 'N'. + int32 channel_tag = 2; + + // Time offset of the end of this result relative to the + // beginning of the audio. + google.protobuf.Duration result_end_time = 4; + + // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag + // of the language in this result. This language code was detected to have + // the most likelihood of being spoken in the audio. + string language_code = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Alternative hypotheses (a.k.a. n-best list). +message SpeechRecognitionAlternative { + // Transcript text representing the words that the user spoke. + // In languages that use spaces to separate words, the transcript might have a + // leading space if it isn't the first result. You can concatenate each result + // to obtain the full transcript without using a separator. + string transcript = 1; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where `is_final=true`. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 2; + + // A list of word-specific information for each recognized word. + // Note: When `enable_speaker_diarization` is true, you will see all the words + // from the beginning of the audio. + repeated WordInfo words = 3; +} + +// Word-specific information for recognized words. +message WordInfo { + // Time offset relative to the beginning of the audio, + // and corresponding to the start of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + google.protobuf.Duration start_time = 1; + + // Time offset relative to the beginning of the audio, + // and corresponding to the end of the spoken word. + // This field is only set if `enable_word_time_offsets=true` and only + // in the top hypothesis. + // This is an experimental feature and the accuracy of the time offset can + // vary. + google.protobuf.Duration end_time = 2; + + // The word corresponding to this set of information. + string word = 3; + + // The confidence estimate between 0.0 and 1.0. A higher number + // indicates an estimated greater likelihood that the recognized words are + // correct. This field is set only for the top alternative of a non-streaming + // result or, of a streaming result where `is_final=true`. + // This field is not guaranteed to be accurate and users should not rely on it + // to be always provided. + // The default of 0.0 is a sentinel value indicating `confidence` was not set. + float confidence = 4; + + // Output only. A distinct integer value is assigned for every speaker within + // the audio. This field specifies which one of those speakers was detected to + // have spoken this word. Value ranges from '1' to diarization_speaker_count. + // speaker_tag is set if enable_speaker_diarization = 'true' and only in the + // top alternative. + int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto new file mode 100644 index 000000000000..45ca97f2d13a --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto @@ -0,0 +1,370 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/speech/v1p1beta1/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech"; +option java_multiple_files = true; +option java_outer_classname = "SpeechAdaptationProto"; +option java_package = "com.google.cloud.speech.v1p1beta1"; +option objc_class_prefix = "GCS"; + +// Service that implements Google Cloud Speech Adaptation API. +service Adaptation { + option (google.api.default_host) = "speech.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Create a set of phrase hints. Each item in the set can be a single word or + // a multi-word phrase. The items in the PhraseSet are favored by the + // recognition model when you send a call that includes the PhraseSet. + rpc CreatePhraseSet(CreatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets" + body: "*" + }; + option (google.api.method_signature) = "parent,phrase_set,phrase_set_id"; + } + + // Get a phrase set. + rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + get: "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List phrase sets. + rpc ListPhraseSet(ListPhraseSetRequest) returns (ListPhraseSetResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a phrase set. + rpc UpdatePhraseSet(UpdatePhraseSetRequest) returns (PhraseSet) { + option (google.api.http) = { + patch: "/v1p1beta1/{phrase_set.name=projects/*/locations/*/phraseSets/*}" + body: "phrase_set" + }; + option (google.api.method_signature) = "phrase_set,update_mask"; + } + + // Delete a phrase set. + rpc DeletePhraseSet(DeletePhraseSetRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Create a custom class. + rpc CreateCustomClass(CreateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + post: "/v1p1beta1/{parent=projects/*/locations/*}/customClasses" + body: "*" + }; + option (google.api.method_signature) = "parent,custom_class,custom_class_id"; + } + + // Get a custom class. + rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + get: "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List custom classes. + rpc ListCustomClasses(ListCustomClassesRequest) returns (ListCustomClassesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{parent=projects/*/locations/*}/customClasses" + }; + option (google.api.method_signature) = "parent"; + } + + // Update a custom class. + rpc UpdateCustomClass(UpdateCustomClassRequest) returns (CustomClass) { + option (google.api.http) = { + patch: "/v1p1beta1/{custom_class.name=projects/*/locations/*/customClasses/*}" + body: "custom_class" + }; + option (google.api.method_signature) = "custom_class,update_mask"; + } + + // Delete a custom class. + rpc DeleteCustomClass(DeleteCustomClassRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Message sent by the client for the `CreatePhraseSet` method. +message CreatePhraseSetRequest { + // Required. The parent resource where this phrase set will be created. Format: + // + // `projects/{project}/locations/{location}/phraseSets` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // Required. The ID to use for the phrase set, which will become the final + // component of the phrase set's resource name. + // + // This value should restrict to letters, numbers, and hyphens, with the first + // character a letter, the last a letter or a number, and be 4-63 characters. + string phrase_set_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The phrase set to create. + PhraseSet phrase_set = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdatePhraseSet` method. +message UpdatePhraseSetRequest { + // Required. The phrase set to update. + // + // The phrase set's `name` field is used to identify the set to be + // updated. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetPhraseSet` method. +message GetPhraseSetRequest { + // Required. The name of the phrase set to retrieve. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `ListPhraseSet` method. +message ListPhraseSetRequest { + // Required. The parent, which owns this collection of phrase set. Format: + // + // `projects/{project}/locations/{location}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/PhraseSet" + } + ]; + + // The maximum number of phrase sets to return. The service may return + // fewer than this value. If unspecified, at most 50 phrase sets will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListPhraseSet` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListPhraseSet` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListPhraseSet` method. +message ListPhraseSetResponse { + // The phrase set. + repeated PhraseSet phrase_sets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeletePhraseSet` method. +message DeletePhraseSetRequest { + // Required. The name of the phrase set to delete. Format: + // + // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + } + ]; +} + +// Message sent by the client for the `CreateCustomClass` method. +message CreateCustomClassRequest { + // Required. The parent resource where this custom class will be created. Format: + // + // `projects/{project}/locations/{location}/customClasses` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // Required. The ID to use for the custom class, which will become the final + // component of the custom class' resource name. + // + // This value should restrict to letters, numbers, and hyphens, with the first + // character a letter, the last a letter or a number, and be 4-63 characters. + string custom_class_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The custom class to create. + CustomClass custom_class = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Message sent by the client for the `UpdateCustomClass` method. +message UpdateCustomClassRequest { + // Required. The custom class to update. + // + // The custom class's `name` field is used to identify the custom class to be + // updated. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Message sent by the client for the `GetCustomClass` method. +message GetCustomClassRequest { + // Required. The name of the custom class to retrieve. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} + +// Message sent by the client for the `ListCustomClasses` method. +message ListCustomClassesRequest { + // Required. The parent, which owns this collection of custom classes. Format: + // + // `projects/{project}/locations/{location}/customClasses` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "speech.googleapis.com/CustomClass" + } + ]; + + // The maximum number of custom classes to return. The service may return + // fewer than this value. If unspecified, at most 50 custom classes will be + // returned. The maximum value is 1000; values above 1000 will be coerced to + // 1000. + int32 page_size = 2; + + // A page token, received from a previous `ListCustomClass` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListCustomClass` must + // match the call that provided the page token. + string page_token = 3; +} + +// Message returned to the client by the `ListCustomClasses` method. +message ListCustomClassesResponse { + // The custom classes. + repeated CustomClass custom_classes = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message sent by the client for the `DeleteCustomClass` method. +message DeleteCustomClassRequest { + // Required. The name of the custom class to delete. Format: + // + // `projects/{project}/locations/{location}/customClasses/{custom_class}` + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) + // with matching `us` or `eu` location value. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "speech.googleapis.com/CustomClass" + } + ]; +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto new file mode 100644 index 000000000000..0323b19e22e9 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto @@ -0,0 +1,162 @@ +// 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. + +syntax = "proto3"; + +package google.cloud.speech.v1p1beta1; + +import "google/api/resource.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech"; +option java_multiple_files = true; +option java_outer_classname = "SpeechResourceProto"; +option java_package = "com.google.cloud.speech.v1p1beta1"; +option objc_class_prefix = "GCS"; + +// A set of words or phrases that represents a common concept likely to appear +// in your audio, for example a list of passenger ship names. CustomClass items +// can be substituted into placeholders that you set in PhraseSet phrases. +message CustomClass { + option (google.api.resource) = { + type: "speech.googleapis.com/CustomClass" + pattern: "projects/{project}/locations/{location}/customClasses/{custom_class}" + }; + + // An item of the class. + message ClassItem { + // The class item's value. + string value = 1; + } + + // The resource name of the custom class. + string name = 1; + + // If this custom class is a resource, the custom_class_id is the resource id + // of the CustomClass. Case sensitive. + string custom_class_id = 2; + + // A collection of class items. + repeated ClassItem items = 3; +} + +// Provides "hints" to the speech recognizer to favor specific words and phrases +// in the results. +message PhraseSet { + option (google.api.resource) = { + type: "speech.googleapis.com/PhraseSet" + pattern: "projects/{project}/locations/{location}/phraseSets/{phrase_set}" + }; + + // A phrases containing words and phrase "hints" so that + // the speech recognition is more likely to recognize them. This can be used + // to improve the accuracy for specific words and phrases, for example, if + // specific commands are typically spoken by the user. This can also be used + // to add additional words to the vocabulary of the recognizer. See + // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). + // + // List items can also include pre-built or custom classes containing groups + // of words that represent common concepts that occur in natural language. For + // example, rather than providing a phrase hint for every month of the + // year (e.g. "i was born in january", "i was born in febuary", ...), use the + // pre-built `$MONTH` class improves the likelihood of correctly transcribing + // audio that includes months (e.g. "i was born in $month"). + // To refer to pre-built classes, use the class' symbol prepended with `$` + // e.g. `$MONTH`. To refer to custom classes that were defined inline in the + // request, set the class's `custom_class_id` to a string unique to all class + // resources and inline classes. Then use the class' id wrapped in $`{...}` + // e.g. "${my-months}". To refer to custom classes resources, use the class' + // id wrapped in `${}` (e.g. `${my-months}`). + // + // Speech-to-Text supports three locations: `global`, `us` (US North America), + // and `eu` (Europe). If you are calling the `speech.googleapis.com` + // endpoint, use the `global` location. To specify a region, use a + // [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or + // `eu` location value. + message Phrase { + // The phrase itself. + string value = 1; + + // Hint Boost. Overrides the boost set at the phrase set level. + // Positive value will increase the probability that a specific phrase will + // be recognized over other similar sounding phrases. The higher the boost, + // the higher the chance of false positive recognition as well. Negative + // boost will simply be ignored. Though `boost` can accept a wide range of + // positive values, most use cases are best served + // with values between 0 and 20. We recommend using a binary search approach + // to finding the optimal value for your use case. Speech recognition + // will skip PhraseSets with a boost value of 0. + float boost = 2; + } + + // The resource name of the phrase set. + string name = 1; + + // A list of word and phrases. + repeated Phrase phrases = 2; + + // Hint Boost. Positive value will increase the probability that a specific + // phrase will be recognized over other similar sounding phrases. The higher + // the boost, the higher the chance of false positive recognition as well. + // Negative boost values would correspond to anti-biasing. Anti-biasing is not + // enabled, so negative boost will simply be ignored. Though `boost` can + // accept a wide range of positive values, most use cases are best served with + // values between 0 (exclusive) and 20. We recommend using a binary search + // approach to finding the optimal value for your use case. Speech recognition + // will skip PhraseSets with a boost value of 0. + float boost = 4; +} + +// Speech adaptation configuration. +message SpeechAdaptation { + // A collection of phrase sets. To specify the hints inline, leave the + // phrase set's `name` blank and fill in the rest of its fields. Any + // phrase set can use any custom class. + repeated PhraseSet phrase_sets = 1; + + // A collection of phrase set resource names to use. + repeated string phrase_set_references = 2 [(google.api.resource_reference) = { + type: "speech.googleapis.com/PhraseSet" + }]; + + // A collection of custom classes. To specify the classes inline, leave the + // class' `name` blank and fill in the rest of its fields, giving it a unique + // `custom_class_id`. Refer to the inline defined class in phrase hints by its + // `custom_class_id`. + repeated CustomClass custom_classes = 3; +} + +// Transcription normalization configuration. Use transcription normalization +// to automatically replace parts of the transcript with phrases of your +// choosing. For StreamingRecognize, this normalization only applies to stable +// partial transcripts (stability > 0.8) and final transcripts. +message TranscriptNormalization { + // A single replacement configuration. + message Entry { + // What to replace. Max length is 100 characters. + string search = 1; + + // What to replace with. Max length is 100 characters. + string replace = 2; + + // Whether the search is case sensitive. + bool case_sensitive = 3; + } + + // A list of replacement entries. We will perform replacement with one entry + // at a time. For example, the second entry in ["cat" => "dog", "mountain cat" + // => "mountain dog"] will never be applied because we will always process the + // first entry before it. At most 100 entries. + repeated Entry entries = 1; +} diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..bd56643098c5 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.AdaptationSettings; +import com.google.cloud.speech.v1p1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AdaptationSettings adaptationSettings = + AdaptationSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings); + } +} +// [END speech_v1p1beta1_generated_adaptationclient_create_setcredentialsprovider_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..40dc533c48fd --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,43 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_create_setcredentialsprovider1_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.AdaptationSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AdaptationSettings adaptationSettings = + AdaptationSettings.newBuilder() + .setTransportChannelProvider( + AdaptationSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings); + } +} +// [END speech_v1p1beta1_generated_adaptationclient_create_setcredentialsprovider1_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetEndpoint.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..7e99d78cb982 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_create_setendpoint_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.AdaptationSettings; +import com.google.cloud.speech.v1p1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AdaptationSettings adaptationSettings = + AdaptationSettings.newBuilder().setEndpoint(myEndpoint).build(); + AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings); + } +} +// [END speech_v1p1beta1_generated_adaptationclient_create_setendpoint_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java new file mode 100644 index 000000000000..1a57cc82156b --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java @@ -0,0 +1,52 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_createcustomclass_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.LocationName; + +public class AsyncCreateCustomClass { + + public static void main(String[] args) throws Exception { + asyncCreateCustomClass(); + } + + public static void asyncCreateCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CreateCustomClassRequest request = + CreateCustomClassRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setCustomClassId("customClassId1871032322") + .setCustomClass(CustomClass.newBuilder().build()) + .build(); + ApiFuture future = + adaptationClient.createCustomClassCallable().futureCall(request); + // Do something. + CustomClass response = future.get(); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_createcustomclass_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClass.java new file mode 100644 index 000000000000..2be35900c160 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClass.java @@ -0,0 +1,48 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_createcustomclass_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.LocationName; + +public class SyncCreateCustomClass { + + public static void main(String[] args) throws Exception { + syncCreateCustomClass(); + } + + public static void syncCreateCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CreateCustomClassRequest request = + CreateCustomClassRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setCustomClassId("customClassId1871032322") + .setCustomClass(CustomClass.newBuilder().build()) + .build(); + CustomClass response = adaptationClient.createCustomClass(request); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_createcustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java new file mode 100644 index 000000000000..8ed1a4df7997 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_createcustomclass_locationnamecustomclassstring_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.LocationName; + +public class SyncCreateCustomClassLocationnameCustomclassString { + + public static void main(String[] args) throws Exception { + syncCreateCustomClassLocationnameCustomclassString(); + } + + public static void syncCreateCustomClassLocationnameCustomclassString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_createcustomclass_locationnamecustomclassstring_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java new file mode 100644 index 000000000000..590bb5f11c91 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_createcustomclass_stringcustomclassstring_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.LocationName; + +public class SyncCreateCustomClassStringCustomclassString { + + public static void main(String[] args) throws Exception { + syncCreateCustomClassStringCustomclassString(); + } + + public static void syncCreateCustomClassStringCustomclassString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + CustomClass customClass = CustomClass.newBuilder().build(); + String customClassId = "customClassId1871032322"; + CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_createcustomclass_stringcustomclassstring_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java new file mode 100644 index 000000000000..57803528152b --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_createphraseset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.LocationName; +import com.google.cloud.speech.v1p1beta1.PhraseSet; + +public class AsyncCreatePhraseSet { + + public static void main(String[] args) throws Exception { + asyncCreatePhraseSet(); + } + + public static void asyncCreatePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CreatePhraseSetRequest request = + CreatePhraseSetRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPhraseSetId("phraseSetId959902180") + .setPhraseSet(PhraseSet.newBuilder().build()) + .build(); + ApiFuture future = adaptationClient.createPhraseSetCallable().futureCall(request); + // Do something. + PhraseSet response = future.get(); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_createphraseset_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSet.java new file mode 100644 index 000000000000..c2f19902a694 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSet.java @@ -0,0 +1,48 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_createphraseset_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.LocationName; +import com.google.cloud.speech.v1p1beta1.PhraseSet; + +public class SyncCreatePhraseSet { + + public static void main(String[] args) throws Exception { + syncCreatePhraseSet(); + } + + public static void syncCreatePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CreatePhraseSetRequest request = + CreatePhraseSetRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPhraseSetId("phraseSetId959902180") + .setPhraseSet(PhraseSet.newBuilder().build()) + .build(); + PhraseSet response = adaptationClient.createPhraseSet(request); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_createphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java new file mode 100644 index 000000000000..112bc429067a --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_createphraseset_locationnamephrasesetstring_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.LocationName; +import com.google.cloud.speech.v1p1beta1.PhraseSet; + +public class SyncCreatePhraseSetLocationnamePhrasesetString { + + public static void main(String[] args) throws Exception { + syncCreatePhraseSetLocationnamePhrasesetString(); + } + + public static void syncCreatePhraseSetLocationnamePhrasesetString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_createphraseset_locationnamephrasesetstring_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java new file mode 100644 index 000000000000..affa84e49e19 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_createphraseset_stringphrasesetstring_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.LocationName; +import com.google.cloud.speech.v1p1beta1.PhraseSet; + +public class SyncCreatePhraseSetStringPhrasesetString { + + public static void main(String[] args) throws Exception { + syncCreatePhraseSetStringPhrasesetString(); + } + + public static void syncCreatePhraseSetStringPhrasesetString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + String phraseSetId = "phraseSetId959902180"; + PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_createphraseset_stringphrasesetstring_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java new file mode 100644 index 000000000000..dc0d07516a46 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_deletecustomclass_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClassName; +import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; +import com.google.protobuf.Empty; + +public class AsyncDeleteCustomClass { + + public static void main(String[] args) throws Exception { + asyncDeleteCustomClass(); + } + + public static void asyncDeleteCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + DeleteCustomClassRequest request = + DeleteCustomClassRequest.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .build(); + ApiFuture future = adaptationClient.deleteCustomClassCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_deletecustomclass_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java new file mode 100644 index 000000000000..5df45e9c584a --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java @@ -0,0 +1,46 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_deletecustomclass_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClassName; +import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteCustomClass { + + public static void main(String[] args) throws Exception { + syncDeleteCustomClass(); + } + + public static void syncDeleteCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + DeleteCustomClassRequest request = + DeleteCustomClassRequest.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .build(); + adaptationClient.deleteCustomClass(request); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_deletecustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java new file mode 100644 index 000000000000..72435684800e --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_deletecustomclass_customclassname_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClassName; +import com.google.protobuf.Empty; + +public class SyncDeleteCustomClassCustomclassname { + + public static void main(String[] args) throws Exception { + syncDeleteCustomClassCustomclassname(); + } + + public static void syncDeleteCustomClassCustomclassname() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + adaptationClient.deleteCustomClass(name); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_deletecustomclass_customclassname_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java new file mode 100644 index 000000000000..7e7156e465d0 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_deletecustomclass_string_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClassName; +import com.google.protobuf.Empty; + +public class SyncDeleteCustomClassString { + + public static void main(String[] args) throws Exception { + syncDeleteCustomClassString(); + } + + public static void syncDeleteCustomClassString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString(); + adaptationClient.deleteCustomClass(name); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_deletecustomclass_string_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java new file mode 100644 index 000000000000..1f2090dd100e --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_deletephraseset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.PhraseSetName; +import com.google.protobuf.Empty; + +public class AsyncDeletePhraseSet { + + public static void main(String[] args) throws Exception { + asyncDeletePhraseSet(); + } + + public static void asyncDeletePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + DeletePhraseSetRequest request = + DeletePhraseSetRequest.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .build(); + ApiFuture future = adaptationClient.deletePhraseSetCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_deletephraseset_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java new file mode 100644 index 000000000000..ad1e94c7c5fd --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java @@ -0,0 +1,46 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_deletephraseset_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.PhraseSetName; +import com.google.protobuf.Empty; + +public class SyncDeletePhraseSet { + + public static void main(String[] args) throws Exception { + syncDeletePhraseSet(); + } + + public static void syncDeletePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + DeletePhraseSetRequest request = + DeletePhraseSetRequest.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .build(); + adaptationClient.deletePhraseSet(request); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_deletephraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java new file mode 100644 index 000000000000..8ce8766e5751 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_deletephraseset_phrasesetname_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.PhraseSetName; +import com.google.protobuf.Empty; + +public class SyncDeletePhraseSetPhrasesetname { + + public static void main(String[] args) throws Exception { + syncDeletePhraseSetPhrasesetname(); + } + + public static void syncDeletePhraseSetPhrasesetname() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + adaptationClient.deletePhraseSet(name); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_deletephraseset_phrasesetname_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java new file mode 100644 index 000000000000..b4f5722e1e10 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_deletephraseset_string_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.PhraseSetName; +import com.google.protobuf.Empty; + +public class SyncDeletePhraseSetString { + + public static void main(String[] args) throws Exception { + syncDeletePhraseSetString(); + } + + public static void syncDeletePhraseSetString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString(); + adaptationClient.deletePhraseSet(name); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_deletephraseset_string_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/AsyncGetCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/AsyncGetCustomClass.java new file mode 100644 index 000000000000..2ed74756b1bb --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/AsyncGetCustomClass.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_getcustomclass_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.CustomClassName; +import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; + +public class AsyncGetCustomClass { + + public static void main(String[] args) throws Exception { + asyncGetCustomClass(); + } + + public static void asyncGetCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + GetCustomClassRequest request = + GetCustomClassRequest.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .build(); + ApiFuture future = adaptationClient.getCustomClassCallable().futureCall(request); + // Do something. + CustomClass response = future.get(); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_getcustomclass_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClass.java new file mode 100644 index 000000000000..c64a6bef5189 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClass.java @@ -0,0 +1,46 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_getcustomclass_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.CustomClassName; +import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; + +public class SyncGetCustomClass { + + public static void main(String[] args) throws Exception { + syncGetCustomClass(); + } + + public static void syncGetCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + GetCustomClassRequest request = + GetCustomClassRequest.newBuilder() + .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) + .build(); + CustomClass response = adaptationClient.getCustomClass(request); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_getcustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java new file mode 100644 index 000000000000..a755bb8d2a11 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_getcustomclass_customclassname_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.CustomClassName; + +public class SyncGetCustomClassCustomclassname { + + public static void main(String[] args) throws Exception { + syncGetCustomClassCustomclassname(); + } + + public static void syncGetCustomClassCustomclassname() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); + CustomClass response = adaptationClient.getCustomClass(name); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_getcustomclass_customclassname_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassString.java new file mode 100644 index 000000000000..e4b6e750001c --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassString.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_getcustomclass_string_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.CustomClassName; + +public class SyncGetCustomClassString { + + public static void main(String[] args) throws Exception { + syncGetCustomClassString(); + } + + public static void syncGetCustomClassString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString(); + CustomClass response = adaptationClient.getCustomClass(name); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_getcustomclass_string_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/AsyncGetPhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/AsyncGetPhraseSet.java new file mode 100644 index 000000000000..7c39172024d7 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/AsyncGetPhraseSet.java @@ -0,0 +1,49 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_getphraseset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.PhraseSetName; + +public class AsyncGetPhraseSet { + + public static void main(String[] args) throws Exception { + asyncGetPhraseSet(); + } + + public static void asyncGetPhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + GetPhraseSetRequest request = + GetPhraseSetRequest.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .build(); + ApiFuture future = adaptationClient.getPhraseSetCallable().futureCall(request); + // Do something. + PhraseSet response = future.get(); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_getphraseset_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSet.java new file mode 100644 index 000000000000..5a74538b1781 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSet.java @@ -0,0 +1,46 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_getphraseset_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.PhraseSetName; + +public class SyncGetPhraseSet { + + public static void main(String[] args) throws Exception { + syncGetPhraseSet(); + } + + public static void syncGetPhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + GetPhraseSetRequest request = + GetPhraseSetRequest.newBuilder() + .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) + .build(); + PhraseSet response = adaptationClient.getPhraseSet(request); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_getphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java new file mode 100644 index 000000000000..f441e0cb1feb --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_getphraseset_phrasesetname_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.PhraseSetName; + +public class SyncGetPhraseSetPhrasesetname { + + public static void main(String[] args) throws Exception { + syncGetPhraseSetPhrasesetname(); + } + + public static void syncGetPhraseSetPhrasesetname() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); + PhraseSet response = adaptationClient.getPhraseSet(name); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_getphraseset_phrasesetname_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetString.java new file mode 100644 index 000000000000..19b5e9a5e0f1 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetString.java @@ -0,0 +1,42 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_getphraseset_string_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.PhraseSetName; + +public class SyncGetPhraseSetString { + + public static void main(String[] args) throws Exception { + syncGetPhraseSetString(); + } + + public static void syncGetPhraseSetString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString(); + PhraseSet response = adaptationClient.getPhraseSet(name); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_getphraseset_string_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java new file mode 100644 index 000000000000..064a5e84c973 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java @@ -0,0 +1,54 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_listcustomclasses_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; +import com.google.cloud.speech.v1p1beta1.LocationName; + +public class AsyncListCustomClasses { + + public static void main(String[] args) throws Exception { + asyncListCustomClasses(); + } + + public static void asyncListCustomClasses() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + ListCustomClassesRequest request = + ListCustomClassesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + adaptationClient.listCustomClassesPagedCallable().futureCall(request); + // Do something. + for (CustomClass element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_listcustomclasses_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java new file mode 100644 index 000000000000..8c3746eb2d89 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java @@ -0,0 +1,62 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_listcustomclasses_paged_async] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; +import com.google.cloud.speech.v1p1beta1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListCustomClassesPaged { + + public static void main(String[] args) throws Exception { + asyncListCustomClassesPaged(); + } + + public static void asyncListCustomClassesPaged() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + ListCustomClassesRequest request = + ListCustomClassesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListCustomClassesResponse response = + adaptationClient.listCustomClassesCallable().call(request); + for (CustomClass element : response.getCustomClassesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_listcustomclasses_paged_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClasses.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClasses.java new file mode 100644 index 000000000000..e27771c35830 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClasses.java @@ -0,0 +1,50 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_listcustomclasses_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; +import com.google.cloud.speech.v1p1beta1.LocationName; + +public class SyncListCustomClasses { + + public static void main(String[] args) throws Exception { + syncListCustomClasses(); + } + + public static void syncListCustomClasses() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + ListCustomClassesRequest request = + ListCustomClassesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (CustomClass element : adaptationClient.listCustomClasses(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_listcustomclasses_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java new file mode 100644 index 000000000000..c3713e7649d1 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_listcustomclasses_locationname_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.LocationName; + +public class SyncListCustomClassesLocationname { + + public static void main(String[] args) throws Exception { + syncListCustomClassesLocationname(); + } + + public static void syncListCustomClassesLocationname() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_listcustomclasses_locationname_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java new file mode 100644 index 000000000000..b562359e71d1 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_listcustomclasses_string_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.LocationName; + +public class SyncListCustomClassesString { + + public static void main(String[] args) throws Exception { + syncListCustomClassesString(); + } + + public static void syncListCustomClassesString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_listcustomclasses_string_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSet.java new file mode 100644 index 000000000000..ddd8ac9c5a6e --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSet.java @@ -0,0 +1,54 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_listphraseset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.LocationName; +import com.google.cloud.speech.v1p1beta1.PhraseSet; + +public class AsyncListPhraseSet { + + public static void main(String[] args) throws Exception { + asyncListPhraseSet(); + } + + public static void asyncListPhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + ListPhraseSetRequest request = + ListPhraseSetRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + adaptationClient.listPhraseSetPagedCallable().futureCall(request); + // Do something. + for (PhraseSet element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_listphraseset_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java new file mode 100644 index 000000000000..fdce15bfc4e7 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java @@ -0,0 +1,61 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_listphraseset_paged_async] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; +import com.google.cloud.speech.v1p1beta1.LocationName; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.common.base.Strings; + +public class AsyncListPhraseSetPaged { + + public static void main(String[] args) throws Exception { + asyncListPhraseSetPaged(); + } + + public static void asyncListPhraseSetPaged() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + ListPhraseSetRequest request = + ListPhraseSetRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListPhraseSetResponse response = adaptationClient.listPhraseSetCallable().call(request); + for (PhraseSet element : response.getPhraseSetsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_listphraseset_paged_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSet.java new file mode 100644 index 000000000000..aece2277d57d --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSet.java @@ -0,0 +1,50 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_listphraseset_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; +import com.google.cloud.speech.v1p1beta1.LocationName; +import com.google.cloud.speech.v1p1beta1.PhraseSet; + +public class SyncListPhraseSet { + + public static void main(String[] args) throws Exception { + syncListPhraseSet(); + } + + public static void syncListPhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + ListPhraseSetRequest request = + ListPhraseSetRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (PhraseSet element : adaptationClient.listPhraseSet(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_listphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java new file mode 100644 index 000000000000..c420799768e8 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_listphraseset_locationname_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.LocationName; +import com.google.cloud.speech.v1p1beta1.PhraseSet; + +public class SyncListPhraseSetLocationname { + + public static void main(String[] args) throws Exception { + syncListPhraseSetLocationname(); + } + + public static void syncListPhraseSetLocationname() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_listphraseset_locationname_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetString.java new file mode 100644 index 000000000000..19588c874862 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetString.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_listphraseset_string_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.LocationName; +import com.google.cloud.speech.v1p1beta1.PhraseSet; + +public class SyncListPhraseSetString { + + public static void main(String[] args) throws Exception { + syncListPhraseSetString(); + } + + public static void syncListPhraseSetString() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_listphraseset_string_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java new file mode 100644 index 000000000000..eff9cbd66cc1 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_updatecustomclass_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateCustomClass { + + public static void main(String[] args) throws Exception { + asyncUpdateCustomClass(); + } + + public static void asyncUpdateCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + UpdateCustomClassRequest request = + UpdateCustomClassRequest.newBuilder() + .setCustomClass(CustomClass.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + adaptationClient.updateCustomClassCallable().futureCall(request); + // Do something. + CustomClass response = future.get(); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_updatecustomclass_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java new file mode 100644 index 000000000000..5639710d7d67 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java @@ -0,0 +1,47 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_updatecustomclass_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCustomClass { + + public static void main(String[] args) throws Exception { + syncUpdateCustomClass(); + } + + public static void syncUpdateCustomClass() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + UpdateCustomClassRequest request = + UpdateCustomClassRequest.newBuilder() + .setCustomClass(CustomClass.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + CustomClass response = adaptationClient.updateCustomClass(request); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_updatecustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java new file mode 100644 index 000000000000..ca713b4d0f53 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_updatecustomclass_customclassfieldmask_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.CustomClass; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCustomClassCustomclassFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateCustomClassCustomclassFieldmask(); + } + + public static void syncUpdateCustomClassCustomclassFieldmask() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + CustomClass customClass = CustomClass.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + CustomClass response = adaptationClient.updateCustomClass(customClass, updateMask); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_updatecustomclass_customclassfieldmask_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java new file mode 100644 index 000000000000..0aaa9f205846 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java @@ -0,0 +1,50 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_updatephraseset_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdatePhraseSet { + + public static void main(String[] args) throws Exception { + asyncUpdatePhraseSet(); + } + + public static void asyncUpdatePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + UpdatePhraseSetRequest request = + UpdatePhraseSetRequest.newBuilder() + .setPhraseSet(PhraseSet.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = adaptationClient.updatePhraseSetCallable().futureCall(request); + // Do something. + PhraseSet response = future.get(); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_updatephraseset_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java new file mode 100644 index 000000000000..0d825ca2e2d5 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java @@ -0,0 +1,47 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_updatephraseset_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdatePhraseSet { + + public static void main(String[] args) throws Exception { + syncUpdatePhraseSet(); + } + + public static void syncUpdatePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + UpdatePhraseSetRequest request = + UpdatePhraseSetRequest.newBuilder() + .setPhraseSet(PhraseSet.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + PhraseSet response = adaptationClient.updatePhraseSet(request); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_updatephraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java new file mode 100644 index 000000000000..f28127f9920c --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java @@ -0,0 +1,43 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationclient_updatephraseset_phrasesetfieldmask_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationClient; +import com.google.cloud.speech.v1p1beta1.PhraseSet; +import com.google.protobuf.FieldMask; + +public class SyncUpdatePhraseSetPhrasesetFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdatePhraseSetPhrasesetFieldmask(); + } + + public static void syncUpdatePhraseSetPhrasesetFieldmask() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AdaptationClient adaptationClient = AdaptationClient.create()) { + PhraseSet phraseSet = PhraseSet.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + PhraseSet response = adaptationClient.updatePhraseSet(phraseSet, updateMask); + } + } +} +// [END speech_v1p1beta1_generated_adaptationclient_updatephraseset_phrasesetfieldmask_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java new file mode 100644 index 000000000000..c8667aa60ea9 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java @@ -0,0 +1,45 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_adaptationsettings_createphraseset_sync] +import com.google.cloud.speech.v1p1beta1.AdaptationSettings; +import java.time.Duration; + +public class SyncCreatePhraseSet { + + public static void main(String[] args) throws Exception { + syncCreatePhraseSet(); + } + + public static void syncCreatePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AdaptationSettings.Builder adaptationSettingsBuilder = AdaptationSettings.newBuilder(); + adaptationSettingsBuilder + .createPhraseSetSettings() + .setRetrySettings( + adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AdaptationSettings adaptationSettings = adaptationSettingsBuilder.build(); + } +} +// [END speech_v1p1beta1_generated_adaptationsettings_createphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..465bcd69e24b --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_speechclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.speech.v1p1beta1.SpeechClient; +import com.google.cloud.speech.v1p1beta1.SpeechSettings; +import com.google.cloud.speech.v1p1beta1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SpeechSettings speechSettings = + SpeechSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SpeechClient speechClient = SpeechClient.create(speechSettings); + } +} +// [END speech_v1p1beta1_generated_speechclient_create_setcredentialsprovider_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider1.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..456dd01a4ba0 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,43 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_speechclient_create_setcredentialsprovider1_sync] +import com.google.cloud.speech.v1p1beta1.SpeechClient; +import com.google.cloud.speech.v1p1beta1.SpeechSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SpeechSettings speechSettings = + SpeechSettings.newBuilder() + .setTransportChannelProvider( + SpeechSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + SpeechClient speechClient = SpeechClient.create(speechSettings); + } +} +// [END speech_v1p1beta1_generated_speechclient_create_setcredentialsprovider1_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetEndpoint.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..2108d127e850 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_speechclient_create_setendpoint_sync] +import com.google.cloud.speech.v1p1beta1.SpeechClient; +import com.google.cloud.speech.v1p1beta1.SpeechSettings; +import com.google.cloud.speech.v1p1beta1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build(); + SpeechClient speechClient = SpeechClient.create(speechSettings); + } +} +// [END speech_v1p1beta1_generated_speechclient_create_setendpoint_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java new file mode 100644 index 000000000000..6fbb74bd893a --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java @@ -0,0 +1,53 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_speechclient_longrunningrecognize_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.RecognitionAudio; +import com.google.cloud.speech.v1p1beta1.RecognitionConfig; +import com.google.cloud.speech.v1p1beta1.SpeechClient; +import com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig; +import com.google.longrunning.Operation; + +public class AsyncLongRunningRecognize { + + public static void main(String[] args) throws Exception { + asyncLongRunningRecognize(); + } + + public static void asyncLongRunningRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + LongRunningRecognizeRequest request = + LongRunningRecognizeRequest.newBuilder() + .setConfig(RecognitionConfig.newBuilder().build()) + .setAudio(RecognitionAudio.newBuilder().build()) + .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) + .build(); + ApiFuture future = speechClient.longRunningRecognizeCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END speech_v1p1beta1_generated_speechclient_longrunningrecognize_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java new file mode 100644 index 000000000000..832a218aceb8 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java @@ -0,0 +1,55 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_speechclient_longrunningrecognize_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.RecognitionAudio; +import com.google.cloud.speech.v1p1beta1.RecognitionConfig; +import com.google.cloud.speech.v1p1beta1.SpeechClient; +import com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig; + +public class AsyncLongRunningRecognizeLRO { + + public static void main(String[] args) throws Exception { + asyncLongRunningRecognizeLRO(); + } + + public static void asyncLongRunningRecognizeLRO() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + LongRunningRecognizeRequest request = + LongRunningRecognizeRequest.newBuilder() + .setConfig(RecognitionConfig.newBuilder().build()) + .setAudio(RecognitionAudio.newBuilder().build()) + .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) + .build(); + OperationFuture future = + speechClient.longRunningRecognizeOperationCallable().futureCall(request); + // Do something. + LongRunningRecognizeResponse response = future.get(); + } + } +} +// [END speech_v1p1beta1_generated_speechclient_longrunningrecognize_lro_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java new file mode 100644 index 000000000000..5884a7620500 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java @@ -0,0 +1,50 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_speechclient_longrunningrecognize_sync] +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.RecognitionAudio; +import com.google.cloud.speech.v1p1beta1.RecognitionConfig; +import com.google.cloud.speech.v1p1beta1.SpeechClient; +import com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig; + +public class SyncLongRunningRecognize { + + public static void main(String[] args) throws Exception { + syncLongRunningRecognize(); + } + + public static void syncLongRunningRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + LongRunningRecognizeRequest request = + LongRunningRecognizeRequest.newBuilder() + .setConfig(RecognitionConfig.newBuilder().build()) + .setAudio(RecognitionAudio.newBuilder().build()) + .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) + .build(); + LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get(); + } + } +} +// [END speech_v1p1beta1_generated_speechclient_longrunningrecognize_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java new file mode 100644 index 000000000000..1ddada3bfb44 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java @@ -0,0 +1,45 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_speechclient_longrunningrecognize_recognitionconfigrecognitionaudio_sync] +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.RecognitionAudio; +import com.google.cloud.speech.v1p1beta1.RecognitionConfig; +import com.google.cloud.speech.v1p1beta1.SpeechClient; + +public class SyncLongRunningRecognizeRecognitionconfigRecognitionaudio { + + public static void main(String[] args) throws Exception { + syncLongRunningRecognizeRecognitionconfigRecognitionaudio(); + } + + public static void syncLongRunningRecognizeRecognitionconfigRecognitionaudio() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + LongRunningRecognizeResponse response = + speechClient.longRunningRecognizeAsync(config, audio).get(); + } + } +} +// [END speech_v1p1beta1_generated_speechclient_longrunningrecognize_recognitionconfigrecognitionaudio_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/AsyncRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/AsyncRecognize.java new file mode 100644 index 000000000000..c99be3b3ebdd --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/AsyncRecognize.java @@ -0,0 +1,51 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_speechclient_recognize_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.speech.v1p1beta1.RecognitionAudio; +import com.google.cloud.speech.v1p1beta1.RecognitionConfig; +import com.google.cloud.speech.v1p1beta1.RecognizeRequest; +import com.google.cloud.speech.v1p1beta1.RecognizeResponse; +import com.google.cloud.speech.v1p1beta1.SpeechClient; + +public class AsyncRecognize { + + public static void main(String[] args) throws Exception { + asyncRecognize(); + } + + public static void asyncRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + RecognizeRequest request = + RecognizeRequest.newBuilder() + .setConfig(RecognitionConfig.newBuilder().build()) + .setAudio(RecognitionAudio.newBuilder().build()) + .build(); + ApiFuture future = speechClient.recognizeCallable().futureCall(request); + // Do something. + RecognizeResponse response = future.get(); + } + } +} +// [END speech_v1p1beta1_generated_speechclient_recognize_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognize.java new file mode 100644 index 000000000000..3491c66b136a --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognize.java @@ -0,0 +1,48 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_speechclient_recognize_sync] +import com.google.cloud.speech.v1p1beta1.RecognitionAudio; +import com.google.cloud.speech.v1p1beta1.RecognitionConfig; +import com.google.cloud.speech.v1p1beta1.RecognizeRequest; +import com.google.cloud.speech.v1p1beta1.RecognizeResponse; +import com.google.cloud.speech.v1p1beta1.SpeechClient; + +public class SyncRecognize { + + public static void main(String[] args) throws Exception { + syncRecognize(); + } + + public static void syncRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + RecognizeRequest request = + RecognizeRequest.newBuilder() + .setConfig(RecognitionConfig.newBuilder().build()) + .setAudio(RecognitionAudio.newBuilder().build()) + .build(); + RecognizeResponse response = speechClient.recognize(request); + } + } +} +// [END speech_v1p1beta1_generated_speechclient_recognize_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java new file mode 100644 index 000000000000..02951bb47eb3 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java @@ -0,0 +1,44 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_speechclient_recognize_recognitionconfigrecognitionaudio_sync] +import com.google.cloud.speech.v1p1beta1.RecognitionAudio; +import com.google.cloud.speech.v1p1beta1.RecognitionConfig; +import com.google.cloud.speech.v1p1beta1.RecognizeResponse; +import com.google.cloud.speech.v1p1beta1.SpeechClient; + +public class SyncRecognizeRecognitionconfigRecognitionaudio { + + public static void main(String[] args) throws Exception { + syncRecognizeRecognitionconfigRecognitionaudio(); + } + + public static void syncRecognizeRecognitionconfigRecognitionaudio() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + RecognitionConfig config = RecognitionConfig.newBuilder().build(); + RecognitionAudio audio = RecognitionAudio.newBuilder().build(); + RecognizeResponse response = speechClient.recognize(config, audio); + } + } +} +// [END speech_v1p1beta1_generated_speechclient_recognize_recognitionconfigrecognitionaudio_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/streamingrecognize/AsyncStreamingRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/streamingrecognize/AsyncStreamingRecognize.java new file mode 100644 index 000000000000..b910bb2bd363 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/streamingrecognize/AsyncStreamingRecognize.java @@ -0,0 +1,48 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_speechclient_streamingrecognize_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.speech.v1p1beta1.SpeechClient; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; + +public class AsyncStreamingRecognize { + + public static void main(String[] args) throws Exception { + asyncStreamingRecognize(); + } + + public static void asyncStreamingRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (SpeechClient speechClient = SpeechClient.create()) { + BidiStream bidiStream = + speechClient.streamingRecognizeCallable().call(); + StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); + bidiStream.send(request); + for (StreamingRecognizeResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END speech_v1p1beta1_generated_speechclient_streamingrecognize_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechsettings/recognize/SyncRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechsettings/recognize/SyncRecognize.java new file mode 100644 index 000000000000..7611b369a133 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechsettings/recognize/SyncRecognize.java @@ -0,0 +1,45 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.samples; + +// [START speech_v1p1beta1_generated_speechsettings_recognize_sync] +import com.google.cloud.speech.v1p1beta1.SpeechSettings; +import java.time.Duration; + +public class SyncRecognize { + + public static void main(String[] args) throws Exception { + syncRecognize(); + } + + public static void syncRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder(); + speechSettingsBuilder + .recognizeSettings() + .setRetrySettings( + speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SpeechSettings speechSettings = speechSettingsBuilder.build(); + } +} +// [END speech_v1p1beta1_generated_speechsettings_recognize_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java new file mode 100644 index 000000000000..baa910f35a95 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java @@ -0,0 +1,45 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub.samples; + +// [START speech_v1p1beta1_generated_adaptationstubsettings_createphraseset_sync] +import com.google.cloud.speech.v1p1beta1.stub.AdaptationStubSettings; +import java.time.Duration; + +public class SyncCreatePhraseSet { + + public static void main(String[] args) throws Exception { + syncCreatePhraseSet(); + } + + public static void syncCreatePhraseSet() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AdaptationStubSettings.Builder adaptationSettingsBuilder = AdaptationStubSettings.newBuilder(); + adaptationSettingsBuilder + .createPhraseSetSettings() + .setRetrySettings( + adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AdaptationStubSettings adaptationSettings = adaptationSettingsBuilder.build(); + } +} +// [END speech_v1p1beta1_generated_adaptationstubsettings_createphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/speechstubsettings/recognize/SyncRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/speechstubsettings/recognize/SyncRecognize.java new file mode 100644 index 000000000000..e045c1b25446 --- /dev/null +++ b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/speechstubsettings/recognize/SyncRecognize.java @@ -0,0 +1,45 @@ +/* + * 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 + * + * https://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. + */ + +package com.google.cloud.speech.v1p1beta1.stub.samples; + +// [START speech_v1p1beta1_generated_speechstubsettings_recognize_sync] +import com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings; +import java.time.Duration; + +public class SyncRecognize { + + public static void main(String[] args) throws Exception { + syncRecognize(); + } + + public static void syncRecognize() throws Exception { + // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + SpeechStubSettings.Builder speechSettingsBuilder = SpeechStubSettings.newBuilder(); + speechSettingsBuilder + .recognizeSettings() + .setRetrySettings( + speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SpeechStubSettings speechSettings = speechSettingsBuilder.build(); + } +} +// [END speech_v1p1beta1_generated_speechstubsettings_recognize_sync] From 901564b1ee11535d8e40738e1ff440fa661af17a Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 22 Sep 2022 02:07:08 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- java-speech/README.md | 65 +- .../samples/install-without-bom/pom.xml | 84 + java-speech/samples/pom.xml | 56 + java-speech/samples/snapshot/pom.xml | 83 + java-speech/samples/snippets/pom.xml | 47 + .../cloud/speech/v1/AdaptationClient.java | 1674 ------ .../cloud/speech/v1/AdaptationSettings.java | 305 - .../google/cloud/speech/v1/SpeechClient.java | 483 -- .../cloud/speech/v1/SpeechSettings.java | 241 - .../cloud/speech/v1/gapic_metadata.json | 66 - .../google/cloud/speech/v1/package-info.java | 64 - .../cloud/speech/v1/stub/AdaptationStub.java | 103 - .../v1/stub/AdaptationStubSettings.java | 669 --- .../stub/GrpcAdaptationCallableFactory.java | 113 - .../speech/v1/stub/GrpcAdaptationStub.java | 475 -- .../v1/stub/GrpcSpeechCallableFactory.java | 113 - .../cloud/speech/v1/stub/GrpcSpeechStub.java | 227 - .../HttpJsonAdaptationCallableFactory.java | 105 - .../v1/stub/HttpJsonAdaptationStub.java | 695 --- .../stub/HttpJsonSpeechCallableFactory.java | 105 - .../speech/v1/stub/HttpJsonSpeechStub.java | 281 - .../cloud/speech/v1/stub/SpeechStub.java | 73 - .../speech/v1/stub/SpeechStubSettings.java | 440 -- .../v1/AdaptationClientHttpJsonTest.java | 940 --- .../cloud/speech/v1/AdaptationClientTest.java | 826 --- .../cloud/speech/v1/MockAdaptation.java | 59 - .../cloud/speech/v1/MockAdaptationImpl.java | 272 - .../google/cloud/speech/v1/MockSpeech.java | 59 - .../cloud/speech/v1/MockSpeechImpl.java | 140 - .../speech/v1/SpeechClientHttpJsonTest.java | 186 - .../cloud/speech/v1/SpeechClientTest.java | 234 - .../cloud/speech/v1/AdaptationGrpc.java | 1085 ---- .../google/cloud/speech/v1/SpeechGrpc.java | 479 -- .../speech/v1/CreateCustomClassRequest.java | 1060 ---- .../v1/CreateCustomClassRequestOrBuilder.java | 94 - .../speech/v1/CreatePhraseSetRequest.java | 1060 ---- .../v1/CreatePhraseSetRequestOrBuilder.java | 94 - .../google/cloud/speech/v1/CustomClass.java | 1829 ------ .../cloud/speech/v1/CustomClassName.java | 227 - .../cloud/speech/v1/CustomClassOrBuilder.java | 95 - .../speech/v1/DeleteCustomClassRequest.java | 637 -- .../v1/DeleteCustomClassRequestOrBuilder.java | 41 - .../speech/v1/DeletePhraseSetRequest.java | 602 -- .../v1/DeletePhraseSetRequestOrBuilder.java | 31 - .../speech/v1/GetCustomClassRequest.java | 602 -- .../v1/GetCustomClassRequestOrBuilder.java | 31 - .../cloud/speech/v1/GetPhraseSetRequest.java | 637 -- .../v1/GetPhraseSetRequestOrBuilder.java | 41 - .../speech/v1/ListCustomClassesRequest.java | 916 --- .../v1/ListCustomClassesRequestOrBuilder.java | 80 - .../speech/v1/ListCustomClassesResponse.java | 1045 ---- .../ListCustomClassesResponseOrBuilder.java | 75 - .../cloud/speech/v1/ListPhraseSetRequest.java | 916 --- .../v1/ListPhraseSetRequestOrBuilder.java | 80 - .../speech/v1/ListPhraseSetResponse.java | 1045 ---- .../v1/ListPhraseSetResponseOrBuilder.java | 75 - .../google/cloud/speech/v1/LocationName.java | 192 - .../v1/LongRunningRecognizeMetadata.java | 1162 ---- ...LongRunningRecognizeMetadataOrBuilder.java | 96 - .../v1/LongRunningRecognizeRequest.java | 1151 ---- .../LongRunningRecognizeRequestOrBuilder.java | 93 - .../v1/LongRunningRecognizeResponse.java | 1611 ----- ...LongRunningRecognizeResponseOrBuilder.java | 139 - .../com/google/cloud/speech/v1/PhraseSet.java | 1944 ------ .../google/cloud/speech/v1/PhraseSetName.java | 223 - .../cloud/speech/v1/PhraseSetOrBuilder.java | 91 - .../cloud/speech/v1/RecognitionAudio.java | 906 --- .../speech/v1/RecognitionAudioOrBuilder.java | 81 - .../cloud/speech/v1/RecognitionConfig.java | 4838 --------------- .../speech/v1/RecognitionConfigOrBuilder.java | 660 -- .../cloud/speech/v1/RecognitionMetadata.java | 2343 -------- .../v1/RecognitionMetadataOrBuilder.java | 170 - .../cloud/speech/v1/RecognizeRequest.java | 913 --- .../speech/v1/RecognizeRequestOrBuilder.java | 66 - .../cloud/speech/v1/RecognizeResponse.java | 1135 ---- .../speech/v1/RecognizeResponseOrBuilder.java | 85 - .../speech/v1/SpeakerDiarizationConfig.java | 782 --- .../v1/SpeakerDiarizationConfigOrBuilder.java | 57 - .../cloud/speech/v1/SpeechAdaptation.java | 1671 ------ .../speech/v1/SpeechAdaptationOrBuilder.java | 163 - .../speech/v1/SpeechAdaptationProto.java | 285 - .../google/cloud/speech/v1/SpeechContext.java | 918 --- .../speech/v1/SpeechContextOrBuilder.java | 107 - .../google/cloud/speech/v1/SpeechProto.java | 406 -- .../v1/SpeechRecognitionAlternative.java | 1211 ---- ...SpeechRecognitionAlternativeOrBuilder.java | 105 - .../speech/v1/SpeechRecognitionResult.java | 1457 ----- .../v1/SpeechRecognitionResultOrBuilder.java | 134 - .../cloud/speech/v1/SpeechResourceProto.java | 121 - .../speech/v1/StreamingRecognitionConfig.java | 921 --- .../StreamingRecognitionConfigOrBuilder.java | 79 - .../speech/v1/StreamingRecognitionResult.java | 1654 ----- .../StreamingRecognitionResultOrBuilder.java | 162 - .../speech/v1/StreamingRecognizeRequest.java | 955 --- .../StreamingRecognizeRequestOrBuilder.java | 77 - .../speech/v1/StreamingRecognizeResponse.java | 1771 ------ .../StreamingRecognizeResponseOrBuilder.java | 147 - .../speech/v1/TranscriptOutputConfig.java | 732 --- .../v1/TranscriptOutputConfigOrBuilder.java | 46 - .../speech/v1/UpdateCustomClassRequest.java | 997 --- .../v1/UpdateCustomClassRequestOrBuilder.java | 87 - .../speech/v1/UpdatePhraseSetRequest.java | 997 --- .../v1/UpdatePhraseSetRequestOrBuilder.java | 87 - .../com/google/cloud/speech/v1/WordInfo.java | 1389 ----- .../cloud/speech/v1/WordInfoOrBuilder.java | 143 - .../google/cloud/speech/v1/cloud_speech.proto | 899 --- .../speech/v1/cloud_speech_adaptation.proto | 370 -- .../google/cloud/speech/v1/resource.proto | 138 - .../SyncCreateSetCredentialsProvider.java | 44 - .../SyncCreateSetCredentialsProvider1.java | 43 - .../create/SyncCreateSetEndpoint.java | 41 - .../AsyncCreateCustomClass.java | 52 - .../SyncCreateCustomClass.java | 48 - ...tomClassLocationnameCustomclassString.java | 44 - ...ateCustomClassStringCustomclassString.java | 44 - .../createphraseset/AsyncCreatePhraseSet.java | 51 - .../createphraseset/SyncCreatePhraseSet.java | 48 - ...ePhraseSetLocationnamePhrasesetString.java | 44 - ...cCreatePhraseSetStringPhrasesetString.java | 44 - .../AsyncDeleteCustomClass.java | 49 - .../SyncDeleteCustomClass.java | 46 - .../SyncDeleteCustomClassCustomclassname.java | 42 - .../SyncDeleteCustomClassString.java | 42 - .../deletephraseset/AsyncDeletePhraseSet.java | 49 - .../deletephraseset/SyncDeletePhraseSet.java | 46 - .../SyncDeletePhraseSetPhrasesetname.java | 42 - .../SyncDeletePhraseSetString.java | 42 - .../getcustomclass/AsyncGetCustomClass.java | 49 - .../getcustomclass/SyncGetCustomClass.java | 46 - .../SyncGetCustomClassCustomclassname.java | 42 - .../SyncGetCustomClassString.java | 42 - .../getphraseset/AsyncGetPhraseSet.java | 49 - .../getphraseset/SyncGetPhraseSet.java | 46 - .../SyncGetPhraseSetPhrasesetname.java | 42 - .../getphraseset/SyncGetPhraseSetString.java | 42 - .../AsyncListCustomClasses.java | 54 - .../AsyncListCustomClassesPaged.java | 62 - .../SyncListCustomClasses.java | 50 - .../SyncListCustomClassesLocationname.java | 44 - .../SyncListCustomClassesString.java | 44 - .../listphraseset/AsyncListPhraseSet.java | 54 - .../AsyncListPhraseSetPaged.java | 61 - .../listphraseset/SyncListPhraseSet.java | 50 - .../SyncListPhraseSetLocationname.java | 44 - .../SyncListPhraseSetString.java | 44 - .../AsyncUpdateCustomClass.java | 51 - .../SyncUpdateCustomClass.java | 47 - ...UpdateCustomClassCustomclassFieldmask.java | 43 - .../updatephraseset/AsyncUpdatePhraseSet.java | 50 - .../updatephraseset/SyncUpdatePhraseSet.java | 47 - ...SyncUpdatePhraseSetPhrasesetFieldmask.java | 43 - .../createphraseset/SyncCreatePhraseSet.java | 45 - .../SyncCreateSetCredentialsProvider.java | 44 - .../SyncCreateSetCredentialsProvider1.java | 43 - .../create/SyncCreateSetEndpoint.java | 40 - .../AsyncLongRunningRecognize.java | 53 - .../AsyncLongRunningRecognizeLRO.java | 55 - .../SyncLongRunningRecognize.java | 50 - ...nizeRecognitionconfigRecognitionaudio.java | 45 - .../recognize/AsyncRecognize.java | 51 - .../speechclient/recognize/SyncRecognize.java | 48 - ...nizeRecognitionconfigRecognitionaudio.java | 44 - .../AsyncStreamingRecognize.java | 48 - .../recognize/SyncRecognize.java | 45 - .../createphraseset/SyncCreatePhraseSet.java | 45 - .../recognize/SyncRecognize.java | 45 - .../speech/v1p1beta1/AdaptationClient.java | 1676 ------ .../speech/v1p1beta1/AdaptationSettings.java | 306 - .../cloud/speech/v1p1beta1/SpeechClient.java | 484 -- .../speech/v1p1beta1/SpeechSettings.java | 242 - .../speech/v1p1beta1/gapic_metadata.json | 66 - .../cloud/speech/v1p1beta1/package-info.java | 62 - .../speech/v1p1beta1/stub/AdaptationStub.java | 105 - .../stub/AdaptationStubSettings.java | 670 --- .../stub/GrpcAdaptationCallableFactory.java | 115 - .../v1p1beta1/stub/GrpcAdaptationStub.java | 477 -- .../stub/GrpcSpeechCallableFactory.java | 115 - .../speech/v1p1beta1/stub/GrpcSpeechStub.java | 229 - .../HttpJsonAdaptationCallableFactory.java | 105 - .../stub/HttpJsonAdaptationStub.java | 695 --- .../stub/HttpJsonSpeechCallableFactory.java | 105 - .../v1p1beta1/stub/HttpJsonSpeechStub.java | 281 - .../speech/v1p1beta1/stub/SpeechStub.java | 75 - .../v1p1beta1/stub/SpeechStubSettings.java | 441 -- .../AdaptationClientHttpJsonTest.java | 940 --- .../v1p1beta1/AdaptationClientTest.java | 826 --- .../speech/v1p1beta1/MockAdaptation.java | 59 - .../speech/v1p1beta1/MockAdaptationImpl.java | 272 - .../cloud/speech/v1p1beta1/MockSpeech.java | 59 - .../speech/v1p1beta1/MockSpeechImpl.java | 140 - .../v1p1beta1/SpeechClientHttpJsonTest.java | 186 - .../speech/v1p1beta1/SpeechClientTest.java | 234 - .../speech/v1p1beta1/AdaptationGrpc.java | 1085 ---- .../cloud/speech/v1p1beta1/SpeechGrpc.java | 479 -- .../v1p1beta1/CreateCustomClassRequest.java | 1060 ---- .../CreateCustomClassRequestOrBuilder.java | 94 - .../v1p1beta1/CreatePhraseSetRequest.java | 1060 ---- .../CreatePhraseSetRequestOrBuilder.java | 94 - .../cloud/speech/v1p1beta1/CustomClass.java | 1829 ------ .../speech/v1p1beta1/CustomClassName.java | 227 - .../v1p1beta1/CustomClassOrBuilder.java | 95 - .../v1p1beta1/DeleteCustomClassRequest.java | 637 -- .../DeleteCustomClassRequestOrBuilder.java | 41 - .../v1p1beta1/DeletePhraseSetRequest.java | 602 -- .../DeletePhraseSetRequestOrBuilder.java | 31 - .../v1p1beta1/GetCustomClassRequest.java | 602 -- .../GetCustomClassRequestOrBuilder.java | 31 - .../speech/v1p1beta1/GetPhraseSetRequest.java | 637 -- .../GetPhraseSetRequestOrBuilder.java | 41 - .../v1p1beta1/ListCustomClassesRequest.java | 916 --- .../ListCustomClassesRequestOrBuilder.java | 80 - .../v1p1beta1/ListCustomClassesResponse.java | 1045 ---- .../ListCustomClassesResponseOrBuilder.java | 75 - .../v1p1beta1/ListPhraseSetRequest.java | 916 --- .../ListPhraseSetRequestOrBuilder.java | 80 - .../v1p1beta1/ListPhraseSetResponse.java | 1045 ---- .../ListPhraseSetResponseOrBuilder.java | 75 - .../cloud/speech/v1p1beta1/LocationName.java | 192 - .../LongRunningRecognizeMetadata.java | 1398 ----- ...LongRunningRecognizeMetadataOrBuilder.java | 123 - .../LongRunningRecognizeRequest.java | 1151 ---- .../LongRunningRecognizeRequestOrBuilder.java | 93 - .../LongRunningRecognizeResponse.java | 1611 ----- ...LongRunningRecognizeResponseOrBuilder.java | 139 - .../cloud/speech/v1p1beta1/PhraseSet.java | 1944 ------ .../cloud/speech/v1p1beta1/PhraseSetName.java | 223 - .../speech/v1p1beta1/PhraseSetOrBuilder.java | 91 - .../speech/v1p1beta1/RecognitionAudio.java | 906 --- .../v1p1beta1/RecognitionAudioOrBuilder.java | 81 - .../speech/v1p1beta1/RecognitionConfig.java | 5330 ----------------- .../v1p1beta1/RecognitionConfigOrBuilder.java | 725 --- .../speech/v1p1beta1/RecognitionMetadata.java | 2436 -------- .../RecognitionMetadataOrBuilder.java | 183 - .../speech/v1p1beta1/RecognizeRequest.java | 913 --- .../v1p1beta1/RecognizeRequestOrBuilder.java | 66 - .../speech/v1p1beta1/RecognizeResponse.java | 1135 ---- .../v1p1beta1/RecognizeResponseOrBuilder.java | 85 - .../v1p1beta1/SpeakerDiarizationConfig.java | 782 --- .../SpeakerDiarizationConfigOrBuilder.java | 57 - .../speech/v1p1beta1/SpeechAdaptation.java | 1671 ------ .../v1p1beta1/SpeechAdaptationOrBuilder.java | 163 - .../v1p1beta1/SpeechAdaptationProto.java | 292 - .../cloud/speech/v1p1beta1/SpeechContext.java | 918 --- .../v1p1beta1/SpeechContextOrBuilder.java | 107 - .../cloud/speech/v1p1beta1/SpeechProto.java | 420 -- .../SpeechRecognitionAlternative.java | 1211 ---- ...SpeechRecognitionAlternativeOrBuilder.java | 105 - .../v1p1beta1/SpeechRecognitionResult.java | 1457 ----- .../SpeechRecognitionResultOrBuilder.java | 134 - .../speech/v1p1beta1/SpeechResourceProto.java | 148 - .../v1p1beta1/StreamingRecognitionConfig.java | 921 --- .../StreamingRecognitionConfigOrBuilder.java | 79 - .../v1p1beta1/StreamingRecognitionResult.java | 1654 ----- .../StreamingRecognitionResultOrBuilder.java | 162 - .../v1p1beta1/StreamingRecognizeRequest.java | 955 --- .../StreamingRecognizeRequestOrBuilder.java | 77 - .../v1p1beta1/StreamingRecognizeResponse.java | 1771 ------ .../StreamingRecognizeResponseOrBuilder.java | 147 - .../v1p1beta1/TranscriptNormalization.java | 1838 ------ .../TranscriptNormalizationOrBuilder.java | 68 - .../v1p1beta1/TranscriptOutputConfig.java | 732 --- .../TranscriptOutputConfigOrBuilder.java | 46 - .../v1p1beta1/UpdateCustomClassRequest.java | 997 --- .../UpdateCustomClassRequestOrBuilder.java | 87 - .../v1p1beta1/UpdatePhraseSetRequest.java | 997 --- .../UpdatePhraseSetRequestOrBuilder.java | 87 - .../cloud/speech/v1p1beta1/WordInfo.java | 1389 ----- .../speech/v1p1beta1/WordInfoOrBuilder.java | 143 - .../cloud/speech/v1p1beta1/cloud_speech.proto | 929 --- .../v1p1beta1/cloud_speech_adaptation.proto | 370 -- .../cloud/speech/v1p1beta1/resource.proto | 162 - .../SyncCreateSetCredentialsProvider.java | 44 - .../SyncCreateSetCredentialsProvider1.java | 43 - .../create/SyncCreateSetEndpoint.java | 41 - .../AsyncCreateCustomClass.java | 52 - .../SyncCreateCustomClass.java | 48 - ...tomClassLocationnameCustomclassString.java | 44 - ...ateCustomClassStringCustomclassString.java | 44 - .../createphraseset/AsyncCreatePhraseSet.java | 51 - .../createphraseset/SyncCreatePhraseSet.java | 48 - ...ePhraseSetLocationnamePhrasesetString.java | 44 - ...cCreatePhraseSetStringPhrasesetString.java | 44 - .../AsyncDeleteCustomClass.java | 49 - .../SyncDeleteCustomClass.java | 46 - .../SyncDeleteCustomClassCustomclassname.java | 42 - .../SyncDeleteCustomClassString.java | 42 - .../deletephraseset/AsyncDeletePhraseSet.java | 49 - .../deletephraseset/SyncDeletePhraseSet.java | 46 - .../SyncDeletePhraseSetPhrasesetname.java | 42 - .../SyncDeletePhraseSetString.java | 42 - .../getcustomclass/AsyncGetCustomClass.java | 49 - .../getcustomclass/SyncGetCustomClass.java | 46 - .../SyncGetCustomClassCustomclassname.java | 42 - .../SyncGetCustomClassString.java | 42 - .../getphraseset/AsyncGetPhraseSet.java | 49 - .../getphraseset/SyncGetPhraseSet.java | 46 - .../SyncGetPhraseSetPhrasesetname.java | 42 - .../getphraseset/SyncGetPhraseSetString.java | 42 - .../AsyncListCustomClasses.java | 54 - .../AsyncListCustomClassesPaged.java | 62 - .../SyncListCustomClasses.java | 50 - .../SyncListCustomClassesLocationname.java | 44 - .../SyncListCustomClassesString.java | 44 - .../listphraseset/AsyncListPhraseSet.java | 54 - .../AsyncListPhraseSetPaged.java | 61 - .../listphraseset/SyncListPhraseSet.java | 50 - .../SyncListPhraseSetLocationname.java | 44 - .../SyncListPhraseSetString.java | 44 - .../AsyncUpdateCustomClass.java | 51 - .../SyncUpdateCustomClass.java | 47 - ...UpdateCustomClassCustomclassFieldmask.java | 43 - .../updatephraseset/AsyncUpdatePhraseSet.java | 50 - .../updatephraseset/SyncUpdatePhraseSet.java | 47 - ...SyncUpdatePhraseSetPhrasesetFieldmask.java | 43 - .../createphraseset/SyncCreatePhraseSet.java | 45 - .../SyncCreateSetCredentialsProvider.java | 44 - .../SyncCreateSetCredentialsProvider1.java | 43 - .../create/SyncCreateSetEndpoint.java | 40 - .../AsyncLongRunningRecognize.java | 53 - .../AsyncLongRunningRecognizeLRO.java | 55 - .../SyncLongRunningRecognize.java | 50 - ...nizeRecognitionconfigRecognitionaudio.java | 45 - .../recognize/AsyncRecognize.java | 51 - .../speechclient/recognize/SyncRecognize.java | 48 - ...nizeRecognitionconfigRecognitionaudio.java | 44 - .../AsyncStreamingRecognize.java | 48 - .../recognize/SyncRecognize.java | 45 - .../createphraseset/SyncCreatePhraseSet.java | 45 - .../recognize/SyncRecognize.java | 45 - 329 files changed, 274 insertions(+), 126012 deletions(-) create mode 100644 java-speech/samples/install-without-bom/pom.xml create mode 100644 java-speech/samples/pom.xml create mode 100644 java-speech/samples/snapshot/pom.xml create mode 100644 java-speech/samples/snippets/pom.xml delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationClient.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationSettings.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechClient.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechSettings.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStub.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStubSettings.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationCallableFactory.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationStub.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechCallableFactory.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationCallableFactory.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationStub.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechCallableFactory.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechStub.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientHttpJsonTest.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientTest.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptation.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptationImpl.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientHttpJsonTest.java delete mode 100644 owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java delete mode 100644 owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/AdaptationGrpc.java delete mode 100644 owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassName.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponse.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponseOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponse.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponseOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LocationName.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadata.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadataOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetName.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudio.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudioOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadata.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadataOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptation.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationProto.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContext.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContextOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternative.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternativeOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResult.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResultOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechResourceProto.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfig.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfigOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResult.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResultOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponse.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfig.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfigOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequest.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech_adaptation.proto delete mode 100644 owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/resource.proto delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetEndpoint.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/AsyncGetCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassString.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/AsyncGetPhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetString.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClasses.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetString.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider1.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetEndpoint.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/AsyncRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/streamingrecognize/AsyncStreamingRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechsettings/recognize/SyncRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/speechstubsettings/recognize/SyncRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationCallableFactory.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationStub.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechCallableFactory.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechStub.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStubSettings.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientHttpJsonTest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientHttpJsonTest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetName.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudio.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudioOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternative.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternativeOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResult.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResultOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResult.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResultOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalization.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalizationOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfig.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfigOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetEndpoint.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/AsyncGetCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassString.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/AsyncGetPhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetString.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClasses.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetString.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider1.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetEndpoint.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/AsyncRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/streamingrecognize/AsyncStreamingRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechsettings/recognize/SyncRecognize.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java delete mode 100644 owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/speechstubsettings/recognize/SyncRecognize.java diff --git a/java-speech/README.md b/java-speech/README.md index dc63e641eacc..ad5727f00af9 100644 --- a/java-speech/README.md +++ b/java-speech/README.md @@ -11,64 +11,28 @@ Java idiomatic client for [Cloud Speech][product-docs]. ## Quickstart -If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: -```xml - - - - com.google.cloud - libraries-bom - 26.1.0 - pom - import - - - - - - - org.json - json - 20220320 - - - com.google.cloud - google-cloud-speech - - - -``` - -If you are using Maven without BOM, add this to your dependencies: +If you are using Maven, add this to your pom.xml file: ```xml com.google.cloud google-cloud-speech - 2.5.4 + 2.5.8 - ``` -If you are using Gradle 5.x or later, add this to your dependencies: - -```Groovy -implementation platform('com.google.cloud:libraries-bom:26.1.2') - -implementation 'com.google.cloud:google-cloud-speech' -``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-speech:2.5.7' +implementation 'com.google.cloud:google-cloud-speech:2.5.8' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-speech" % "2.5.7" +libraryDependencies += "com.google.cloud" % "google-cloud-speech" % "2.5.8" ``` ## Authentication @@ -142,27 +106,6 @@ Note, to play the file on Unix-like system you may use the following command: `p -## Samples - -Samples are in the [`samples/`](https://github.com/googleapis/java-speech/tree/main/samples) directory. - -| Sample | Source Code | Try it | -| --------------------------- | --------------------------------- | ------ | -| Export To Storage Beta | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/ExportToStorageBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/ExportToStorageBeta.java) | -| Infinite Stream Recognize | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognize.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognize.java) | -| Infinite Stream Recognize Options | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognizeOptions.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/InfiniteStreamRecognizeOptions.java) | -| Quickstart Sample | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/QuickstartSample.java) | -| Recognize | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/Recognize.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/Recognize.java) | -| Recognize Beta | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/RecognizeBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/RecognizeBeta.java) | -| Speech Adaptation | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/SpeechAdaptation.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/SpeechAdaptation.java) | -| Speech Model Adaptation Beta | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/SpeechModelAdaptationBeta.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/SpeechModelAdaptationBeta.java) | -| Speech Profanity Filter | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/SpeechProfanityFilter.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/SpeechProfanityFilter.java) | -| Speech Transcribe Multi Region | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/SpeechTranscribeMultiRegion.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/SpeechTranscribeMultiRegion.java) | -| Transcribe Context Classes | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/TranscribeContextClasses.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/TranscribeContextClasses.java) | -| Transcribe Diarization | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/TranscribeDiarization.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/TranscribeDiarization.java) | -| Transcribe Diarization Gcs | [source code](https://github.com/googleapis/java-speech/blob/main/samples/snippets/src/main/java/com/example/speech/TranscribeDiarizationGcs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-speech&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/speech/TranscribeDiarizationGcs.java) | - - ## Troubleshooting diff --git a/java-speech/samples/install-without-bom/pom.xml b/java-speech/samples/install-without-bom/pom.xml new file mode 100644 index 000000000000..8e83d6bcc7b8 --- /dev/null +++ b/java-speech/samples/install-without-bom/pom.xml @@ -0,0 +1,84 @@ + + + 4.0.0 + com.google.cloud + -install-without-bom + jar + Google Cloud Speech Install Without Bom + https://github.com/googleapis/java-speech + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + google-cloud-speech + 2.5.8 + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/java-speech/samples/pom.xml b/java-speech/samples/pom.xml new file mode 100644 index 000000000000..e09065f9a876 --- /dev/null +++ b/java-speech/samples/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.google.cloud + google-cloud--samples + 0.0.1-SNAPSHOT + pom + Google Cloud Speech Samples Parent + https://github.com/googleapis/java-speech + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + install-without-bom + snapshot + snippets + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.13 + + true + + + + + diff --git a/java-speech/samples/snapshot/pom.xml b/java-speech/samples/snapshot/pom.xml new file mode 100644 index 000000000000..b3aa2dde3aeb --- /dev/null +++ b/java-speech/samples/snapshot/pom.xml @@ -0,0 +1,83 @@ + + + 4.0.0 + com.google.cloud + -snapshot + jar + Google Cloud Speech Snapshot Samples + https://github.com/googleapis/java-speech + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-speech + 2.5.8 + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/java-speech/samples/snippets/pom.xml b/java-speech/samples/snippets/pom.xml new file mode 100644 index 000000000000..5190d76f71ed --- /dev/null +++ b/java-speech/samples/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + -snippets + jar + Google Cloud Speech Snippets + https://github.com/googleapis/java-speech + + + + com.google.cloud.samples + shared-configuration + 1.2.0 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-speech + 2.5.8 + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.1.3 + test + + + diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationClient.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationClient.java deleted file mode 100644 index 575bff7c15ac..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationClient.java +++ /dev/null @@ -1,1674 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1.stub.AdaptationStub; -import com.google.cloud.speech.v1.stub.AdaptationStubSettings; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: Service that implements Google Cloud Speech Adaptation API. - * - *

This class provides the ability to make remote calls to the backing service through method - * calls that map to API methods. Sample code to get started: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
- *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
- *   String phraseSetId = "phraseSetId959902180";
- *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
- * }
- * }
- * - *

Note: close() needs to be called on the AdaptationClient object to clean up resources such as - * threads. In the example above, try-with-resources is used, which automatically calls close(). - * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
- * - *

See the individual methods for example code. - * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. - * - *

This class can be customized by passing in a custom instance of AdaptationSettings to - * create(). For example: - * - *

To customize credentials: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * AdaptationSettings adaptationSettings =
- *     AdaptationSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * AdaptationSettings adaptationSettings =
- *     AdaptationSettings.newBuilder().setEndpoint(myEndpoint).build();
- * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
- * }
- * - *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * AdaptationSettings adaptationSettings =
- *     AdaptationSettings.newBuilder()
- *         .setTransportChannelProvider(
- *             AdaptationSettings.defaultHttpJsonTransportProviderBuilder().build())
- *         .build();
- * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@Generated("by gapic-generator-java") -public class AdaptationClient implements BackgroundResource { - private final AdaptationSettings settings; - private final AdaptationStub stub; - - /** Constructs an instance of AdaptationClient with default settings. */ - public static final AdaptationClient create() throws IOException { - return create(AdaptationSettings.newBuilder().build()); - } - - /** - * Constructs an instance of AdaptationClient, using the given settings. The channels are created - * based on the settings passed in, or defaults for any settings that are not set. - */ - public static final AdaptationClient create(AdaptationSettings settings) throws IOException { - return new AdaptationClient(settings); - } - - /** - * Constructs an instance of AdaptationClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(AdaptationSettings). - */ - public static final AdaptationClient create(AdaptationStub stub) { - return new AdaptationClient(stub); - } - - /** - * Constructs an instance of AdaptationClient, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected AdaptationClient(AdaptationSettings settings) throws IOException { - this.settings = settings; - this.stub = ((AdaptationStubSettings) settings.getStubSettings()).createStub(); - } - - protected AdaptationClient(AdaptationStub stub) { - this.settings = null; - this.stub = stub; - } - - public final AdaptationSettings getSettings() { - return settings; - } - - public AdaptationStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. - * The items in the PhraseSet are favored by the recognition model when you send a call that - * includes the PhraseSet. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
-   *   String phraseSetId = "phraseSetId959902180";
-   *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
-   * }
-   * }
- * - * @param parent Required. The parent resource where this phrase set will be created. Format: - *

`projects/{project}/locations/{location}/phraseSets` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @param phraseSet Required. The phrase set to create. - * @param phraseSetId Required. The ID to use for the phrase set, which will become the final - * component of the phrase set's resource name. - *

This value should restrict to letters, numbers, and hyphens, with the first character a - * letter, the last a letter or a number, and be 4-63 characters. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet createPhraseSet( - LocationName parent, PhraseSet phraseSet, String phraseSetId) { - CreatePhraseSetRequest request = - CreatePhraseSetRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setPhraseSet(phraseSet) - .setPhraseSetId(phraseSetId) - .build(); - return createPhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. - * The items in the PhraseSet are favored by the recognition model when you send a call that - * includes the PhraseSet. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
-   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
-   *   String phraseSetId = "phraseSetId959902180";
-   *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
-   * }
-   * }
- * - * @param parent Required. The parent resource where this phrase set will be created. Format: - *

`projects/{project}/locations/{location}/phraseSets` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @param phraseSet Required. The phrase set to create. - * @param phraseSetId Required. The ID to use for the phrase set, which will become the final - * component of the phrase set's resource name. - *

This value should restrict to letters, numbers, and hyphens, with the first character a - * letter, the last a letter or a number, and be 4-63 characters. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet createPhraseSet(String parent, PhraseSet phraseSet, String phraseSetId) { - CreatePhraseSetRequest request = - CreatePhraseSetRequest.newBuilder() - .setParent(parent) - .setPhraseSet(phraseSet) - .setPhraseSetId(phraseSetId) - .build(); - return createPhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. - * The items in the PhraseSet are favored by the recognition model when you send a call that - * includes the PhraseSet. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CreatePhraseSetRequest request =
-   *       CreatePhraseSetRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPhraseSetId("phraseSetId959902180")
-   *           .setPhraseSet(PhraseSet.newBuilder().build())
-   *           .build();
-   *   PhraseSet response = adaptationClient.createPhraseSet(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet createPhraseSet(CreatePhraseSetRequest request) { - return createPhraseSetCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. - * The items in the PhraseSet are favored by the recognition model when you send a call that - * includes the PhraseSet. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CreatePhraseSetRequest request =
-   *       CreatePhraseSetRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPhraseSetId("phraseSetId959902180")
-   *           .setPhraseSet(PhraseSet.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = adaptationClient.createPhraseSetCallable().futureCall(request);
-   *   // Do something.
-   *   PhraseSet response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createPhraseSetCallable() { - return stub.createPhraseSetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
-   *   PhraseSet response = adaptationClient.getPhraseSet(name);
-   * }
-   * }
- * - * @param name Required. The name of the phrase set to retrieve. Format: - *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet getPhraseSet(PhraseSetName name) { - GetPhraseSetRequest request = - GetPhraseSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getPhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
-   *   PhraseSet response = adaptationClient.getPhraseSet(name);
-   * }
-   * }
- * - * @param name Required. The name of the phrase set to retrieve. Format: - *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet getPhraseSet(String name) { - GetPhraseSetRequest request = GetPhraseSetRequest.newBuilder().setName(name).build(); - return getPhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   GetPhraseSetRequest request =
-   *       GetPhraseSetRequest.newBuilder()
-   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
-   *           .build();
-   *   PhraseSet response = adaptationClient.getPhraseSet(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet getPhraseSet(GetPhraseSetRequest request) { - return getPhraseSetCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   GetPhraseSetRequest request =
-   *       GetPhraseSetRequest.newBuilder()
-   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
-   *           .build();
-   *   ApiFuture future = adaptationClient.getPhraseSetCallable().futureCall(request);
-   *   // Do something.
-   *   PhraseSet response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getPhraseSetCallable() { - return stub.getPhraseSetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List phrase sets. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The parent, which owns this collection of phrase set. Format: - *

`projects/{project}/locations/{location}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPhraseSetPagedResponse listPhraseSet(LocationName parent) { - ListPhraseSetRequest request = - ListPhraseSetRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listPhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List phrase sets. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
-   *   for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The parent, which owns this collection of phrase set. Format: - *

`projects/{project}/locations/{location}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPhraseSetPagedResponse listPhraseSet(String parent) { - ListPhraseSetRequest request = ListPhraseSetRequest.newBuilder().setParent(parent).build(); - return listPhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List phrase sets. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   ListPhraseSetRequest request =
-   *       ListPhraseSetRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (PhraseSet element : adaptationClient.listPhraseSet(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPhraseSetPagedResponse listPhraseSet(ListPhraseSetRequest request) { - return listPhraseSetPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List phrase sets. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   ListPhraseSetRequest request =
-   *       ListPhraseSetRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future =
-   *       adaptationClient.listPhraseSetPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (PhraseSet element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listPhraseSetPagedCallable() { - return stub.listPhraseSetPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List phrase sets. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   ListPhraseSetRequest request =
-   *       ListPhraseSetRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListPhraseSetResponse response = adaptationClient.listPhraseSetCallable().call(request);
-   *     for (PhraseSet element : response.getPhraseSetsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listPhraseSetCallable() { - return stub.listPhraseSetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Update a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   PhraseSet response = adaptationClient.updatePhraseSet(phraseSet, updateMask);
-   * }
-   * }
- * - * @param phraseSet Required. The phrase set to update. - *

The phrase set's `name` field is used to identify the set to be updated. Format: - *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @param updateMask The list of fields to be updated. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet updatePhraseSet(PhraseSet phraseSet, FieldMask updateMask) { - UpdatePhraseSetRequest request = - UpdatePhraseSetRequest.newBuilder() - .setPhraseSet(phraseSet) - .setUpdateMask(updateMask) - .build(); - return updatePhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Update a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   UpdatePhraseSetRequest request =
-   *       UpdatePhraseSetRequest.newBuilder()
-   *           .setPhraseSet(PhraseSet.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   PhraseSet response = adaptationClient.updatePhraseSet(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet updatePhraseSet(UpdatePhraseSetRequest request) { - return updatePhraseSetCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Update a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   UpdatePhraseSetRequest request =
-   *       UpdatePhraseSetRequest.newBuilder()
-   *           .setPhraseSet(PhraseSet.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = adaptationClient.updatePhraseSetCallable().futureCall(request);
-   *   // Do something.
-   *   PhraseSet response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updatePhraseSetCallable() { - return stub.updatePhraseSetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
-   *   adaptationClient.deletePhraseSet(name);
-   * }
-   * }
- * - * @param name Required. The name of the phrase set to delete. Format: - *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deletePhraseSet(PhraseSetName name) { - DeletePhraseSetRequest request = - DeletePhraseSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deletePhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
-   *   adaptationClient.deletePhraseSet(name);
-   * }
-   * }
- * - * @param name Required. The name of the phrase set to delete. Format: - *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deletePhraseSet(String name) { - DeletePhraseSetRequest request = DeletePhraseSetRequest.newBuilder().setName(name).build(); - deletePhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   DeletePhraseSetRequest request =
-   *       DeletePhraseSetRequest.newBuilder()
-   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
-   *           .build();
-   *   adaptationClient.deletePhraseSet(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deletePhraseSet(DeletePhraseSetRequest request) { - deletePhraseSetCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   DeletePhraseSetRequest request =
-   *       DeletePhraseSetRequest.newBuilder()
-   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
-   *           .build();
-   *   ApiFuture future = adaptationClient.deletePhraseSetCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deletePhraseSetCallable() { - return stub.deletePhraseSetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   CustomClass customClass = CustomClass.newBuilder().build();
-   *   String customClassId = "customClassId1871032322";
-   *   CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId);
-   * }
-   * }
- * - * @param parent Required. The parent resource where this custom class will be created. Format: - *

`projects/{project}/locations/{location}/customClasses` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @param customClass Required. The custom class to create. - * @param customClassId Required. The ID to use for the custom class, which will become the final - * component of the custom class' resource name. - *

This value should restrict to letters, numbers, and hyphens, with the first character a - * letter, the last a letter or a number, and be 4-63 characters. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass createCustomClass( - LocationName parent, CustomClass customClass, String customClassId) { - CreateCustomClassRequest request = - CreateCustomClassRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setCustomClass(customClass) - .setCustomClassId(customClassId) - .build(); - return createCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
-   *   CustomClass customClass = CustomClass.newBuilder().build();
-   *   String customClassId = "customClassId1871032322";
-   *   CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId);
-   * }
-   * }
- * - * @param parent Required. The parent resource where this custom class will be created. Format: - *

`projects/{project}/locations/{location}/customClasses` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @param customClass Required. The custom class to create. - * @param customClassId Required. The ID to use for the custom class, which will become the final - * component of the custom class' resource name. - *

This value should restrict to letters, numbers, and hyphens, with the first character a - * letter, the last a letter or a number, and be 4-63 characters. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass createCustomClass( - String parent, CustomClass customClass, String customClassId) { - CreateCustomClassRequest request = - CreateCustomClassRequest.newBuilder() - .setParent(parent) - .setCustomClass(customClass) - .setCustomClassId(customClassId) - .build(); - return createCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CreateCustomClassRequest request =
-   *       CreateCustomClassRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setCustomClassId("customClassId1871032322")
-   *           .setCustomClass(CustomClass.newBuilder().build())
-   *           .build();
-   *   CustomClass response = adaptationClient.createCustomClass(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass createCustomClass(CreateCustomClassRequest request) { - return createCustomClassCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CreateCustomClassRequest request =
-   *       CreateCustomClassRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setCustomClassId("customClassId1871032322")
-   *           .setCustomClass(CustomClass.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       adaptationClient.createCustomClassCallable().futureCall(request);
-   *   // Do something.
-   *   CustomClass response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createCustomClassCallable() { - return stub.createCustomClassCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
-   *   CustomClass response = adaptationClient.getCustomClass(name);
-   * }
-   * }
- * - * @param name Required. The name of the custom class to retrieve. Format: - *

`projects/{project}/locations/{location}/customClasses/{custom_class}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass getCustomClass(CustomClassName name) { - GetCustomClassRequest request = - GetCustomClassRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
-   *   CustomClass response = adaptationClient.getCustomClass(name);
-   * }
-   * }
- * - * @param name Required. The name of the custom class to retrieve. Format: - *

`projects/{project}/locations/{location}/customClasses/{custom_class}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass getCustomClass(String name) { - GetCustomClassRequest request = GetCustomClassRequest.newBuilder().setName(name).build(); - return getCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   GetCustomClassRequest request =
-   *       GetCustomClassRequest.newBuilder()
-   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
-   *           .build();
-   *   CustomClass response = adaptationClient.getCustomClass(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass getCustomClass(GetCustomClassRequest request) { - return getCustomClassCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   GetCustomClassRequest request =
-   *       GetCustomClassRequest.newBuilder()
-   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
-   *           .build();
-   *   ApiFuture future = adaptationClient.getCustomClassCallable().futureCall(request);
-   *   // Do something.
-   *   CustomClass response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getCustomClassCallable() { - return stub.getCustomClassCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List custom classes. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The parent, which owns this collection of custom classes. Format: - *

`projects/{project}/locations/{location}/customClasses` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListCustomClassesPagedResponse listCustomClasses(LocationName parent) { - ListCustomClassesRequest request = - ListCustomClassesRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listCustomClasses(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List custom classes. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
-   *   for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The parent, which owns this collection of custom classes. Format: - *

`projects/{project}/locations/{location}/customClasses` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListCustomClassesPagedResponse listCustomClasses(String parent) { - ListCustomClassesRequest request = - ListCustomClassesRequest.newBuilder().setParent(parent).build(); - return listCustomClasses(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List custom classes. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   ListCustomClassesRequest request =
-   *       ListCustomClassesRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (CustomClass element : adaptationClient.listCustomClasses(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListCustomClassesPagedResponse listCustomClasses(ListCustomClassesRequest request) { - return listCustomClassesPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List custom classes. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   ListCustomClassesRequest request =
-   *       ListCustomClassesRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future =
-   *       adaptationClient.listCustomClassesPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (CustomClass element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listCustomClassesPagedCallable() { - return stub.listCustomClassesPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List custom classes. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   ListCustomClassesRequest request =
-   *       ListCustomClassesRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListCustomClassesResponse response =
-   *         adaptationClient.listCustomClassesCallable().call(request);
-   *     for (CustomClass element : response.getCustomClassesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listCustomClassesCallable() { - return stub.listCustomClassesCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Update a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CustomClass customClass = CustomClass.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   CustomClass response = adaptationClient.updateCustomClass(customClass, updateMask);
-   * }
-   * }
- * - * @param customClass Required. The custom class to update. - *

The custom class's `name` field is used to identify the custom class to be updated. - * Format: - *

`projects/{project}/locations/{location}/customClasses/{custom_class}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @param updateMask The list of fields to be updated. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass updateCustomClass(CustomClass customClass, FieldMask updateMask) { - UpdateCustomClassRequest request = - UpdateCustomClassRequest.newBuilder() - .setCustomClass(customClass) - .setUpdateMask(updateMask) - .build(); - return updateCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Update a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   UpdateCustomClassRequest request =
-   *       UpdateCustomClassRequest.newBuilder()
-   *           .setCustomClass(CustomClass.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   CustomClass response = adaptationClient.updateCustomClass(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass updateCustomClass(UpdateCustomClassRequest request) { - return updateCustomClassCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Update a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   UpdateCustomClassRequest request =
-   *       UpdateCustomClassRequest.newBuilder()
-   *           .setCustomClass(CustomClass.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       adaptationClient.updateCustomClassCallable().futureCall(request);
-   *   // Do something.
-   *   CustomClass response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updateCustomClassCallable() { - return stub.updateCustomClassCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
-   *   adaptationClient.deleteCustomClass(name);
-   * }
-   * }
- * - * @param name Required. The name of the custom class to delete. Format: - *

`projects/{project}/locations/{location}/customClasses/{custom_class}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteCustomClass(CustomClassName name) { - DeleteCustomClassRequest request = - DeleteCustomClassRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - deleteCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
-   *   adaptationClient.deleteCustomClass(name);
-   * }
-   * }
- * - * @param name Required. The name of the custom class to delete. Format: - *

`projects/{project}/locations/{location}/customClasses/{custom_class}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteCustomClass(String name) { - DeleteCustomClassRequest request = DeleteCustomClassRequest.newBuilder().setName(name).build(); - deleteCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   DeleteCustomClassRequest request =
-   *       DeleteCustomClassRequest.newBuilder()
-   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
-   *           .build();
-   *   adaptationClient.deleteCustomClass(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteCustomClass(DeleteCustomClassRequest request) { - deleteCustomClassCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   DeleteCustomClassRequest request =
-   *       DeleteCustomClassRequest.newBuilder()
-   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
-   *           .build();
-   *   ApiFuture future = adaptationClient.deleteCustomClassCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteCustomClassCallable() { - return stub.deleteCustomClassCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } - - public static class ListPhraseSetPagedResponse - extends AbstractPagedListResponse< - ListPhraseSetRequest, - ListPhraseSetResponse, - PhraseSet, - ListPhraseSetPage, - ListPhraseSetFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListPhraseSetPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListPhraseSetPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListPhraseSetPagedResponse(ListPhraseSetPage page) { - super(page, ListPhraseSetFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListPhraseSetPage - extends AbstractPage< - ListPhraseSetRequest, ListPhraseSetResponse, PhraseSet, ListPhraseSetPage> { - - private ListPhraseSetPage( - PageContext context, - ListPhraseSetResponse response) { - super(context, response); - } - - private static ListPhraseSetPage createEmptyPage() { - return new ListPhraseSetPage(null, null); - } - - @Override - protected ListPhraseSetPage createPage( - PageContext context, - ListPhraseSetResponse response) { - return new ListPhraseSetPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListPhraseSetFixedSizeCollection - extends AbstractFixedSizeCollection< - ListPhraseSetRequest, - ListPhraseSetResponse, - PhraseSet, - ListPhraseSetPage, - ListPhraseSetFixedSizeCollection> { - - private ListPhraseSetFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListPhraseSetFixedSizeCollection createEmptyCollection() { - return new ListPhraseSetFixedSizeCollection(null, 0); - } - - @Override - protected ListPhraseSetFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListPhraseSetFixedSizeCollection(pages, collectionSize); - } - } - - public static class ListCustomClassesPagedResponse - extends AbstractPagedListResponse< - ListCustomClassesRequest, - ListCustomClassesResponse, - CustomClass, - ListCustomClassesPage, - ListCustomClassesFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListCustomClassesPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListCustomClassesPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListCustomClassesPagedResponse(ListCustomClassesPage page) { - super(page, ListCustomClassesFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListCustomClassesPage - extends AbstractPage< - ListCustomClassesRequest, ListCustomClassesResponse, CustomClass, ListCustomClassesPage> { - - private ListCustomClassesPage( - PageContext context, - ListCustomClassesResponse response) { - super(context, response); - } - - private static ListCustomClassesPage createEmptyPage() { - return new ListCustomClassesPage(null, null); - } - - @Override - protected ListCustomClassesPage createPage( - PageContext context, - ListCustomClassesResponse response) { - return new ListCustomClassesPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListCustomClassesFixedSizeCollection - extends AbstractFixedSizeCollection< - ListCustomClassesRequest, - ListCustomClassesResponse, - CustomClass, - ListCustomClassesPage, - ListCustomClassesFixedSizeCollection> { - - private ListCustomClassesFixedSizeCollection( - List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListCustomClassesFixedSizeCollection createEmptyCollection() { - return new ListCustomClassesFixedSizeCollection(null, 0); - } - - @Override - protected ListCustomClassesFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListCustomClassesFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationSettings.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationSettings.java deleted file mode 100644 index 8baee25d419e..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/AdaptationSettings.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.speech.v1.stub.AdaptationStubSettings; -import com.google.protobuf.Empty; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link AdaptationClient}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (speech.googleapis.com) and default port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of createPhraseSet to 30 seconds: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * AdaptationSettings.Builder adaptationSettingsBuilder = AdaptationSettings.newBuilder();
- * adaptationSettingsBuilder
- *     .createPhraseSetSettings()
- *     .setRetrySettings(
- *         adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * AdaptationSettings adaptationSettings = adaptationSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class AdaptationSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to createPhraseSet. */ - public UnaryCallSettings createPhraseSetSettings() { - return ((AdaptationStubSettings) getStubSettings()).createPhraseSetSettings(); - } - - /** Returns the object with the settings used for calls to getPhraseSet. */ - public UnaryCallSettings getPhraseSetSettings() { - return ((AdaptationStubSettings) getStubSettings()).getPhraseSetSettings(); - } - - /** Returns the object with the settings used for calls to listPhraseSet. */ - public PagedCallSettings - listPhraseSetSettings() { - return ((AdaptationStubSettings) getStubSettings()).listPhraseSetSettings(); - } - - /** Returns the object with the settings used for calls to updatePhraseSet. */ - public UnaryCallSettings updatePhraseSetSettings() { - return ((AdaptationStubSettings) getStubSettings()).updatePhraseSetSettings(); - } - - /** Returns the object with the settings used for calls to deletePhraseSet. */ - public UnaryCallSettings deletePhraseSetSettings() { - return ((AdaptationStubSettings) getStubSettings()).deletePhraseSetSettings(); - } - - /** Returns the object with the settings used for calls to createCustomClass. */ - public UnaryCallSettings createCustomClassSettings() { - return ((AdaptationStubSettings) getStubSettings()).createCustomClassSettings(); - } - - /** Returns the object with the settings used for calls to getCustomClass. */ - public UnaryCallSettings getCustomClassSettings() { - return ((AdaptationStubSettings) getStubSettings()).getCustomClassSettings(); - } - - /** Returns the object with the settings used for calls to listCustomClasses. */ - public PagedCallSettings< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - listCustomClassesSettings() { - return ((AdaptationStubSettings) getStubSettings()).listCustomClassesSettings(); - } - - /** Returns the object with the settings used for calls to updateCustomClass. */ - public UnaryCallSettings updateCustomClassSettings() { - return ((AdaptationStubSettings) getStubSettings()).updateCustomClassSettings(); - } - - /** Returns the object with the settings used for calls to deleteCustomClass. */ - public UnaryCallSettings deleteCustomClassSettings() { - return ((AdaptationStubSettings) getStubSettings()).deleteCustomClassSettings(); - } - - public static final AdaptationSettings create(AdaptationStubSettings stub) throws IOException { - return new AdaptationSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return AdaptationStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return AdaptationStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return AdaptationStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return AdaptationStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return AdaptationStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return AdaptationStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return AdaptationStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return AdaptationStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected AdaptationSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for AdaptationSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(AdaptationStubSettings.newBuilder(clientContext)); - } - - protected Builder(AdaptationSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(AdaptationStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(AdaptationStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(AdaptationStubSettings.newHttpJsonBuilder()); - } - - public AdaptationStubSettings.Builder getStubSettingsBuilder() { - return ((AdaptationStubSettings.Builder) getStubSettings()); - } - - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to createPhraseSet. */ - public UnaryCallSettings.Builder createPhraseSetSettings() { - return getStubSettingsBuilder().createPhraseSetSettings(); - } - - /** Returns the builder for the settings used for calls to getPhraseSet. */ - public UnaryCallSettings.Builder getPhraseSetSettings() { - return getStubSettingsBuilder().getPhraseSetSettings(); - } - - /** Returns the builder for the settings used for calls to listPhraseSet. */ - public PagedCallSettings.Builder< - ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> - listPhraseSetSettings() { - return getStubSettingsBuilder().listPhraseSetSettings(); - } - - /** Returns the builder for the settings used for calls to updatePhraseSet. */ - public UnaryCallSettings.Builder updatePhraseSetSettings() { - return getStubSettingsBuilder().updatePhraseSetSettings(); - } - - /** Returns the builder for the settings used for calls to deletePhraseSet. */ - public UnaryCallSettings.Builder deletePhraseSetSettings() { - return getStubSettingsBuilder().deletePhraseSetSettings(); - } - - /** Returns the builder for the settings used for calls to createCustomClass. */ - public UnaryCallSettings.Builder - createCustomClassSettings() { - return getStubSettingsBuilder().createCustomClassSettings(); - } - - /** Returns the builder for the settings used for calls to getCustomClass. */ - public UnaryCallSettings.Builder getCustomClassSettings() { - return getStubSettingsBuilder().getCustomClassSettings(); - } - - /** Returns the builder for the settings used for calls to listCustomClasses. */ - public PagedCallSettings.Builder< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - listCustomClassesSettings() { - return getStubSettingsBuilder().listCustomClassesSettings(); - } - - /** Returns the builder for the settings used for calls to updateCustomClass. */ - public UnaryCallSettings.Builder - updateCustomClassSettings() { - return getStubSettingsBuilder().updateCustomClassSettings(); - } - - /** Returns the builder for the settings used for calls to deleteCustomClass. */ - public UnaryCallSettings.Builder deleteCustomClassSettings() { - return getStubSettingsBuilder().deleteCustomClassSettings(); - } - - @Override - public AdaptationSettings build() throws IOException { - return new AdaptationSettings(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechClient.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechClient.java deleted file mode 100644 index e3b2dd0af331..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechClient.java +++ /dev/null @@ -1,483 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.httpjson.longrunning.OperationsClient; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1.stub.SpeechStub; -import com.google.cloud.speech.v1.stub.SpeechStubSettings; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: Service that implements Google Cloud Speech API. - * - *

This class provides the ability to make remote calls to the backing service through method - * calls that map to API methods. Sample code to get started: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (SpeechClient speechClient = SpeechClient.create()) {
- *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
- *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
- *   RecognizeResponse response = speechClient.recognize(config, audio);
- * }
- * }
- * - *

Note: close() needs to be called on the SpeechClient object to clean up resources such as - * threads. In the example above, try-with-resources is used, which automatically calls close(). - * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
- * - *

See the individual methods for example code. - * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. - * - *

This class can be customized by passing in a custom instance of SpeechSettings to create(). - * For example: - * - *

To customize credentials: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SpeechSettings speechSettings =
- *     SpeechSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * SpeechClient speechClient = SpeechClient.create(speechSettings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build();
- * SpeechClient speechClient = SpeechClient.create(speechSettings);
- * }
- * - *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SpeechSettings speechSettings =
- *     SpeechSettings.newBuilder()
- *         .setTransportChannelProvider(
- *             SpeechSettings.defaultHttpJsonTransportProviderBuilder().build())
- *         .build();
- * SpeechClient speechClient = SpeechClient.create(speechSettings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@Generated("by gapic-generator-java") -public class SpeechClient implements BackgroundResource { - private final SpeechSettings settings; - private final SpeechStub stub; - private final OperationsClient httpJsonOperationsClient; - private final com.google.longrunning.OperationsClient operationsClient; - - /** Constructs an instance of SpeechClient with default settings. */ - public static final SpeechClient create() throws IOException { - return create(SpeechSettings.newBuilder().build()); - } - - /** - * Constructs an instance of SpeechClient, using the given settings. The channels are created - * based on the settings passed in, or defaults for any settings that are not set. - */ - public static final SpeechClient create(SpeechSettings settings) throws IOException { - return new SpeechClient(settings); - } - - /** - * Constructs an instance of SpeechClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(SpeechSettings). - */ - public static final SpeechClient create(SpeechStub stub) { - return new SpeechClient(stub); - } - - /** - * Constructs an instance of SpeechClient, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected SpeechClient(SpeechSettings settings) throws IOException { - this.settings = settings; - this.stub = ((SpeechStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = - com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); - this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); - } - - protected SpeechClient(SpeechStub stub) { - this.settings = null; - this.stub = stub; - this.operationsClient = - com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); - this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); - } - - public final SpeechSettings getSettings() { - return settings; - } - - public SpeechStub getStub() { - return stub; - } - - /** - * Returns the OperationsClient that can be used to query the status of a long-running operation - * returned by another API method call. - */ - public final com.google.longrunning.OperationsClient getOperationsClient() { - return operationsClient; - } - - /** - * Returns the OperationsClient that can be used to query the status of a long-running operation - * returned by another API method call. - */ - @BetaApi - public final OperationsClient getHttpJsonOperationsClient() { - return httpJsonOperationsClient; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs synchronous speech recognition: receive results after all audio has been sent and - * processed. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
-   *   RecognizeResponse response = speechClient.recognize(config, audio);
-   * }
-   * }
- * - * @param config Required. Provides information to the recognizer that specifies how to process - * the request. - * @param audio Required. The audio data to be recognized. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final RecognizeResponse recognize(RecognitionConfig config, RecognitionAudio audio) { - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - return recognize(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs synchronous speech recognition: receive results after all audio has been sent and - * processed. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognizeRequest request =
-   *       RecognizeRequest.newBuilder()
-   *           .setConfig(RecognitionConfig.newBuilder().build())
-   *           .setAudio(RecognitionAudio.newBuilder().build())
-   *           .build();
-   *   RecognizeResponse response = speechClient.recognize(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final RecognizeResponse recognize(RecognizeRequest request) { - return recognizeCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs synchronous speech recognition: receive results after all audio has been sent and - * processed. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognizeRequest request =
-   *       RecognizeRequest.newBuilder()
-   *           .setConfig(RecognitionConfig.newBuilder().build())
-   *           .setAudio(RecognitionAudio.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = speechClient.recognizeCallable().futureCall(request);
-   *   // Do something.
-   *   RecognizeResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable recognizeCallable() { - return stub.recognizeCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
-   *   LongRunningRecognizeResponse response =
-   *       speechClient.longRunningRecognizeAsync(config, audio).get();
-   * }
-   * }
- * - * @param config Required. Provides information to the recognizer that specifies how to process - * the request. - * @param audio Required. The audio data to be recognized. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture - longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio) { - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - return longRunningRecognizeAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   LongRunningRecognizeRequest request =
-   *       LongRunningRecognizeRequest.newBuilder()
-   *           .setConfig(RecognitionConfig.newBuilder().build())
-   *           .setAudio(RecognitionAudio.newBuilder().build())
-   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
-   *           .build();
-   *   LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get();
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture - longRunningRecognizeAsync(LongRunningRecognizeRequest request) { - return longRunningRecognizeOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   LongRunningRecognizeRequest request =
-   *       LongRunningRecognizeRequest.newBuilder()
-   *           .setConfig(RecognitionConfig.newBuilder().build())
-   *           .setAudio(RecognitionAudio.newBuilder().build())
-   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
-   *           .build();
-   *   OperationFuture future =
-   *       speechClient.longRunningRecognizeOperationCallable().futureCall(request);
-   *   // Do something.
-   *   LongRunningRecognizeResponse response = future.get();
-   * }
-   * }
- */ - public final OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - return stub.longRunningRecognizeOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   LongRunningRecognizeRequest request =
-   *       LongRunningRecognizeRequest.newBuilder()
-   *           .setConfig(RecognitionConfig.newBuilder().build())
-   *           .setAudio(RecognitionAudio.newBuilder().build())
-   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = speechClient.longRunningRecognizeCallable().futureCall(request);
-   *   // Do something.
-   *   Operation response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - longRunningRecognizeCallable() { - return stub.longRunningRecognizeCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs bidirectional streaming speech recognition: receive results while sending audio. This - * method is only available via the gRPC API (not REST). - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   BidiStream bidiStream =
-   *       speechClient.streamingRecognizeCallable().call();
-   *   StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build();
-   *   bidiStream.send(request);
-   *   for (StreamingRecognizeResponse response : bidiStream) {
-   *     // Do something when a response is received.
-   *   }
-   * }
-   * }
- */ - public final BidiStreamingCallable - streamingRecognizeCallable() { - return stub.streamingRecognizeCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechSettings.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechSettings.java deleted file mode 100644 index 17ab1887dc20..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/SpeechSettings.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.speech.v1.stub.SpeechStubSettings; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link SpeechClient}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (speech.googleapis.com) and default port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of recognize to 30 seconds: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder();
- * speechSettingsBuilder
- *     .recognizeSettings()
- *     .setRetrySettings(
- *         speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * SpeechSettings speechSettings = speechSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class SpeechSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to recognize. */ - public UnaryCallSettings recognizeSettings() { - return ((SpeechStubSettings) getStubSettings()).recognizeSettings(); - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings longRunningRecognizeSettings() { - return ((SpeechStubSettings) getStubSettings()).longRunningRecognizeSettings(); - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - public OperationCallSettings< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return ((SpeechStubSettings) getStubSettings()).longRunningRecognizeOperationSettings(); - } - - /** Returns the object with the settings used for calls to streamingRecognize. */ - public StreamingCallSettings - streamingRecognizeSettings() { - return ((SpeechStubSettings) getStubSettings()).streamingRecognizeSettings(); - } - - public static final SpeechSettings create(SpeechStubSettings stub) throws IOException { - return new SpeechSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return SpeechStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return SpeechStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return SpeechStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return SpeechStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return SpeechStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return SpeechStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return SpeechStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SpeechStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected SpeechSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for SpeechSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(SpeechStubSettings.newBuilder(clientContext)); - } - - protected Builder(SpeechSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(SpeechStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(SpeechStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(SpeechStubSettings.newHttpJsonBuilder()); - } - - public SpeechStubSettings.Builder getStubSettingsBuilder() { - return ((SpeechStubSettings.Builder) getStubSettings()); - } - - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to recognize. */ - public UnaryCallSettings.Builder recognizeSettings() { - return getStubSettingsBuilder().recognizeSettings(); - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings.Builder - longRunningRecognizeSettings() { - return getStubSettingsBuilder().longRunningRecognizeSettings(); - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - public OperationCallSettings.Builder< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return getStubSettingsBuilder().longRunningRecognizeOperationSettings(); - } - - /** Returns the builder for the settings used for calls to streamingRecognize. */ - public StreamingCallSettings.Builder - streamingRecognizeSettings() { - return getStubSettingsBuilder().streamingRecognizeSettings(); - } - - @Override - public SpeechSettings build() throws IOException { - return new SpeechSettings(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/gapic_metadata.json b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/gapic_metadata.json deleted file mode 100644 index 3ae90ba027aa..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/gapic_metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "java", - "protoPackage": "google.cloud.speech.v1", - "libraryPackage": "com.google.cloud.speech.v1", - "services": { - "Speech": { - "clients": { - "grpc": { - "libraryClient": "SpeechClient", - "rpcs": { - "LongRunningRecognize": { - "methods": ["longRunningRecognizeAsync", "longRunningRecognizeAsync", "longRunningRecognizeOperationCallable", "longRunningRecognizeCallable"] - }, - "Recognize": { - "methods": ["recognize", "recognize", "recognizeCallable"] - }, - "StreamingRecognize": { - "methods": ["streamingRecognizeCallable"] - } - } - } - } - }, - "Adaptation": { - "clients": { - "grpc": { - "libraryClient": "AdaptationClient", - "rpcs": { - "CreateCustomClass": { - "methods": ["createCustomClass", "createCustomClass", "createCustomClass", "createCustomClassCallable"] - }, - "CreatePhraseSet": { - "methods": ["createPhraseSet", "createPhraseSet", "createPhraseSet", "createPhraseSetCallable"] - }, - "DeleteCustomClass": { - "methods": ["deleteCustomClass", "deleteCustomClass", "deleteCustomClass", "deleteCustomClassCallable"] - }, - "DeletePhraseSet": { - "methods": ["deletePhraseSet", "deletePhraseSet", "deletePhraseSet", "deletePhraseSetCallable"] - }, - "GetCustomClass": { - "methods": ["getCustomClass", "getCustomClass", "getCustomClass", "getCustomClassCallable"] - }, - "GetPhraseSet": { - "methods": ["getPhraseSet", "getPhraseSet", "getPhraseSet", "getPhraseSetCallable"] - }, - "ListCustomClasses": { - "methods": ["listCustomClasses", "listCustomClasses", "listCustomClasses", "listCustomClassesPagedCallable", "listCustomClassesCallable"] - }, - "ListPhraseSet": { - "methods": ["listPhraseSet", "listPhraseSet", "listPhraseSet", "listPhraseSetPagedCallable", "listPhraseSetCallable"] - }, - "UpdateCustomClass": { - "methods": ["updateCustomClass", "updateCustomClass", "updateCustomClassCallable"] - }, - "UpdatePhraseSet": { - "methods": ["updatePhraseSet", "updatePhraseSet", "updatePhraseSetCallable"] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java deleted file mode 100644 index 65f64943f1e4..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/package-info.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -/** - * A client to Cloud Speech-to-Text API - * - *

The interfaces provided are listed below, along with usage samples. - * - *

======================= SpeechClient ======================= - * - *

Service Description: Service that implements Google Cloud Speech API. - * - *

Sample for SpeechClient: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (SpeechClient speechClient = SpeechClient.create()) {
- *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
- *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
- *   RecognizeResponse response = speechClient.recognize(config, audio);
- * }
- * }
- * - *

======================= AdaptationClient ======================= - * - *

Service Description: Service that implements Google Cloud Speech Adaptation API. - * - *

Sample for AdaptationClient: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
- *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
- *   String phraseSetId = "phraseSetId959902180";
- *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
- * }
- * }
- */ -@Generated("by gapic-generator-java") -package com.google.cloud.speech.v1; - -import javax.annotation.Generated; diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStub.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStub.java deleted file mode 100644 index d7f079fe4cb1..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStub.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub; - -import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1.CreateCustomClassRequest; -import com.google.cloud.speech.v1.CreatePhraseSetRequest; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.DeleteCustomClassRequest; -import com.google.cloud.speech.v1.DeletePhraseSetRequest; -import com.google.cloud.speech.v1.GetCustomClassRequest; -import com.google.cloud.speech.v1.GetPhraseSetRequest; -import com.google.cloud.speech.v1.ListCustomClassesRequest; -import com.google.cloud.speech.v1.ListCustomClassesResponse; -import com.google.cloud.speech.v1.ListPhraseSetRequest; -import com.google.cloud.speech.v1.ListPhraseSetResponse; -import com.google.cloud.speech.v1.PhraseSet; -import com.google.cloud.speech.v1.UpdateCustomClassRequest; -import com.google.cloud.speech.v1.UpdatePhraseSetRequest; -import com.google.protobuf.Empty; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Adaptation service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public abstract class AdaptationStub implements BackgroundResource { - - public UnaryCallable createPhraseSetCallable() { - throw new UnsupportedOperationException("Not implemented: createPhraseSetCallable()"); - } - - public UnaryCallable getPhraseSetCallable() { - throw new UnsupportedOperationException("Not implemented: getPhraseSetCallable()"); - } - - public UnaryCallable - listPhraseSetPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listPhraseSetPagedCallable()"); - } - - public UnaryCallable listPhraseSetCallable() { - throw new UnsupportedOperationException("Not implemented: listPhraseSetCallable()"); - } - - public UnaryCallable updatePhraseSetCallable() { - throw new UnsupportedOperationException("Not implemented: updatePhraseSetCallable()"); - } - - public UnaryCallable deletePhraseSetCallable() { - throw new UnsupportedOperationException("Not implemented: deletePhraseSetCallable()"); - } - - public UnaryCallable createCustomClassCallable() { - throw new UnsupportedOperationException("Not implemented: createCustomClassCallable()"); - } - - public UnaryCallable getCustomClassCallable() { - throw new UnsupportedOperationException("Not implemented: getCustomClassCallable()"); - } - - public UnaryCallable - listCustomClassesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listCustomClassesPagedCallable()"); - } - - public UnaryCallable - listCustomClassesCallable() { - throw new UnsupportedOperationException("Not implemented: listCustomClassesCallable()"); - } - - public UnaryCallable updateCustomClassCallable() { - throw new UnsupportedOperationException("Not implemented: updateCustomClassCallable()"); - } - - public UnaryCallable deleteCustomClassCallable() { - throw new UnsupportedOperationException("Not implemented: deleteCustomClassCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStubSettings.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStubSettings.java deleted file mode 100644 index 876ab1e3a393..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/AdaptationStubSettings.java +++ /dev/null @@ -1,669 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub; - -import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1.CreateCustomClassRequest; -import com.google.cloud.speech.v1.CreatePhraseSetRequest; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.DeleteCustomClassRequest; -import com.google.cloud.speech.v1.DeletePhraseSetRequest; -import com.google.cloud.speech.v1.GetCustomClassRequest; -import com.google.cloud.speech.v1.GetPhraseSetRequest; -import com.google.cloud.speech.v1.ListCustomClassesRequest; -import com.google.cloud.speech.v1.ListCustomClassesResponse; -import com.google.cloud.speech.v1.ListPhraseSetRequest; -import com.google.cloud.speech.v1.ListPhraseSetResponse; -import com.google.cloud.speech.v1.PhraseSet; -import com.google.cloud.speech.v1.UpdateCustomClassRequest; -import com.google.cloud.speech.v1.UpdatePhraseSetRequest; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.protobuf.Empty; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link AdaptationStub}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (speech.googleapis.com) and default port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of createPhraseSet to 30 seconds: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * AdaptationStubSettings.Builder adaptationSettingsBuilder = AdaptationStubSettings.newBuilder();
- * adaptationSettingsBuilder
- *     .createPhraseSetSettings()
- *     .setRetrySettings(
- *         adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * AdaptationStubSettings adaptationSettings = adaptationSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class AdaptationStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - - private final UnaryCallSettings createPhraseSetSettings; - private final UnaryCallSettings getPhraseSetSettings; - private final PagedCallSettings< - ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> - listPhraseSetSettings; - private final UnaryCallSettings updatePhraseSetSettings; - private final UnaryCallSettings deletePhraseSetSettings; - private final UnaryCallSettings createCustomClassSettings; - private final UnaryCallSettings getCustomClassSettings; - private final PagedCallSettings< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - listCustomClassesSettings; - private final UnaryCallSettings updateCustomClassSettings; - private final UnaryCallSettings deleteCustomClassSettings; - - private static final PagedListDescriptor - LIST_PHRASE_SET_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListPhraseSetRequest injectToken(ListPhraseSetRequest payload, String token) { - return ListPhraseSetRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListPhraseSetRequest injectPageSize(ListPhraseSetRequest payload, int pageSize) { - return ListPhraseSetRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListPhraseSetRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListPhraseSetResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListPhraseSetResponse payload) { - return payload.getPhraseSetsList() == null - ? ImmutableList.of() - : payload.getPhraseSetsList(); - } - }; - - private static final PagedListDescriptor< - ListCustomClassesRequest, ListCustomClassesResponse, CustomClass> - LIST_CUSTOM_CLASSES_PAGE_STR_DESC = - new PagedListDescriptor< - ListCustomClassesRequest, ListCustomClassesResponse, CustomClass>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListCustomClassesRequest injectToken( - ListCustomClassesRequest payload, String token) { - return ListCustomClassesRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListCustomClassesRequest injectPageSize( - ListCustomClassesRequest payload, int pageSize) { - return ListCustomClassesRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListCustomClassesRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListCustomClassesResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListCustomClassesResponse payload) { - return payload.getCustomClassesList() == null - ? ImmutableList.of() - : payload.getCustomClassesList(); - } - }; - - private static final PagedListResponseFactory< - ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> - LIST_PHRASE_SET_PAGE_STR_FACT = - new PagedListResponseFactory< - ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListPhraseSetRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_PHRASE_SET_PAGE_STR_DESC, request, context); - return ListPhraseSetPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - LIST_CUSTOM_CLASSES_PAGE_STR_FACT = - new PagedListResponseFactory< - ListCustomClassesRequest, - ListCustomClassesResponse, - ListCustomClassesPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListCustomClassesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext - pageContext = - PageContext.create( - callable, LIST_CUSTOM_CLASSES_PAGE_STR_DESC, request, context); - return ListCustomClassesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to createPhraseSet. */ - public UnaryCallSettings createPhraseSetSettings() { - return createPhraseSetSettings; - } - - /** Returns the object with the settings used for calls to getPhraseSet. */ - public UnaryCallSettings getPhraseSetSettings() { - return getPhraseSetSettings; - } - - /** Returns the object with the settings used for calls to listPhraseSet. */ - public PagedCallSettings - listPhraseSetSettings() { - return listPhraseSetSettings; - } - - /** Returns the object with the settings used for calls to updatePhraseSet. */ - public UnaryCallSettings updatePhraseSetSettings() { - return updatePhraseSetSettings; - } - - /** Returns the object with the settings used for calls to deletePhraseSet. */ - public UnaryCallSettings deletePhraseSetSettings() { - return deletePhraseSetSettings; - } - - /** Returns the object with the settings used for calls to createCustomClass. */ - public UnaryCallSettings createCustomClassSettings() { - return createCustomClassSettings; - } - - /** Returns the object with the settings used for calls to getCustomClass. */ - public UnaryCallSettings getCustomClassSettings() { - return getCustomClassSettings; - } - - /** Returns the object with the settings used for calls to listCustomClasses. */ - public PagedCallSettings< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - listCustomClassesSettings() { - return listCustomClassesSettings; - } - - /** Returns the object with the settings used for calls to updateCustomClass. */ - public UnaryCallSettings updateCustomClassSettings() { - return updateCustomClassSettings; - } - - /** Returns the object with the settings used for calls to deleteCustomClass. */ - public UnaryCallSettings deleteCustomClassSettings() { - return deleteCustomClassSettings; - } - - public AdaptationStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcAdaptationStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonAdaptationStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "speech.googleapis.com:443"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "speech.mtls.googleapis.com:443"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(AdaptationStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(AdaptationStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return AdaptationStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected AdaptationStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createPhraseSetSettings = settingsBuilder.createPhraseSetSettings().build(); - getPhraseSetSettings = settingsBuilder.getPhraseSetSettings().build(); - listPhraseSetSettings = settingsBuilder.listPhraseSetSettings().build(); - updatePhraseSetSettings = settingsBuilder.updatePhraseSetSettings().build(); - deletePhraseSetSettings = settingsBuilder.deletePhraseSetSettings().build(); - createCustomClassSettings = settingsBuilder.createCustomClassSettings().build(); - getCustomClassSettings = settingsBuilder.getCustomClassSettings().build(); - listCustomClassesSettings = settingsBuilder.listCustomClassesSettings().build(); - updateCustomClassSettings = settingsBuilder.updateCustomClassSettings().build(); - deleteCustomClassSettings = settingsBuilder.deleteCustomClassSettings().build(); - } - - /** Builder for AdaptationStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder - createPhraseSetSettings; - private final UnaryCallSettings.Builder getPhraseSetSettings; - private final PagedCallSettings.Builder< - ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> - listPhraseSetSettings; - private final UnaryCallSettings.Builder - updatePhraseSetSettings; - private final UnaryCallSettings.Builder deletePhraseSetSettings; - private final UnaryCallSettings.Builder - createCustomClassSettings; - private final UnaryCallSettings.Builder - getCustomClassSettings; - private final PagedCallSettings.Builder< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - listCustomClassesSettings; - private final UnaryCallSettings.Builder - updateCustomClassSettings; - private final UnaryCallSettings.Builder - deleteCustomClassSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - createPhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getPhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listPhraseSetSettings = PagedCallSettings.newBuilder(LIST_PHRASE_SET_PAGE_STR_FACT); - updatePhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deletePhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listCustomClassesSettings = PagedCallSettings.newBuilder(LIST_CUSTOM_CLASSES_PAGE_STR_FACT); - updateCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createPhraseSetSettings, - getPhraseSetSettings, - listPhraseSetSettings, - updatePhraseSetSettings, - deletePhraseSetSettings, - createCustomClassSettings, - getCustomClassSettings, - listCustomClassesSettings, - updateCustomClassSettings, - deleteCustomClassSettings); - initDefaults(this); - } - - protected Builder(AdaptationStubSettings settings) { - super(settings); - - createPhraseSetSettings = settings.createPhraseSetSettings.toBuilder(); - getPhraseSetSettings = settings.getPhraseSetSettings.toBuilder(); - listPhraseSetSettings = settings.listPhraseSetSettings.toBuilder(); - updatePhraseSetSettings = settings.updatePhraseSetSettings.toBuilder(); - deletePhraseSetSettings = settings.deletePhraseSetSettings.toBuilder(); - createCustomClassSettings = settings.createCustomClassSettings.toBuilder(); - getCustomClassSettings = settings.getCustomClassSettings.toBuilder(); - listCustomClassesSettings = settings.listCustomClassesSettings.toBuilder(); - updateCustomClassSettings = settings.updateCustomClassSettings.toBuilder(); - deleteCustomClassSettings = settings.deleteCustomClassSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createPhraseSetSettings, - getPhraseSetSettings, - listPhraseSetSettings, - updatePhraseSetSettings, - deletePhraseSetSettings, - createCustomClassSettings, - getCustomClassSettings, - listCustomClassesSettings, - updateCustomClassSettings, - deleteCustomClassSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createPhraseSetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getPhraseSetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .listPhraseSetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .updatePhraseSetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .deletePhraseSetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .createCustomClassSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getCustomClassSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .listCustomClassesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .updateCustomClassSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .deleteCustomClassSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - return builder; - } - - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to createPhraseSet. */ - public UnaryCallSettings.Builder createPhraseSetSettings() { - return createPhraseSetSettings; - } - - /** Returns the builder for the settings used for calls to getPhraseSet. */ - public UnaryCallSettings.Builder getPhraseSetSettings() { - return getPhraseSetSettings; - } - - /** Returns the builder for the settings used for calls to listPhraseSet. */ - public PagedCallSettings.Builder< - ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> - listPhraseSetSettings() { - return listPhraseSetSettings; - } - - /** Returns the builder for the settings used for calls to updatePhraseSet. */ - public UnaryCallSettings.Builder updatePhraseSetSettings() { - return updatePhraseSetSettings; - } - - /** Returns the builder for the settings used for calls to deletePhraseSet. */ - public UnaryCallSettings.Builder deletePhraseSetSettings() { - return deletePhraseSetSettings; - } - - /** Returns the builder for the settings used for calls to createCustomClass. */ - public UnaryCallSettings.Builder - createCustomClassSettings() { - return createCustomClassSettings; - } - - /** Returns the builder for the settings used for calls to getCustomClass. */ - public UnaryCallSettings.Builder getCustomClassSettings() { - return getCustomClassSettings; - } - - /** Returns the builder for the settings used for calls to listCustomClasses. */ - public PagedCallSettings.Builder< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - listCustomClassesSettings() { - return listCustomClassesSettings; - } - - /** Returns the builder for the settings used for calls to updateCustomClass. */ - public UnaryCallSettings.Builder - updateCustomClassSettings() { - return updateCustomClassSettings; - } - - /** Returns the builder for the settings used for calls to deleteCustomClass. */ - public UnaryCallSettings.Builder deleteCustomClassSettings() { - return deleteCustomClassSettings; - } - - @Override - public AdaptationStubSettings build() throws IOException { - return new AdaptationStubSettings(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationCallableFactory.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationCallableFactory.java deleted file mode 100644 index 63f06400b080..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationCallableFactory.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub; - -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the Adaptation service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -public class GrpcAdaptationCallableFactory implements GrpcStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - GrpcCallSettings grpcCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - GrpcCallSettings grpcCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, callSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationStub.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationStub.java deleted file mode 100644 index 45bd5bdce97f..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcAdaptationStub.java +++ /dev/null @@ -1,475 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub; - -import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1.CreateCustomClassRequest; -import com.google.cloud.speech.v1.CreatePhraseSetRequest; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.DeleteCustomClassRequest; -import com.google.cloud.speech.v1.DeletePhraseSetRequest; -import com.google.cloud.speech.v1.GetCustomClassRequest; -import com.google.cloud.speech.v1.GetPhraseSetRequest; -import com.google.cloud.speech.v1.ListCustomClassesRequest; -import com.google.cloud.speech.v1.ListCustomClassesResponse; -import com.google.cloud.speech.v1.ListPhraseSetRequest; -import com.google.cloud.speech.v1.ListPhraseSetResponse; -import com.google.cloud.speech.v1.PhraseSet; -import com.google.cloud.speech.v1.UpdateCustomClassRequest; -import com.google.cloud.speech.v1.UpdatePhraseSetRequest; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Adaptation service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public class GrpcAdaptationStub extends AdaptationStub { - private static final MethodDescriptor - createPhraseSetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Adaptation/CreatePhraseSet") - .setRequestMarshaller( - ProtoUtils.marshaller(CreatePhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - getPhraseSetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Adaptation/GetPhraseSet") - .setRequestMarshaller(ProtoUtils.marshaller(GetPhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listPhraseSetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Adaptation/ListPhraseSet") - .setRequestMarshaller( - ProtoUtils.marshaller(ListPhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListPhraseSetResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - updatePhraseSetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Adaptation/UpdatePhraseSet") - .setRequestMarshaller( - ProtoUtils.marshaller(UpdatePhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - deletePhraseSetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Adaptation/DeletePhraseSet") - .setRequestMarshaller( - ProtoUtils.marshaller(DeletePhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - createCustomClassMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Adaptation/CreateCustomClass") - .setRequestMarshaller( - ProtoUtils.marshaller(CreateCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - getCustomClassMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Adaptation/GetCustomClass") - .setRequestMarshaller( - ProtoUtils.marshaller(GetCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listCustomClassesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Adaptation/ListCustomClasses") - .setRequestMarshaller( - ProtoUtils.marshaller(ListCustomClassesRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListCustomClassesResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - updateCustomClassMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Adaptation/UpdateCustomClass") - .setRequestMarshaller( - ProtoUtils.marshaller(UpdateCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - deleteCustomClassMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Adaptation/DeleteCustomClass") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private final UnaryCallable createPhraseSetCallable; - private final UnaryCallable getPhraseSetCallable; - private final UnaryCallable listPhraseSetCallable; - private final UnaryCallable - listPhraseSetPagedCallable; - private final UnaryCallable updatePhraseSetCallable; - private final UnaryCallable deletePhraseSetCallable; - private final UnaryCallable createCustomClassCallable; - private final UnaryCallable getCustomClassCallable; - private final UnaryCallable - listCustomClassesCallable; - private final UnaryCallable - listCustomClassesPagedCallable; - private final UnaryCallable updateCustomClassCallable; - private final UnaryCallable deleteCustomClassCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcAdaptationStub create(AdaptationStubSettings settings) - throws IOException { - return new GrpcAdaptationStub(settings, ClientContext.create(settings)); - } - - public static final GrpcAdaptationStub create(ClientContext clientContext) throws IOException { - return new GrpcAdaptationStub(AdaptationStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcAdaptationStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcAdaptationStub( - AdaptationStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcAdaptationStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected GrpcAdaptationStub(AdaptationStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcAdaptationCallableFactory()); - } - - /** - * Constructs an instance of GrpcAdaptationStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected GrpcAdaptationStub( - AdaptationStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createPhraseSetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createPhraseSetMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings getPhraseSetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getPhraseSetMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listPhraseSetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listPhraseSetMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings updatePhraseSetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updatePhraseSetMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("phrase_set.name", String.valueOf(request.getPhraseSet().getName())); - return params.build(); - }) - .build(); - GrpcCallSettings deletePhraseSetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deletePhraseSetMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings createCustomClassTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createCustomClassMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings getCustomClassTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getCustomClassMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings - listCustomClassesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listCustomClassesMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings updateCustomClassTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateCustomClassMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( - "custom_class.name", String.valueOf(request.getCustomClass().getName())); - return params.build(); - }) - .build(); - GrpcCallSettings deleteCustomClassTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteCustomClassMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - - this.createPhraseSetCallable = - callableFactory.createUnaryCallable( - createPhraseSetTransportSettings, settings.createPhraseSetSettings(), clientContext); - this.getPhraseSetCallable = - callableFactory.createUnaryCallable( - getPhraseSetTransportSettings, settings.getPhraseSetSettings(), clientContext); - this.listPhraseSetCallable = - callableFactory.createUnaryCallable( - listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); - this.listPhraseSetPagedCallable = - callableFactory.createPagedCallable( - listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); - this.updatePhraseSetCallable = - callableFactory.createUnaryCallable( - updatePhraseSetTransportSettings, settings.updatePhraseSetSettings(), clientContext); - this.deletePhraseSetCallable = - callableFactory.createUnaryCallable( - deletePhraseSetTransportSettings, settings.deletePhraseSetSettings(), clientContext); - this.createCustomClassCallable = - callableFactory.createUnaryCallable( - createCustomClassTransportSettings, - settings.createCustomClassSettings(), - clientContext); - this.getCustomClassCallable = - callableFactory.createUnaryCallable( - getCustomClassTransportSettings, settings.getCustomClassSettings(), clientContext); - this.listCustomClassesCallable = - callableFactory.createUnaryCallable( - listCustomClassesTransportSettings, - settings.listCustomClassesSettings(), - clientContext); - this.listCustomClassesPagedCallable = - callableFactory.createPagedCallable( - listCustomClassesTransportSettings, - settings.listCustomClassesSettings(), - clientContext); - this.updateCustomClassCallable = - callableFactory.createUnaryCallable( - updateCustomClassTransportSettings, - settings.updateCustomClassSettings(), - clientContext); - this.deleteCustomClassCallable = - callableFactory.createUnaryCallable( - deleteCustomClassTransportSettings, - settings.deleteCustomClassSettings(), - clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createPhraseSetCallable() { - return createPhraseSetCallable; - } - - @Override - public UnaryCallable getPhraseSetCallable() { - return getPhraseSetCallable; - } - - @Override - public UnaryCallable listPhraseSetCallable() { - return listPhraseSetCallable; - } - - @Override - public UnaryCallable - listPhraseSetPagedCallable() { - return listPhraseSetPagedCallable; - } - - @Override - public UnaryCallable updatePhraseSetCallable() { - return updatePhraseSetCallable; - } - - @Override - public UnaryCallable deletePhraseSetCallable() { - return deletePhraseSetCallable; - } - - @Override - public UnaryCallable createCustomClassCallable() { - return createCustomClassCallable; - } - - @Override - public UnaryCallable getCustomClassCallable() { - return getCustomClassCallable; - } - - @Override - public UnaryCallable - listCustomClassesCallable() { - return listCustomClassesCallable; - } - - @Override - public UnaryCallable - listCustomClassesPagedCallable() { - return listCustomClassesPagedCallable; - } - - @Override - public UnaryCallable updateCustomClassCallable() { - return updateCustomClassCallable; - } - - @Override - public UnaryCallable deleteCustomClassCallable() { - return deleteCustomClassCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechCallableFactory.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechCallableFactory.java deleted file mode 100644 index 4909998632ca..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechCallableFactory.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub; - -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the Speech service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -public class GrpcSpeechCallableFactory implements GrpcStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - GrpcCallSettings grpcCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - GrpcCallSettings grpcCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, callSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java deleted file mode 100644 index 106484d9312c..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/GrpcSpeechStub.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1.StreamingRecognizeResponse; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.GrpcOperationsStub; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Speech service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public class GrpcSpeechStub extends SpeechStub { - private static final MethodDescriptor - recognizeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Speech/Recognize") - .setRequestMarshaller(ProtoUtils.marshaller(RecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RecognizeResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - longRunningRecognizeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1.Speech/LongRunningRecognize") - .setRequestMarshaller( - ProtoUtils.marshaller(LongRunningRecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - streamingRecognizeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName("google.cloud.speech.v1.Speech/StreamingRecognize") - .setRequestMarshaller( - ProtoUtils.marshaller(StreamingRecognizeRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(StreamingRecognizeResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable recognizeCallable; - private final UnaryCallable longRunningRecognizeCallable; - private final OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable; - private final BidiStreamingCallable - streamingRecognizeCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcSpeechStub create(SpeechStubSettings settings) throws IOException { - return new GrpcSpeechStub(settings, ClientContext.create(settings)); - } - - public static final GrpcSpeechStub create(ClientContext clientContext) throws IOException { - return new GrpcSpeechStub(SpeechStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcSpeechStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcSpeechStub( - SpeechStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcSpeechCallableFactory()); - } - - /** - * Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected GrpcSpeechStub( - SpeechStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings recognizeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(recognizeMethodDescriptor) - .build(); - GrpcCallSettings longRunningRecognizeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(longRunningRecognizeMethodDescriptor) - .build(); - GrpcCallSettings - streamingRecognizeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(streamingRecognizeMethodDescriptor) - .build(); - - this.recognizeCallable = - callableFactory.createUnaryCallable( - recognizeTransportSettings, settings.recognizeSettings(), clientContext); - this.longRunningRecognizeCallable = - callableFactory.createUnaryCallable( - longRunningRecognizeTransportSettings, - settings.longRunningRecognizeSettings(), - clientContext); - this.longRunningRecognizeOperationCallable = - callableFactory.createOperationCallable( - longRunningRecognizeTransportSettings, - settings.longRunningRecognizeOperationSettings(), - clientContext, - operationsStub); - this.streamingRecognizeCallable = - callableFactory.createBidiStreamingCallable( - streamingRecognizeTransportSettings, - settings.streamingRecognizeSettings(), - clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable recognizeCallable() { - return recognizeCallable; - } - - @Override - public UnaryCallable longRunningRecognizeCallable() { - return longRunningRecognizeCallable; - } - - @Override - public OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - return longRunningRecognizeOperationCallable; - } - - @Override - public BidiStreamingCallable - streamingRecognizeCallable() { - return streamingRecognizeCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationCallableFactory.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationCallableFactory.java deleted file mode 100644 index 5d727420739d..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Adaptation service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -@BetaApi -public class HttpJsonAdaptationCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationStub.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationStub.java deleted file mode 100644 index acc891cc94de..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonAdaptationStub.java +++ /dev/null @@ -1,695 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub; - -import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1.CreateCustomClassRequest; -import com.google.cloud.speech.v1.CreatePhraseSetRequest; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.DeleteCustomClassRequest; -import com.google.cloud.speech.v1.DeletePhraseSetRequest; -import com.google.cloud.speech.v1.GetCustomClassRequest; -import com.google.cloud.speech.v1.GetPhraseSetRequest; -import com.google.cloud.speech.v1.ListCustomClassesRequest; -import com.google.cloud.speech.v1.ListCustomClassesResponse; -import com.google.cloud.speech.v1.ListPhraseSetRequest; -import com.google.cloud.speech.v1.ListPhraseSetResponse; -import com.google.cloud.speech.v1.PhraseSet; -import com.google.cloud.speech.v1.UpdateCustomClassRequest; -import com.google.cloud.speech.v1.UpdatePhraseSetRequest; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Adaptation service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -@BetaApi -public class HttpJsonAdaptationStub extends AdaptationStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor - createPhraseSetMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1.Adaptation/CreatePhraseSet") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{parent=projects/*/locations/*}/phraseSets", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PhraseSet.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getPhraseSetMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1.Adaptation/GetPhraseSet") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/locations/*/phraseSets/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PhraseSet.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listPhraseSetMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1.Adaptation/ListPhraseSet") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{parent=projects/*/locations/*}/phraseSets", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListPhraseSetResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - updatePhraseSetMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1.Adaptation/UpdatePhraseSet") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{phraseSet.name=projects/*/locations/*/phraseSets/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "phraseSet.name", request.getPhraseSet().getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("phraseSet", request.getPhraseSet(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PhraseSet.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - deletePhraseSetMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1.Adaptation/DeletePhraseSet") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/locations/*/phraseSets/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - createCustomClassMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1.Adaptation/CreateCustomClass") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{parent=projects/*/locations/*}/customClasses", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(CustomClass.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getCustomClassMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1.Adaptation/GetCustomClass") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/locations/*/customClasses/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(CustomClass.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listCustomClassesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1.Adaptation/ListCustomClasses") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{parent=projects/*/locations/*}/customClasses", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListCustomClassesResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - updateCustomClassMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1.Adaptation/UpdateCustomClass") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{customClass.name=projects/*/locations/*/customClasses/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "customClass.name", request.getCustomClass().getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("customClass", request.getCustomClass(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(CustomClass.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - deleteCustomClassMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1.Adaptation/DeleteCustomClass") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/{name=projects/*/locations/*/customClasses/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createPhraseSetCallable; - private final UnaryCallable getPhraseSetCallable; - private final UnaryCallable listPhraseSetCallable; - private final UnaryCallable - listPhraseSetPagedCallable; - private final UnaryCallable updatePhraseSetCallable; - private final UnaryCallable deletePhraseSetCallable; - private final UnaryCallable createCustomClassCallable; - private final UnaryCallable getCustomClassCallable; - private final UnaryCallable - listCustomClassesCallable; - private final UnaryCallable - listCustomClassesPagedCallable; - private final UnaryCallable updateCustomClassCallable; - private final UnaryCallable deleteCustomClassCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonAdaptationStub create(AdaptationStubSettings settings) - throws IOException { - return new HttpJsonAdaptationStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonAdaptationStub create(ClientContext clientContext) - throws IOException { - return new HttpJsonAdaptationStub( - AdaptationStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonAdaptationStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonAdaptationStub( - AdaptationStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonAdaptationStub, using the given settings. This is protected - * so that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected HttpJsonAdaptationStub(AdaptationStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonAdaptationCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonAdaptationStub, using the given settings. This is protected - * so that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected HttpJsonAdaptationStub( - AdaptationStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings createPhraseSetTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createPhraseSetMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getPhraseSetTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getPhraseSetMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - listPhraseSetTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listPhraseSetMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings updatePhraseSetTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updatePhraseSetMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deletePhraseSetTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deletePhraseSetMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings createCustomClassTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createCustomClassMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getCustomClassTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getCustomClassMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - listCustomClassesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listCustomClassesMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings updateCustomClassTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateCustomClassMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deleteCustomClassTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteCustomClassMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.createPhraseSetCallable = - callableFactory.createUnaryCallable( - createPhraseSetTransportSettings, settings.createPhraseSetSettings(), clientContext); - this.getPhraseSetCallable = - callableFactory.createUnaryCallable( - getPhraseSetTransportSettings, settings.getPhraseSetSettings(), clientContext); - this.listPhraseSetCallable = - callableFactory.createUnaryCallable( - listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); - this.listPhraseSetPagedCallable = - callableFactory.createPagedCallable( - listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); - this.updatePhraseSetCallable = - callableFactory.createUnaryCallable( - updatePhraseSetTransportSettings, settings.updatePhraseSetSettings(), clientContext); - this.deletePhraseSetCallable = - callableFactory.createUnaryCallable( - deletePhraseSetTransportSettings, settings.deletePhraseSetSettings(), clientContext); - this.createCustomClassCallable = - callableFactory.createUnaryCallable( - createCustomClassTransportSettings, - settings.createCustomClassSettings(), - clientContext); - this.getCustomClassCallable = - callableFactory.createUnaryCallable( - getCustomClassTransportSettings, settings.getCustomClassSettings(), clientContext); - this.listCustomClassesCallable = - callableFactory.createUnaryCallable( - listCustomClassesTransportSettings, - settings.listCustomClassesSettings(), - clientContext); - this.listCustomClassesPagedCallable = - callableFactory.createPagedCallable( - listCustomClassesTransportSettings, - settings.listCustomClassesSettings(), - clientContext); - this.updateCustomClassCallable = - callableFactory.createUnaryCallable( - updateCustomClassTransportSettings, - settings.updateCustomClassSettings(), - clientContext); - this.deleteCustomClassCallable = - callableFactory.createUnaryCallable( - deleteCustomClassTransportSettings, - settings.deleteCustomClassSettings(), - clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createPhraseSetMethodDescriptor); - methodDescriptors.add(getPhraseSetMethodDescriptor); - methodDescriptors.add(listPhraseSetMethodDescriptor); - methodDescriptors.add(updatePhraseSetMethodDescriptor); - methodDescriptors.add(deletePhraseSetMethodDescriptor); - methodDescriptors.add(createCustomClassMethodDescriptor); - methodDescriptors.add(getCustomClassMethodDescriptor); - methodDescriptors.add(listCustomClassesMethodDescriptor); - methodDescriptors.add(updateCustomClassMethodDescriptor); - methodDescriptors.add(deleteCustomClassMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable createPhraseSetCallable() { - return createPhraseSetCallable; - } - - @Override - public UnaryCallable getPhraseSetCallable() { - return getPhraseSetCallable; - } - - @Override - public UnaryCallable listPhraseSetCallable() { - return listPhraseSetCallable; - } - - @Override - public UnaryCallable - listPhraseSetPagedCallable() { - return listPhraseSetPagedCallable; - } - - @Override - public UnaryCallable updatePhraseSetCallable() { - return updatePhraseSetCallable; - } - - @Override - public UnaryCallable deletePhraseSetCallable() { - return deletePhraseSetCallable; - } - - @Override - public UnaryCallable createCustomClassCallable() { - return createCustomClassCallable; - } - - @Override - public UnaryCallable getCustomClassCallable() { - return getCustomClassCallable; - } - - @Override - public UnaryCallable - listCustomClassesCallable() { - return listCustomClassesCallable; - } - - @Override - public UnaryCallable - listCustomClassesPagedCallable() { - return listCustomClassesPagedCallable; - } - - @Override - public UnaryCallable updateCustomClassCallable() { - return updateCustomClassCallable; - } - - @Override - public UnaryCallable deleteCustomClassCallable() { - return deleteCustomClassCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechCallableFactory.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechCallableFactory.java deleted file mode 100644 index 04d590f69284..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Speech service API. - * - *

This class is for advanced usage. - */ -@Generated("by gapic-generator-java") -@BetaApi -public class HttpJsonSpeechCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechStub.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechStub.java deleted file mode 100644 index 447b8bdb8b5c..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/HttpJsonSpeechStub.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.longrunning.Operation; -import com.google.protobuf.TypeRegistry; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Speech service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -@BetaApi -public class HttpJsonSpeechStub extends SpeechStub { - private static final TypeRegistry typeRegistry = - TypeRegistry.newBuilder() - .add(LongRunningRecognizeResponse.getDescriptor()) - .add(LongRunningRecognizeMetadata.getDescriptor()) - .build(); - - private static final ApiMethodDescriptor - recognizeMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1.Speech/Recognize") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/speech:recognize", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RecognizeResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - longRunningRecognizeMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1.Speech/LongRunningRecognize") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1/speech:longrunningrecognize", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Operation.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .setOperationSnapshotFactory( - (LongRunningRecognizeRequest request, Operation response) -> - HttpJsonOperationSnapshot.create(response)) - .build(); - - private final UnaryCallable recognizeCallable; - private final UnaryCallable longRunningRecognizeCallable; - private final OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonOperationsStub httpJsonOperationsStub; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonSpeechStub create(SpeechStubSettings settings) throws IOException { - return new HttpJsonSpeechStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonSpeechStub create(ClientContext clientContext) throws IOException { - return new HttpJsonSpeechStub(SpeechStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonSpeechStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonSpeechStub( - SpeechStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonSpeechStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonSpeechCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonSpeechStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected HttpJsonSpeechStub( - SpeechStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.httpJsonOperationsStub = - HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); - - HttpJsonCallSettings recognizeTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(recognizeMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - longRunningRecognizeTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(longRunningRecognizeMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.recognizeCallable = - callableFactory.createUnaryCallable( - recognizeTransportSettings, settings.recognizeSettings(), clientContext); - this.longRunningRecognizeCallable = - callableFactory.createUnaryCallable( - longRunningRecognizeTransportSettings, - settings.longRunningRecognizeSettings(), - clientContext); - this.longRunningRecognizeOperationCallable = - callableFactory.createOperationCallable( - longRunningRecognizeTransportSettings, - settings.longRunningRecognizeOperationSettings(), - clientContext, - httpJsonOperationsStub); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(recognizeMethodDescriptor); - methodDescriptors.add(longRunningRecognizeMethodDescriptor); - return methodDescriptors; - } - - public HttpJsonOperationsStub getHttpJsonOperationsStub() { - return httpJsonOperationsStub; - } - - @Override - public UnaryCallable recognizeCallable() { - return recognizeCallable; - } - - @Override - public UnaryCallable longRunningRecognizeCallable() { - return longRunningRecognizeCallable; - } - - @Override - public OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - return longRunningRecognizeOperationCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java deleted file mode 100644 index 5e70c9d9265d..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStub.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub; - -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1.StreamingRecognizeResponse; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Speech service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@Generated("by gapic-generator-java") -public abstract class SpeechStub implements BackgroundResource { - - public OperationsStub getOperationsStub() { - return null; - } - - public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { - return null; - } - - public UnaryCallable recognizeCallable() { - throw new UnsupportedOperationException("Not implemented: recognizeCallable()"); - } - - public OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - throw new UnsupportedOperationException( - "Not implemented: longRunningRecognizeOperationCallable()"); - } - - public UnaryCallable longRunningRecognizeCallable() { - throw new UnsupportedOperationException("Not implemented: longRunningRecognizeCallable()"); - } - - public BidiStreamingCallable - streamingRecognizeCallable() { - throw new UnsupportedOperationException("Not implemented: streamingRecognizeCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java deleted file mode 100644 index dff8b9126236..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1/stub/SpeechStubSettings.java +++ /dev/null @@ -1,440 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.grpc.ProtoOperationTransformers; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1.StreamingRecognizeResponse; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link SpeechStub}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (speech.googleapis.com) and default port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of recognize to 30 seconds: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SpeechStubSettings.Builder speechSettingsBuilder = SpeechStubSettings.newBuilder();
- * speechSettingsBuilder
- *     .recognizeSettings()
- *     .setRetrySettings(
- *         speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * SpeechStubSettings speechSettings = speechSettingsBuilder.build();
- * }
- */ -@Generated("by gapic-generator-java") -public class SpeechStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - - private final UnaryCallSettings recognizeSettings; - private final UnaryCallSettings - longRunningRecognizeSettings; - private final OperationCallSettings< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings; - private final StreamingCallSettings - streamingRecognizeSettings; - - /** Returns the object with the settings used for calls to recognize. */ - public UnaryCallSettings recognizeSettings() { - return recognizeSettings; - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings longRunningRecognizeSettings() { - return longRunningRecognizeSettings; - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - public OperationCallSettings< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return longRunningRecognizeOperationSettings; - } - - /** Returns the object with the settings used for calls to streamingRecognize. */ - public StreamingCallSettings - streamingRecognizeSettings() { - return streamingRecognizeSettings; - } - - public SpeechStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcSpeechStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonSpeechStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "speech.googleapis.com:443"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "speech.mtls.googleapis.com:443"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SpeechStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SpeechStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected SpeechStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - recognizeSettings = settingsBuilder.recognizeSettings().build(); - longRunningRecognizeSettings = settingsBuilder.longRunningRecognizeSettings().build(); - longRunningRecognizeOperationSettings = - settingsBuilder.longRunningRecognizeOperationSettings().build(); - streamingRecognizeSettings = settingsBuilder.streamingRecognizeSettings().build(); - } - - /** Builder for SpeechStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder recognizeSettings; - private final UnaryCallSettings.Builder - longRunningRecognizeSettings; - private final OperationCallSettings.Builder< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings; - private final StreamingCallSettings.Builder< - StreamingRecognizeRequest, StreamingRecognizeResponse> - streamingRecognizeSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_0_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(5000000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000000L)) - .setTotalTimeout(Duration.ofMillis(5000000L)) - .build(); - definitions.put("retry_policy_0_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(5000000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000000L)) - .setTotalTimeout(Duration.ofMillis(5000000L)) - .build(); - definitions.put("no_retry_1_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - recognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - longRunningRecognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - longRunningRecognizeOperationSettings = OperationCallSettings.newBuilder(); - streamingRecognizeSettings = StreamingCallSettings.newBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - recognizeSettings, longRunningRecognizeSettings); - initDefaults(this); - } - - protected Builder(SpeechStubSettings settings) { - super(settings); - - recognizeSettings = settings.recognizeSettings.toBuilder(); - longRunningRecognizeSettings = settings.longRunningRecognizeSettings.toBuilder(); - longRunningRecognizeOperationSettings = - settings.longRunningRecognizeOperationSettings.toBuilder(); - streamingRecognizeSettings = settings.streamingRecognizeSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - recognizeSettings, longRunningRecognizeSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .recognizeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .longRunningRecognizeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); - - builder - .longRunningRecognizeOperationSettings() - .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) - .build()) - .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create( - LongRunningRecognizeResponse.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create( - LongRunningRecognizeMetadata.class)) - .setPollingAlgorithm( - OperationTimedPollAlgorithm.create( - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5000L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(45000L)) - .setInitialRpcTimeout(Duration.ZERO) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(300000L)) - .build())); - - return builder; - } - - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to recognize. */ - public UnaryCallSettings.Builder recognizeSettings() { - return recognizeSettings; - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings.Builder - longRunningRecognizeSettings() { - return longRunningRecognizeSettings; - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return longRunningRecognizeOperationSettings; - } - - /** Returns the builder for the settings used for calls to streamingRecognize. */ - public StreamingCallSettings.Builder - streamingRecognizeSettings() { - return streamingRecognizeSettings; - } - - @Override - public SpeechStubSettings build() throws IOException { - return new SpeechStubSettings(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientHttpJsonTest.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientHttpJsonTest.java deleted file mode 100644 index c69082500249..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientHttpJsonTest.java +++ /dev/null @@ -1,940 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.cloud.speech.v1.stub.HttpJsonAdaptationStub; -import com.google.common.collect.Lists; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class AdaptationClientHttpJsonTest { - private static MockHttpService mockService; - private static AdaptationClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonAdaptationStub.getMethodDescriptors(), AdaptationSettings.getDefaultEndpoint()); - AdaptationSettings settings = - AdaptationSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - AdaptationSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = AdaptationClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createPhraseSetTest() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - - PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createPhraseSetExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createPhraseSetTest2() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-5833/locations/location-5833"; - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - - PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createPhraseSetExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "projects/project-5833/locations/location-5833"; - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getPhraseSetTest() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockService.addResponse(expectedResponse); - - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - - PhraseSet actualResponse = client.getPhraseSet(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getPhraseSetExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - client.getPhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getPhraseSetTest2() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; - - PhraseSet actualResponse = client.getPhraseSet(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getPhraseSetExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; - client.getPhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listPhraseSetTest() throws Exception { - PhraseSet responsesElement = PhraseSet.newBuilder().build(); - ListPhraseSetResponse expectedResponse = - ListPhraseSetResponse.newBuilder() - .setNextPageToken("") - .addAllPhraseSets(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listPhraseSetExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listPhraseSet(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listPhraseSetTest2() throws Exception { - PhraseSet responsesElement = PhraseSet.newBuilder().build(); - ListPhraseSetResponse expectedResponse = - ListPhraseSetResponse.newBuilder() - .setNextPageToken("") - .addAllPhraseSets(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-5833/locations/location-5833"; - - ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listPhraseSetExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "projects/project-5833/locations/location-5833"; - client.listPhraseSet(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updatePhraseSetTest() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockService.addResponse(expectedResponse); - - PhraseSet phraseSet = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - PhraseSet actualResponse = client.updatePhraseSet(phraseSet, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updatePhraseSetExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - PhraseSet phraseSet = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updatePhraseSet(phraseSet, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deletePhraseSetTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - - client.deletePhraseSet(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deletePhraseSetExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - client.deletePhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deletePhraseSetTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; - - client.deletePhraseSet(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deletePhraseSetExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; - client.deletePhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createCustomClassTest() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - - CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createCustomClassExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - client.createCustomClass(parent, customClass, customClassId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createCustomClassTest2() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-5833/locations/location-5833"; - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - - CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createCustomClassExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "projects/project-5833/locations/location-5833"; - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - client.createCustomClass(parent, customClass, customClassId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getCustomClassTest() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - - CustomClass actualResponse = client.getCustomClass(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getCustomClassExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - client.getCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getCustomClassTest2() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; - - CustomClass actualResponse = client.getCustomClass(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getCustomClassExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; - client.getCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listCustomClassesTest() throws Exception { - CustomClass responsesElement = CustomClass.newBuilder().build(); - ListCustomClassesResponse expectedResponse = - ListCustomClassesResponse.newBuilder() - .setNextPageToken("") - .addAllCustomClasses(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listCustomClassesExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listCustomClasses(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listCustomClassesTest2() throws Exception { - CustomClass responsesElement = CustomClass.newBuilder().build(); - ListCustomClassesResponse expectedResponse = - ListCustomClassesResponse.newBuilder() - .setNextPageToken("") - .addAllCustomClasses(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-5833/locations/location-5833"; - - ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listCustomClassesExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "projects/project-5833/locations/location-5833"; - client.listCustomClasses(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateCustomClassTest() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - CustomClass customClass = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - CustomClass actualResponse = client.updateCustomClass(customClass, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updateCustomClassExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - CustomClass customClass = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateCustomClass(customClass, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteCustomClassTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - - client.deleteCustomClass(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteCustomClassExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - client.deleteCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteCustomClassTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; - - client.deleteCustomClass(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteCustomClassExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; - client.deleteCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientTest.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientTest.java deleted file mode 100644 index 2a1c56b7740c..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/AdaptationClientTest.java +++ /dev/null @@ -1,826 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import static com.google.cloud.speech.v1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.common.collect.Lists; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class AdaptationClientTest { - private static MockAdaptation mockAdaptation; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private AdaptationClient client; - - @BeforeClass - public static void startStaticServer() { - mockAdaptation = new MockAdaptation(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockAdaptation)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - AdaptationSettings settings = - AdaptationSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = AdaptationClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createPhraseSetTest() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockAdaptation.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - - PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreatePhraseSetRequest actualRequest = ((CreatePhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); - Assert.assertEquals(phraseSetId, actualRequest.getPhraseSetId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createPhraseSetExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createPhraseSetTest2() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockAdaptation.addResponse(expectedResponse); - - String parent = "parent-995424086"; - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - - PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreatePhraseSetRequest actualRequest = ((CreatePhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); - Assert.assertEquals(phraseSetId, actualRequest.getPhraseSetId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createPhraseSetExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String parent = "parent-995424086"; - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getPhraseSetTest() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockAdaptation.addResponse(expectedResponse); - - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - - PhraseSet actualResponse = client.getPhraseSet(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetPhraseSetRequest actualRequest = ((GetPhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getPhraseSetExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - client.getPhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getPhraseSetTest2() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockAdaptation.addResponse(expectedResponse); - - String name = "name3373707"; - - PhraseSet actualResponse = client.getPhraseSet(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetPhraseSetRequest actualRequest = ((GetPhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getPhraseSetExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String name = "name3373707"; - client.getPhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listPhraseSetTest() throws Exception { - PhraseSet responsesElement = PhraseSet.newBuilder().build(); - ListPhraseSetResponse expectedResponse = - ListPhraseSetResponse.newBuilder() - .setNextPageToken("") - .addAllPhraseSets(Arrays.asList(responsesElement)) - .build(); - mockAdaptation.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListPhraseSetRequest actualRequest = ((ListPhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listPhraseSetExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listPhraseSet(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listPhraseSetTest2() throws Exception { - PhraseSet responsesElement = PhraseSet.newBuilder().build(); - ListPhraseSetResponse expectedResponse = - ListPhraseSetResponse.newBuilder() - .setNextPageToken("") - .addAllPhraseSets(Arrays.asList(responsesElement)) - .build(); - mockAdaptation.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListPhraseSetRequest actualRequest = ((ListPhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listPhraseSetExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String parent = "parent-995424086"; - client.listPhraseSet(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updatePhraseSetTest() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockAdaptation.addResponse(expectedResponse); - - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - PhraseSet actualResponse = client.updatePhraseSet(phraseSet, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdatePhraseSetRequest actualRequest = ((UpdatePhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updatePhraseSetExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updatePhraseSet(phraseSet, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deletePhraseSetTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockAdaptation.addResponse(expectedResponse); - - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - - client.deletePhraseSet(name); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeletePhraseSetRequest actualRequest = ((DeletePhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deletePhraseSetExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - client.deletePhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deletePhraseSetTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockAdaptation.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deletePhraseSet(name); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeletePhraseSetRequest actualRequest = ((DeletePhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deletePhraseSetExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String name = "name3373707"; - client.deletePhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createCustomClassTest() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockAdaptation.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - - CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateCustomClassRequest actualRequest = ((CreateCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(customClass, actualRequest.getCustomClass()); - Assert.assertEquals(customClassId, actualRequest.getCustomClassId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createCustomClassExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - client.createCustomClass(parent, customClass, customClassId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createCustomClassTest2() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockAdaptation.addResponse(expectedResponse); - - String parent = "parent-995424086"; - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - - CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateCustomClassRequest actualRequest = ((CreateCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(customClass, actualRequest.getCustomClass()); - Assert.assertEquals(customClassId, actualRequest.getCustomClassId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createCustomClassExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String parent = "parent-995424086"; - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - client.createCustomClass(parent, customClass, customClassId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getCustomClassTest() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockAdaptation.addResponse(expectedResponse); - - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - - CustomClass actualResponse = client.getCustomClass(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetCustomClassRequest actualRequest = ((GetCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getCustomClassExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - client.getCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getCustomClassTest2() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockAdaptation.addResponse(expectedResponse); - - String name = "name3373707"; - - CustomClass actualResponse = client.getCustomClass(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetCustomClassRequest actualRequest = ((GetCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getCustomClassExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String name = "name3373707"; - client.getCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listCustomClassesTest() throws Exception { - CustomClass responsesElement = CustomClass.newBuilder().build(); - ListCustomClassesResponse expectedResponse = - ListCustomClassesResponse.newBuilder() - .setNextPageToken("") - .addAllCustomClasses(Arrays.asList(responsesElement)) - .build(); - mockAdaptation.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListCustomClassesRequest actualRequest = ((ListCustomClassesRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listCustomClassesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listCustomClasses(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listCustomClassesTest2() throws Exception { - CustomClass responsesElement = CustomClass.newBuilder().build(); - ListCustomClassesResponse expectedResponse = - ListCustomClassesResponse.newBuilder() - .setNextPageToken("") - .addAllCustomClasses(Arrays.asList(responsesElement)) - .build(); - mockAdaptation.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListCustomClassesRequest actualRequest = ((ListCustomClassesRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listCustomClassesExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String parent = "parent-995424086"; - client.listCustomClasses(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateCustomClassTest() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockAdaptation.addResponse(expectedResponse); - - CustomClass customClass = CustomClass.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - CustomClass actualResponse = client.updateCustomClass(customClass, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateCustomClassRequest actualRequest = ((UpdateCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(customClass, actualRequest.getCustomClass()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateCustomClassExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - CustomClass customClass = CustomClass.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateCustomClass(customClass, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteCustomClassTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockAdaptation.addResponse(expectedResponse); - - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - - client.deleteCustomClass(name); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteCustomClassRequest actualRequest = ((DeleteCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteCustomClassExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - client.deleteCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteCustomClassTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockAdaptation.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deleteCustomClass(name); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteCustomClassRequest actualRequest = ((DeleteCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteCustomClassExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String name = "name3373707"; - client.deleteCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptation.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptation.java deleted file mode 100644 index 3ae546d6d4af..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptation.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockAdaptation implements MockGrpcService { - private final MockAdaptationImpl serviceImpl; - - public MockAdaptation() { - serviceImpl = new MockAdaptationImpl(); - } - - @Override - public List getRequests() { - return serviceImpl.getRequests(); - } - - @Override - public void addResponse(AbstractMessage response) { - serviceImpl.addResponse(response); - } - - @Override - public void addException(Exception exception) { - serviceImpl.addException(exception); - } - - @Override - public ServerServiceDefinition getServiceDefinition() { - return serviceImpl.bindService(); - } - - @Override - public void reset() { - serviceImpl.reset(); - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptationImpl.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptationImpl.java deleted file mode 100644 index 964710edc0bd..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockAdaptationImpl.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import com.google.api.core.BetaApi; -import com.google.cloud.speech.v1.AdaptationGrpc.AdaptationImplBase; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockAdaptationImpl extends AdaptationImplBase { - private List requests; - private Queue responses; - - public MockAdaptationImpl() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - public List getRequests() { - return requests; - } - - public void addResponse(AbstractMessage response) { - responses.add(response); - } - - public void setResponses(List responses) { - this.responses = new LinkedList(responses); - } - - public void addException(Exception exception) { - responses.add(exception); - } - - public void reset() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - @Override - public void createPhraseSet( - CreatePhraseSetRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PhraseSet) { - requests.add(request); - responseObserver.onNext(((PhraseSet) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method CreatePhraseSet, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PhraseSet.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getPhraseSet( - GetPhraseSetRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PhraseSet) { - requests.add(request); - responseObserver.onNext(((PhraseSet) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetPhraseSet, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PhraseSet.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listPhraseSet( - ListPhraseSetRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListPhraseSetResponse) { - requests.add(request); - responseObserver.onNext(((ListPhraseSetResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListPhraseSet, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListPhraseSetResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updatePhraseSet( - UpdatePhraseSetRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PhraseSet) { - requests.add(request); - responseObserver.onNext(((PhraseSet) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method UpdatePhraseSet, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PhraseSet.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deletePhraseSet( - DeletePhraseSetRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method DeletePhraseSet, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void createCustomClass( - CreateCustomClassRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof CustomClass) { - requests.add(request); - responseObserver.onNext(((CustomClass) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method CreateCustomClass, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - CustomClass.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getCustomClass( - GetCustomClassRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof CustomClass) { - requests.add(request); - responseObserver.onNext(((CustomClass) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetCustomClass, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - CustomClass.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listCustomClasses( - ListCustomClassesRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListCustomClassesResponse) { - requests.add(request); - responseObserver.onNext(((ListCustomClassesResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListCustomClasses, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListCustomClassesResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateCustomClass( - UpdateCustomClassRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof CustomClass) { - requests.add(request); - responseObserver.onNext(((CustomClass) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method UpdateCustomClass, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - CustomClass.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteCustomClass( - DeleteCustomClassRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method DeleteCustomClass, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java deleted file mode 100644 index 19414820b8d3..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeech.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockSpeech implements MockGrpcService { - private final MockSpeechImpl serviceImpl; - - public MockSpeech() { - serviceImpl = new MockSpeechImpl(); - } - - @Override - public List getRequests() { - return serviceImpl.getRequests(); - } - - @Override - public void addResponse(AbstractMessage response) { - serviceImpl.addResponse(response); - } - - @Override - public void addException(Exception exception) { - serviceImpl.addException(exception); - } - - @Override - public ServerServiceDefinition getServiceDefinition() { - return serviceImpl.bindService(); - } - - @Override - public void reset() { - serviceImpl.reset(); - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java deleted file mode 100644 index e53b4bdf237e..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/MockSpeechImpl.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import com.google.api.core.BetaApi; -import com.google.cloud.speech.v1.SpeechGrpc.SpeechImplBase; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockSpeechImpl extends SpeechImplBase { - private List requests; - private Queue responses; - - public MockSpeechImpl() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - public List getRequests() { - return requests; - } - - public void addResponse(AbstractMessage response) { - responses.add(response); - } - - public void setResponses(List responses) { - this.responses = new LinkedList(responses); - } - - public void addException(Exception exception) { - responses.add(exception); - } - - public void reset() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - @Override - public void recognize( - RecognizeRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RecognizeResponse) { - requests.add(request); - responseObserver.onNext(((RecognizeResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method Recognize, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RecognizeResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void longRunningRecognize( - LongRunningRecognizeRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Operation) { - requests.add(request); - responseObserver.onNext(((Operation) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method LongRunningRecognize, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Operation.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public StreamObserver streamingRecognize( - final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(StreamingRecognizeRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof StreamingRecognizeResponse) { - responseObserver.onNext(((StreamingRecognizeResponse) response)); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method StreamingRecognize, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - StreamingRecognizeResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientHttpJsonTest.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientHttpJsonTest.java deleted file mode 100644 index f924cc6c4f59..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientHttpJsonTest.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.cloud.speech.v1.stub.HttpJsonSpeechStub; -import com.google.longrunning.Operation; -import com.google.protobuf.Any; -import com.google.protobuf.Duration; -import com.google.rpc.Status; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ExecutionException; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class SpeechClientHttpJsonTest { - private static MockHttpService mockService; - private static SpeechClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonSpeechStub.getMethodDescriptors(), SpeechSettings.getDefaultEndpoint()); - SpeechSettings settings = - SpeechSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - SpeechSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SpeechClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void recognizeTest() throws Exception { - RecognizeResponse expectedResponse = - RecognizeResponse.newBuilder() - .addAllResults(new ArrayList()) - .setTotalBilledTime(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - - RecognizeResponse actualResponse = client.recognize(config, audio); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void recognizeExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - client.recognize(config, audio); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void longRunningRecognizeTest() throws Exception { - LongRunningRecognizeResponse expectedResponse = - LongRunningRecognizeResponse.newBuilder() - .addAllResults(new ArrayList()) - .setTotalBilledTime(Duration.newBuilder().build()) - .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) - .setOutputError(Status.newBuilder().build()) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("longRunningRecognizeTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockService.addResponse(resultOperation); - - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - - LongRunningRecognizeResponse actualResponse = - client.longRunningRecognizeAsync(config, audio).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void longRunningRecognizeExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - client.longRunningRecognizeAsync(config, audio).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - } - } - - @Test - public void streamingRecognizeUnsupportedMethodTest() throws Exception { - // The streamingRecognize() method is not supported in REST transport. - // This empty test is generated for technical reasons. - } -} diff --git a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java b/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java deleted file mode 100644 index 29ddc3801755..000000000000 --- a/owl-bot-staging/java-speech/v1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1/SpeechClientTest.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.grpc.testing.MockStreamObserver; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Any; -import com.google.protobuf.Duration; -import com.google.rpc.Status; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class SpeechClientTest { - private static MockServiceHelper mockServiceHelper; - private static MockSpeech mockSpeech; - private LocalChannelProvider channelProvider; - private SpeechClient client; - - @BeforeClass - public static void startStaticServer() { - mockSpeech = new MockSpeech(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockSpeech)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - SpeechSettings settings = - SpeechSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SpeechClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void recognizeTest() throws Exception { - RecognizeResponse expectedResponse = - RecognizeResponse.newBuilder() - .addAllResults(new ArrayList()) - .setTotalBilledTime(Duration.newBuilder().build()) - .build(); - mockSpeech.addResponse(expectedResponse); - - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - - RecognizeResponse actualResponse = client.recognize(config, audio); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSpeech.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RecognizeRequest actualRequest = ((RecognizeRequest) actualRequests.get(0)); - - Assert.assertEquals(config, actualRequest.getConfig()); - Assert.assertEquals(audio, actualRequest.getAudio()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void recognizeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSpeech.addException(exception); - - try { - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - client.recognize(config, audio); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void longRunningRecognizeTest() throws Exception { - LongRunningRecognizeResponse expectedResponse = - LongRunningRecognizeResponse.newBuilder() - .addAllResults(new ArrayList()) - .setTotalBilledTime(Duration.newBuilder().build()) - .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) - .setOutputError(Status.newBuilder().build()) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("longRunningRecognizeTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockSpeech.addResponse(resultOperation); - - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - - LongRunningRecognizeResponse actualResponse = - client.longRunningRecognizeAsync(config, audio).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSpeech.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - LongRunningRecognizeRequest actualRequest = - ((LongRunningRecognizeRequest) actualRequests.get(0)); - - Assert.assertEquals(config, actualRequest.getConfig()); - Assert.assertEquals(audio, actualRequest.getAudio()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void longRunningRecognizeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSpeech.addException(exception); - - try { - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - client.longRunningRecognizeAsync(config, audio).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void streamingRecognizeTest() throws Exception { - StreamingRecognizeResponse expectedResponse = - StreamingRecognizeResponse.newBuilder() - .setError(Status.newBuilder().build()) - .addAllResults(new ArrayList()) - .setTotalBilledTime(Duration.newBuilder().build()) - .build(); - mockSpeech.addResponse(expectedResponse); - StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.streamingRecognizeCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - requestObserver.onCompleted(); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void streamingRecognizeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSpeech.addException(exception); - StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.streamingRecognizeCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } -} diff --git a/owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/AdaptationGrpc.java b/owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/AdaptationGrpc.java deleted file mode 100644 index b536dba14db7..000000000000 --- a/owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/AdaptationGrpc.java +++ /dev/null @@ -1,1085 +0,0 @@ -package com.google.cloud.speech.v1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - *
- * Service that implements Google Cloud Speech Adaptation API.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/speech/v1/cloud_speech_adaptation.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class AdaptationGrpc { - - private AdaptationGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.speech.v1.Adaptation"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getCreatePhraseSetMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreatePhraseSet", - requestType = com.google.cloud.speech.v1.CreatePhraseSetRequest.class, - responseType = com.google.cloud.speech.v1.PhraseSet.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreatePhraseSetMethod() { - io.grpc.MethodDescriptor getCreatePhraseSetMethod; - if ((getCreatePhraseSetMethod = AdaptationGrpc.getCreatePhraseSetMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getCreatePhraseSetMethod = AdaptationGrpc.getCreatePhraseSetMethod) == null) { - AdaptationGrpc.getCreatePhraseSetMethod = getCreatePhraseSetMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreatePhraseSet")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.CreatePhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.PhraseSet.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("CreatePhraseSet")) - .build(); - } - } - } - return getCreatePhraseSetMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetPhraseSetMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetPhraseSet", - requestType = com.google.cloud.speech.v1.GetPhraseSetRequest.class, - responseType = com.google.cloud.speech.v1.PhraseSet.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetPhraseSetMethod() { - io.grpc.MethodDescriptor getGetPhraseSetMethod; - if ((getGetPhraseSetMethod = AdaptationGrpc.getGetPhraseSetMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getGetPhraseSetMethod = AdaptationGrpc.getGetPhraseSetMethod) == null) { - AdaptationGrpc.getGetPhraseSetMethod = getGetPhraseSetMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPhraseSet")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.GetPhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.PhraseSet.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("GetPhraseSet")) - .build(); - } - } - } - return getGetPhraseSetMethod; - } - - private static volatile io.grpc.MethodDescriptor getListPhraseSetMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListPhraseSet", - requestType = com.google.cloud.speech.v1.ListPhraseSetRequest.class, - responseType = com.google.cloud.speech.v1.ListPhraseSetResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListPhraseSetMethod() { - io.grpc.MethodDescriptor getListPhraseSetMethod; - if ((getListPhraseSetMethod = AdaptationGrpc.getListPhraseSetMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getListPhraseSetMethod = AdaptationGrpc.getListPhraseSetMethod) == null) { - AdaptationGrpc.getListPhraseSetMethod = getListPhraseSetMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPhraseSet")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.ListPhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.ListPhraseSetResponse.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("ListPhraseSet")) - .build(); - } - } - } - return getListPhraseSetMethod; - } - - private static volatile io.grpc.MethodDescriptor getUpdatePhraseSetMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdatePhraseSet", - requestType = com.google.cloud.speech.v1.UpdatePhraseSetRequest.class, - responseType = com.google.cloud.speech.v1.PhraseSet.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getUpdatePhraseSetMethod() { - io.grpc.MethodDescriptor getUpdatePhraseSetMethod; - if ((getUpdatePhraseSetMethod = AdaptationGrpc.getUpdatePhraseSetMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getUpdatePhraseSetMethod = AdaptationGrpc.getUpdatePhraseSetMethod) == null) { - AdaptationGrpc.getUpdatePhraseSetMethod = getUpdatePhraseSetMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdatePhraseSet")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.UpdatePhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.PhraseSet.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("UpdatePhraseSet")) - .build(); - } - } - } - return getUpdatePhraseSetMethod; - } - - private static volatile io.grpc.MethodDescriptor getDeletePhraseSetMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeletePhraseSet", - requestType = com.google.cloud.speech.v1.DeletePhraseSetRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDeletePhraseSetMethod() { - io.grpc.MethodDescriptor getDeletePhraseSetMethod; - if ((getDeletePhraseSetMethod = AdaptationGrpc.getDeletePhraseSetMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getDeletePhraseSetMethod = AdaptationGrpc.getDeletePhraseSetMethod) == null) { - AdaptationGrpc.getDeletePhraseSetMethod = getDeletePhraseSetMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeletePhraseSet")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.DeletePhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("DeletePhraseSet")) - .build(); - } - } - } - return getDeletePhraseSetMethod; - } - - private static volatile io.grpc.MethodDescriptor getCreateCustomClassMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateCustomClass", - requestType = com.google.cloud.speech.v1.CreateCustomClassRequest.class, - responseType = com.google.cloud.speech.v1.CustomClass.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreateCustomClassMethod() { - io.grpc.MethodDescriptor getCreateCustomClassMethod; - if ((getCreateCustomClassMethod = AdaptationGrpc.getCreateCustomClassMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getCreateCustomClassMethod = AdaptationGrpc.getCreateCustomClassMethod) == null) { - AdaptationGrpc.getCreateCustomClassMethod = getCreateCustomClassMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCustomClass")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.CreateCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.CustomClass.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("CreateCustomClass")) - .build(); - } - } - } - return getCreateCustomClassMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetCustomClassMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetCustomClass", - requestType = com.google.cloud.speech.v1.GetCustomClassRequest.class, - responseType = com.google.cloud.speech.v1.CustomClass.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetCustomClassMethod() { - io.grpc.MethodDescriptor getGetCustomClassMethod; - if ((getGetCustomClassMethod = AdaptationGrpc.getGetCustomClassMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getGetCustomClassMethod = AdaptationGrpc.getGetCustomClassMethod) == null) { - AdaptationGrpc.getGetCustomClassMethod = getGetCustomClassMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCustomClass")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.GetCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.CustomClass.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("GetCustomClass")) - .build(); - } - } - } - return getGetCustomClassMethod; - } - - private static volatile io.grpc.MethodDescriptor getListCustomClassesMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListCustomClasses", - requestType = com.google.cloud.speech.v1.ListCustomClassesRequest.class, - responseType = com.google.cloud.speech.v1.ListCustomClassesResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListCustomClassesMethod() { - io.grpc.MethodDescriptor getListCustomClassesMethod; - if ((getListCustomClassesMethod = AdaptationGrpc.getListCustomClassesMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getListCustomClassesMethod = AdaptationGrpc.getListCustomClassesMethod) == null) { - AdaptationGrpc.getListCustomClassesMethod = getListCustomClassesMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCustomClasses")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.ListCustomClassesRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.ListCustomClassesResponse.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("ListCustomClasses")) - .build(); - } - } - } - return getListCustomClassesMethod; - } - - private static volatile io.grpc.MethodDescriptor getUpdateCustomClassMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateCustomClass", - requestType = com.google.cloud.speech.v1.UpdateCustomClassRequest.class, - responseType = com.google.cloud.speech.v1.CustomClass.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getUpdateCustomClassMethod() { - io.grpc.MethodDescriptor getUpdateCustomClassMethod; - if ((getUpdateCustomClassMethod = AdaptationGrpc.getUpdateCustomClassMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getUpdateCustomClassMethod = AdaptationGrpc.getUpdateCustomClassMethod) == null) { - AdaptationGrpc.getUpdateCustomClassMethod = getUpdateCustomClassMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCustomClass")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.UpdateCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.CustomClass.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("UpdateCustomClass")) - .build(); - } - } - } - return getUpdateCustomClassMethod; - } - - private static volatile io.grpc.MethodDescriptor getDeleteCustomClassMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteCustomClass", - requestType = com.google.cloud.speech.v1.DeleteCustomClassRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDeleteCustomClassMethod() { - io.grpc.MethodDescriptor getDeleteCustomClassMethod; - if ((getDeleteCustomClassMethod = AdaptationGrpc.getDeleteCustomClassMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getDeleteCustomClassMethod = AdaptationGrpc.getDeleteCustomClassMethod) == null) { - AdaptationGrpc.getDeleteCustomClassMethod = getDeleteCustomClassMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCustomClass")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.DeleteCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("DeleteCustomClass")) - .build(); - } - } - } - return getDeleteCustomClassMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static AdaptationStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public AdaptationStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AdaptationStub(channel, callOptions); - } - }; - return AdaptationStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static AdaptationBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public AdaptationBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AdaptationBlockingStub(channel, callOptions); - } - }; - return AdaptationBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static AdaptationFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public AdaptationFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AdaptationFutureStub(channel, callOptions); - } - }; - return AdaptationFutureStub.newStub(factory, channel); - } - - /** - *
-   * Service that implements Google Cloud Speech Adaptation API.
-   * 
- */ - public static abstract class AdaptationImplBase implements io.grpc.BindableService { - - /** - *
-     * Create a set of phrase hints. Each item in the set can be a single word or
-     * a multi-word phrase. The items in the PhraseSet are favored by the
-     * recognition model when you send a call that includes the PhraseSet.
-     * 
- */ - public void createPhraseSet(com.google.cloud.speech.v1.CreatePhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreatePhraseSetMethod(), responseObserver); - } - - /** - *
-     * Get a phrase set.
-     * 
- */ - public void getPhraseSet(com.google.cloud.speech.v1.GetPhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPhraseSetMethod(), responseObserver); - } - - /** - *
-     * List phrase sets.
-     * 
- */ - public void listPhraseSet(com.google.cloud.speech.v1.ListPhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListPhraseSetMethod(), responseObserver); - } - - /** - *
-     * Update a phrase set.
-     * 
- */ - public void updatePhraseSet(com.google.cloud.speech.v1.UpdatePhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdatePhraseSetMethod(), responseObserver); - } - - /** - *
-     * Delete a phrase set.
-     * 
- */ - public void deletePhraseSet(com.google.cloud.speech.v1.DeletePhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeletePhraseSetMethod(), responseObserver); - } - - /** - *
-     * Create a custom class.
-     * 
- */ - public void createCustomClass(com.google.cloud.speech.v1.CreateCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateCustomClassMethod(), responseObserver); - } - - /** - *
-     * Get a custom class.
-     * 
- */ - public void getCustomClass(com.google.cloud.speech.v1.GetCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetCustomClassMethod(), responseObserver); - } - - /** - *
-     * List custom classes.
-     * 
- */ - public void listCustomClasses(com.google.cloud.speech.v1.ListCustomClassesRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListCustomClassesMethod(), responseObserver); - } - - /** - *
-     * Update a custom class.
-     * 
- */ - public void updateCustomClass(com.google.cloud.speech.v1.UpdateCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateCustomClassMethod(), responseObserver); - } - - /** - *
-     * Delete a custom class.
-     * 
- */ - public void deleteCustomClass(com.google.cloud.speech.v1.DeleteCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteCustomClassMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreatePhraseSetMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.CreatePhraseSetRequest, - com.google.cloud.speech.v1.PhraseSet>( - this, METHODID_CREATE_PHRASE_SET))) - .addMethod( - getGetPhraseSetMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.GetPhraseSetRequest, - com.google.cloud.speech.v1.PhraseSet>( - this, METHODID_GET_PHRASE_SET))) - .addMethod( - getListPhraseSetMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.ListPhraseSetRequest, - com.google.cloud.speech.v1.ListPhraseSetResponse>( - this, METHODID_LIST_PHRASE_SET))) - .addMethod( - getUpdatePhraseSetMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.UpdatePhraseSetRequest, - com.google.cloud.speech.v1.PhraseSet>( - this, METHODID_UPDATE_PHRASE_SET))) - .addMethod( - getDeletePhraseSetMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.DeletePhraseSetRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_PHRASE_SET))) - .addMethod( - getCreateCustomClassMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.CreateCustomClassRequest, - com.google.cloud.speech.v1.CustomClass>( - this, METHODID_CREATE_CUSTOM_CLASS))) - .addMethod( - getGetCustomClassMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.GetCustomClassRequest, - com.google.cloud.speech.v1.CustomClass>( - this, METHODID_GET_CUSTOM_CLASS))) - .addMethod( - getListCustomClassesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.ListCustomClassesRequest, - com.google.cloud.speech.v1.ListCustomClassesResponse>( - this, METHODID_LIST_CUSTOM_CLASSES))) - .addMethod( - getUpdateCustomClassMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.UpdateCustomClassRequest, - com.google.cloud.speech.v1.CustomClass>( - this, METHODID_UPDATE_CUSTOM_CLASS))) - .addMethod( - getDeleteCustomClassMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.DeleteCustomClassRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_CUSTOM_CLASS))) - .build(); - } - } - - /** - *
-   * Service that implements Google Cloud Speech Adaptation API.
-   * 
- */ - public static final class AdaptationStub extends io.grpc.stub.AbstractAsyncStub { - private AdaptationStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected AdaptationStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AdaptationStub(channel, callOptions); - } - - /** - *
-     * Create a set of phrase hints. Each item in the set can be a single word or
-     * a multi-word phrase. The items in the PhraseSet are favored by the
-     * recognition model when you send a call that includes the PhraseSet.
-     * 
- */ - public void createPhraseSet(com.google.cloud.speech.v1.CreatePhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreatePhraseSetMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Get a phrase set.
-     * 
- */ - public void getPhraseSet(com.google.cloud.speech.v1.GetPhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetPhraseSetMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * List phrase sets.
-     * 
- */ - public void listPhraseSet(com.google.cloud.speech.v1.ListPhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListPhraseSetMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Update a phrase set.
-     * 
- */ - public void updatePhraseSet(com.google.cloud.speech.v1.UpdatePhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdatePhraseSetMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Delete a phrase set.
-     * 
- */ - public void deletePhraseSet(com.google.cloud.speech.v1.DeletePhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeletePhraseSetMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Create a custom class.
-     * 
- */ - public void createCustomClass(com.google.cloud.speech.v1.CreateCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateCustomClassMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Get a custom class.
-     * 
- */ - public void getCustomClass(com.google.cloud.speech.v1.GetCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetCustomClassMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * List custom classes.
-     * 
- */ - public void listCustomClasses(com.google.cloud.speech.v1.ListCustomClassesRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListCustomClassesMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Update a custom class.
-     * 
- */ - public void updateCustomClass(com.google.cloud.speech.v1.UpdateCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateCustomClassMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Delete a custom class.
-     * 
- */ - public void deleteCustomClass(com.google.cloud.speech.v1.DeleteCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteCustomClassMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - *
-   * Service that implements Google Cloud Speech Adaptation API.
-   * 
- */ - public static final class AdaptationBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private AdaptationBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected AdaptationBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AdaptationBlockingStub(channel, callOptions); - } - - /** - *
-     * Create a set of phrase hints. Each item in the set can be a single word or
-     * a multi-word phrase. The items in the PhraseSet are favored by the
-     * recognition model when you send a call that includes the PhraseSet.
-     * 
- */ - public com.google.cloud.speech.v1.PhraseSet createPhraseSet(com.google.cloud.speech.v1.CreatePhraseSetRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreatePhraseSetMethod(), getCallOptions(), request); - } - - /** - *
-     * Get a phrase set.
-     * 
- */ - public com.google.cloud.speech.v1.PhraseSet getPhraseSet(com.google.cloud.speech.v1.GetPhraseSetRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetPhraseSetMethod(), getCallOptions(), request); - } - - /** - *
-     * List phrase sets.
-     * 
- */ - public com.google.cloud.speech.v1.ListPhraseSetResponse listPhraseSet(com.google.cloud.speech.v1.ListPhraseSetRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListPhraseSetMethod(), getCallOptions(), request); - } - - /** - *
-     * Update a phrase set.
-     * 
- */ - public com.google.cloud.speech.v1.PhraseSet updatePhraseSet(com.google.cloud.speech.v1.UpdatePhraseSetRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdatePhraseSetMethod(), getCallOptions(), request); - } - - /** - *
-     * Delete a phrase set.
-     * 
- */ - public com.google.protobuf.Empty deletePhraseSet(com.google.cloud.speech.v1.DeletePhraseSetRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeletePhraseSetMethod(), getCallOptions(), request); - } - - /** - *
-     * Create a custom class.
-     * 
- */ - public com.google.cloud.speech.v1.CustomClass createCustomClass(com.google.cloud.speech.v1.CreateCustomClassRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateCustomClassMethod(), getCallOptions(), request); - } - - /** - *
-     * Get a custom class.
-     * 
- */ - public com.google.cloud.speech.v1.CustomClass getCustomClass(com.google.cloud.speech.v1.GetCustomClassRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetCustomClassMethod(), getCallOptions(), request); - } - - /** - *
-     * List custom classes.
-     * 
- */ - public com.google.cloud.speech.v1.ListCustomClassesResponse listCustomClasses(com.google.cloud.speech.v1.ListCustomClassesRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListCustomClassesMethod(), getCallOptions(), request); - } - - /** - *
-     * Update a custom class.
-     * 
- */ - public com.google.cloud.speech.v1.CustomClass updateCustomClass(com.google.cloud.speech.v1.UpdateCustomClassRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateCustomClassMethod(), getCallOptions(), request); - } - - /** - *
-     * Delete a custom class.
-     * 
- */ - public com.google.protobuf.Empty deleteCustomClass(com.google.cloud.speech.v1.DeleteCustomClassRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteCustomClassMethod(), getCallOptions(), request); - } - } - - /** - *
-   * Service that implements Google Cloud Speech Adaptation API.
-   * 
- */ - public static final class AdaptationFutureStub extends io.grpc.stub.AbstractFutureStub { - private AdaptationFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected AdaptationFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AdaptationFutureStub(channel, callOptions); - } - - /** - *
-     * Create a set of phrase hints. Each item in the set can be a single word or
-     * a multi-word phrase. The items in the PhraseSet are favored by the
-     * recognition model when you send a call that includes the PhraseSet.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture createPhraseSet( - com.google.cloud.speech.v1.CreatePhraseSetRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreatePhraseSetMethod(), getCallOptions()), request); - } - - /** - *
-     * Get a phrase set.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture getPhraseSet( - com.google.cloud.speech.v1.GetPhraseSetRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetPhraseSetMethod(), getCallOptions()), request); - } - - /** - *
-     * List phrase sets.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture listPhraseSet( - com.google.cloud.speech.v1.ListPhraseSetRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListPhraseSetMethod(), getCallOptions()), request); - } - - /** - *
-     * Update a phrase set.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture updatePhraseSet( - com.google.cloud.speech.v1.UpdatePhraseSetRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdatePhraseSetMethod(), getCallOptions()), request); - } - - /** - *
-     * Delete a phrase set.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture deletePhraseSet( - com.google.cloud.speech.v1.DeletePhraseSetRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeletePhraseSetMethod(), getCallOptions()), request); - } - - /** - *
-     * Create a custom class.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture createCustomClass( - com.google.cloud.speech.v1.CreateCustomClassRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateCustomClassMethod(), getCallOptions()), request); - } - - /** - *
-     * Get a custom class.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture getCustomClass( - com.google.cloud.speech.v1.GetCustomClassRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetCustomClassMethod(), getCallOptions()), request); - } - - /** - *
-     * List custom classes.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture listCustomClasses( - com.google.cloud.speech.v1.ListCustomClassesRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListCustomClassesMethod(), getCallOptions()), request); - } - - /** - *
-     * Update a custom class.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture updateCustomClass( - com.google.cloud.speech.v1.UpdateCustomClassRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdateCustomClassMethod(), getCallOptions()), request); - } - - /** - *
-     * Delete a custom class.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture deleteCustomClass( - com.google.cloud.speech.v1.DeleteCustomClassRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteCustomClassMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_CREATE_PHRASE_SET = 0; - private static final int METHODID_GET_PHRASE_SET = 1; - private static final int METHODID_LIST_PHRASE_SET = 2; - private static final int METHODID_UPDATE_PHRASE_SET = 3; - private static final int METHODID_DELETE_PHRASE_SET = 4; - private static final int METHODID_CREATE_CUSTOM_CLASS = 5; - private static final int METHODID_GET_CUSTOM_CLASS = 6; - private static final int METHODID_LIST_CUSTOM_CLASSES = 7; - private static final int METHODID_UPDATE_CUSTOM_CLASS = 8; - private static final int METHODID_DELETE_CUSTOM_CLASS = 9; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final AdaptationImplBase serviceImpl; - private final int methodId; - - MethodHandlers(AdaptationImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_CREATE_PHRASE_SET: - serviceImpl.createPhraseSet((com.google.cloud.speech.v1.CreatePhraseSetRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_PHRASE_SET: - serviceImpl.getPhraseSet((com.google.cloud.speech.v1.GetPhraseSetRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_PHRASE_SET: - serviceImpl.listPhraseSet((com.google.cloud.speech.v1.ListPhraseSetRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UPDATE_PHRASE_SET: - serviceImpl.updatePhraseSet((com.google.cloud.speech.v1.UpdatePhraseSetRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_PHRASE_SET: - serviceImpl.deletePhraseSet((com.google.cloud.speech.v1.DeletePhraseSetRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CREATE_CUSTOM_CLASS: - serviceImpl.createCustomClass((com.google.cloud.speech.v1.CreateCustomClassRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_CUSTOM_CLASS: - serviceImpl.getCustomClass((com.google.cloud.speech.v1.GetCustomClassRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_CUSTOM_CLASSES: - serviceImpl.listCustomClasses((com.google.cloud.speech.v1.ListCustomClassesRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UPDATE_CUSTOM_CLASS: - serviceImpl.updateCustomClass((com.google.cloud.speech.v1.UpdateCustomClassRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_CUSTOM_CLASS: - serviceImpl.deleteCustomClass((com.google.cloud.speech.v1.DeleteCustomClassRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class AdaptationBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - AdaptationBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Adaptation"); - } - } - - private static final class AdaptationFileDescriptorSupplier - extends AdaptationBaseDescriptorSupplier { - AdaptationFileDescriptorSupplier() {} - } - - private static final class AdaptationMethodDescriptorSupplier - extends AdaptationBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - AdaptationMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (AdaptationGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new AdaptationFileDescriptorSupplier()) - .addMethod(getCreatePhraseSetMethod()) - .addMethod(getGetPhraseSetMethod()) - .addMethod(getListPhraseSetMethod()) - .addMethod(getUpdatePhraseSetMethod()) - .addMethod(getDeletePhraseSetMethod()) - .addMethod(getCreateCustomClassMethod()) - .addMethod(getGetCustomClassMethod()) - .addMethod(getListCustomClassesMethod()) - .addMethod(getUpdateCustomClassMethod()) - .addMethod(getDeleteCustomClassMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java b/owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java deleted file mode 100644 index 46b71822a661..000000000000 --- a/owl-bot-staging/java-speech/v1/grpc-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechGrpc.java +++ /dev/null @@ -1,479 +0,0 @@ -package com.google.cloud.speech.v1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - *
- * Service that implements Google Cloud Speech API.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/speech/v1/cloud_speech.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class SpeechGrpc { - - private SpeechGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.speech.v1.Speech"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getRecognizeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Recognize", - requestType = com.google.cloud.speech.v1.RecognizeRequest.class, - responseType = com.google.cloud.speech.v1.RecognizeResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getRecognizeMethod() { - io.grpc.MethodDescriptor getRecognizeMethod; - if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { - SpeechGrpc.getRecognizeMethod = getRecognizeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Recognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.RecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.RecognizeResponse.getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("Recognize")) - .build(); - } - } - } - return getRecognizeMethod; - } - - private static volatile io.grpc.MethodDescriptor getLongRunningRecognizeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "LongRunningRecognize", - requestType = com.google.cloud.speech.v1.LongRunningRecognizeRequest.class, - responseType = com.google.longrunning.Operation.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getLongRunningRecognizeMethod() { - io.grpc.MethodDescriptor getLongRunningRecognizeMethod; - if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { - SpeechGrpc.getLongRunningRecognizeMethod = getLongRunningRecognizeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "LongRunningRecognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.LongRunningRecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.longrunning.Operation.getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("LongRunningRecognize")) - .build(); - } - } - } - return getLongRunningRecognizeMethod; - } - - private static volatile io.grpc.MethodDescriptor getStreamingRecognizeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamingRecognize", - requestType = com.google.cloud.speech.v1.StreamingRecognizeRequest.class, - responseType = com.google.cloud.speech.v1.StreamingRecognizeResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getStreamingRecognizeMethod() { - io.grpc.MethodDescriptor getStreamingRecognizeMethod; - if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { - SpeechGrpc.getStreamingRecognizeMethod = getStreamingRecognizeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamingRecognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.StreamingRecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1.StreamingRecognizeResponse.getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("StreamingRecognize")) - .build(); - } - } - } - return getStreamingRecognizeMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static SpeechStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SpeechStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechStub(channel, callOptions); - } - }; - return SpeechStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static SpeechBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SpeechBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechBlockingStub(channel, callOptions); - } - }; - return SpeechBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static SpeechFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SpeechFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechFutureStub(channel, callOptions); - } - }; - return SpeechFutureStub.newStub(factory, channel); - } - - /** - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static abstract class SpeechImplBase implements io.grpc.BindableService { - - /** - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public void recognize(com.google.cloud.speech.v1.RecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRecognizeMethod(), responseObserver); - } - - /** - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public void longRunningRecognize(com.google.cloud.speech.v1.LongRunningRecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getLongRunningRecognizeMethod(), responseObserver); - } - - /** - *
-     * Performs bidirectional streaming speech recognition: receive results while
-     * sending audio. This method is only available via the gRPC API (not REST).
-     * 
- */ - public io.grpc.stub.StreamObserver streamingRecognize( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamingRecognizeMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getRecognizeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.RecognizeRequest, - com.google.cloud.speech.v1.RecognizeResponse>( - this, METHODID_RECOGNIZE))) - .addMethod( - getLongRunningRecognizeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1.LongRunningRecognizeRequest, - com.google.longrunning.Operation>( - this, METHODID_LONG_RUNNING_RECOGNIZE))) - .addMethod( - getStreamingRecognizeMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - com.google.cloud.speech.v1.StreamingRecognizeRequest, - com.google.cloud.speech.v1.StreamingRecognizeResponse>( - this, METHODID_STREAMING_RECOGNIZE))) - .build(); - } - } - - /** - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechStub extends io.grpc.stub.AbstractAsyncStub { - private SpeechStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechStub(channel, callOptions); - } - - /** - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public void recognize(com.google.cloud.speech.v1.RecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRecognizeMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public void longRunningRecognize(com.google.cloud.speech.v1.LongRunningRecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Performs bidirectional streaming speech recognition: receive results while
-     * sending audio. This method is only available via the gRPC API (not REST).
-     * 
- */ - public io.grpc.stub.StreamObserver streamingRecognize( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( - getChannel().newCall(getStreamingRecognizeMethod(), getCallOptions()), responseObserver); - } - } - - /** - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private SpeechBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechBlockingStub(channel, callOptions); - } - - /** - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public com.google.cloud.speech.v1.RecognizeResponse recognize(com.google.cloud.speech.v1.RecognizeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRecognizeMethod(), getCallOptions(), request); - } - - /** - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public com.google.longrunning.Operation longRunningRecognize(com.google.cloud.speech.v1.LongRunningRecognizeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getLongRunningRecognizeMethod(), getCallOptions(), request); - } - } - - /** - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechFutureStub extends io.grpc.stub.AbstractFutureStub { - private SpeechFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechFutureStub(channel, callOptions); - } - - /** - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture recognize( - com.google.cloud.speech.v1.RecognizeRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRecognizeMethod(), getCallOptions()), request); - } - - /** - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture longRunningRecognize( - com.google.cloud.speech.v1.LongRunningRecognizeRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_RECOGNIZE = 0; - private static final int METHODID_LONG_RUNNING_RECOGNIZE = 1; - private static final int METHODID_STREAMING_RECOGNIZE = 2; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final SpeechImplBase serviceImpl; - private final int methodId; - - MethodHandlers(SpeechImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_RECOGNIZE: - serviceImpl.recognize((com.google.cloud.speech.v1.RecognizeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LONG_RUNNING_RECOGNIZE: - serviceImpl.longRunningRecognize((com.google.cloud.speech.v1.LongRunningRecognizeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAMING_RECOGNIZE: - return (io.grpc.stub.StreamObserver) serviceImpl.streamingRecognize( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class SpeechBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - SpeechBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Speech"); - } - } - - private static final class SpeechFileDescriptorSupplier - extends SpeechBaseDescriptorSupplier { - SpeechFileDescriptorSupplier() {} - } - - private static final class SpeechMethodDescriptorSupplier - extends SpeechBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - SpeechMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (SpeechGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new SpeechFileDescriptorSupplier()) - .addMethod(getRecognizeMethod()) - .addMethod(getLongRunningRecognizeMethod()) - .addMethod(getStreamingRecognizeMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequest.java deleted file mode 100644 index 9484bfd6c1f9..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequest.java +++ /dev/null @@ -1,1060 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Message sent by the client for the `CreateCustomClass` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.CreateCustomClassRequest} - */ -public final class CreateCustomClassRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.CreateCustomClassRequest) - CreateCustomClassRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use CreateCustomClassRequest.newBuilder() to construct. - private CreateCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CreateCustomClassRequest() { - parent_ = ""; - customClassId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CreateCustomClassRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CreateCustomClassRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - customClassId_ = s; - break; - } - case 26: { - com.google.cloud.speech.v1.CustomClass.Builder subBuilder = null; - if (customClass_ != null) { - subBuilder = customClass_.toBuilder(); - } - customClass_ = input.readMessage(com.google.cloud.speech.v1.CustomClass.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(customClass_); - customClass_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreateCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreateCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.CreateCustomClassRequest.class, com.google.cloud.speech.v1.CreateCustomClassRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - *
-   * Required. The parent resource where this custom class will be created. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - *
-   * Required. The parent resource where this custom class will be created. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CUSTOM_CLASS_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object customClassId_; - /** - *
-   * Required. The ID to use for the custom class, which will become the final
-   * component of the custom class' resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClassId. - */ - @java.lang.Override - public java.lang.String getCustomClassId() { - java.lang.Object ref = customClassId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - customClassId_ = s; - return s; - } - } - /** - *
-   * Required. The ID to use for the custom class, which will become the final
-   * component of the custom class' resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for customClassId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCustomClassIdBytes() { - java.lang.Object ref = customClassId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - customClassId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CUSTOM_CLASS_FIELD_NUMBER = 3; - private com.google.cloud.speech.v1.CustomClass customClass_; - /** - *
-   * Required. The custom class to create.
-   * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the customClass field is set. - */ - @java.lang.Override - public boolean hasCustomClass() { - return customClass_ != null; - } - /** - *
-   * Required. The custom class to create.
-   * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClass. - */ - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass getCustomClass() { - return customClass_ == null ? com.google.cloud.speech.v1.CustomClass.getDefaultInstance() : customClass_; - } - /** - *
-   * Required. The custom class to create.
-   * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassOrBuilder() { - return getCustomClass(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, customClassId_); - } - if (customClass_ != null) { - output.writeMessage(3, getCustomClass()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, customClassId_); - } - if (customClass_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getCustomClass()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.CreateCustomClassRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.CreateCustomClassRequest other = (com.google.cloud.speech.v1.CreateCustomClassRequest) obj; - - if (!getParent() - .equals(other.getParent())) return false; - if (!getCustomClassId() - .equals(other.getCustomClassId())) return false; - if (hasCustomClass() != other.hasCustomClass()) return false; - if (hasCustomClass()) { - if (!getCustomClass() - .equals(other.getCustomClass())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + CUSTOM_CLASS_ID_FIELD_NUMBER; - hash = (53 * hash) + getCustomClassId().hashCode(); - if (hasCustomClass()) { - hash = (37 * hash) + CUSTOM_CLASS_FIELD_NUMBER; - hash = (53 * hash) + getCustomClass().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.CreateCustomClassRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.CreateCustomClassRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.CreateCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.CreateCustomClassRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `CreateCustomClass` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.CreateCustomClassRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.CreateCustomClassRequest) - com.google.cloud.speech.v1.CreateCustomClassRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreateCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreateCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.CreateCustomClassRequest.class, com.google.cloud.speech.v1.CreateCustomClassRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.CreateCustomClassRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - customClassId_ = ""; - - if (customClassBuilder_ == null) { - customClass_ = null; - } else { - customClass_ = null; - customClassBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreateCustomClassRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.CreateCustomClassRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.CreateCustomClassRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.CreateCustomClassRequest build() { - com.google.cloud.speech.v1.CreateCustomClassRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.CreateCustomClassRequest buildPartial() { - com.google.cloud.speech.v1.CreateCustomClassRequest result = new com.google.cloud.speech.v1.CreateCustomClassRequest(this); - result.parent_ = parent_; - result.customClassId_ = customClassId_; - if (customClassBuilder_ == null) { - result.customClass_ = customClass_; - } else { - result.customClass_ = customClassBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.CreateCustomClassRequest) { - return mergeFrom((com.google.cloud.speech.v1.CreateCustomClassRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.CreateCustomClassRequest other) { - if (other == com.google.cloud.speech.v1.CreateCustomClassRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (!other.getCustomClassId().isEmpty()) { - customClassId_ = other.customClassId_; - onChanged(); - } - if (other.hasCustomClass()) { - mergeCustomClass(other.getCustomClass()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.CreateCustomClassRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.CreateCustomClassRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
-     * Required. The parent resource where this custom class will be created. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The parent resource where this custom class will be created. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The parent resource where this custom class will be created. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The parent resource where this custom class will be created. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
-     * Required. The parent resource where this custom class will be created. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private java.lang.Object customClassId_ = ""; - /** - *
-     * Required. The ID to use for the custom class, which will become the final
-     * component of the custom class' resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClassId. - */ - public java.lang.String getCustomClassId() { - java.lang.Object ref = customClassId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - customClassId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The ID to use for the custom class, which will become the final
-     * component of the custom class' resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for customClassId. - */ - public com.google.protobuf.ByteString - getCustomClassIdBytes() { - java.lang.Object ref = customClassId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - customClassId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The ID to use for the custom class, which will become the final
-     * component of the custom class' resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param value The customClassId to set. - * @return This builder for chaining. - */ - public Builder setCustomClassId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - customClassId_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The ID to use for the custom class, which will become the final
-     * component of the custom class' resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return This builder for chaining. - */ - public Builder clearCustomClassId() { - - customClassId_ = getDefaultInstance().getCustomClassId(); - onChanged(); - return this; - } - /** - *
-     * Required. The ID to use for the custom class, which will become the final
-     * component of the custom class' resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param value The bytes for customClassId to set. - * @return This builder for chaining. - */ - public Builder setCustomClassIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - customClassId_ = value; - onChanged(); - return this; - } - - private com.google.cloud.speech.v1.CustomClass customClass_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> customClassBuilder_; - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the customClass field is set. - */ - public boolean hasCustomClass() { - return customClassBuilder_ != null || customClass_ != null; - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClass. - */ - public com.google.cloud.speech.v1.CustomClass getCustomClass() { - if (customClassBuilder_ == null) { - return customClass_ == null ? com.google.cloud.speech.v1.CustomClass.getDefaultInstance() : customClass_; - } else { - return customClassBuilder_.getMessage(); - } - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setCustomClass(com.google.cloud.speech.v1.CustomClass value) { - if (customClassBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - customClass_ = value; - onChanged(); - } else { - customClassBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setCustomClass( - com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { - if (customClassBuilder_ == null) { - customClass_ = builderForValue.build(); - onChanged(); - } else { - customClassBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeCustomClass(com.google.cloud.speech.v1.CustomClass value) { - if (customClassBuilder_ == null) { - if (customClass_ != null) { - customClass_ = - com.google.cloud.speech.v1.CustomClass.newBuilder(customClass_).mergeFrom(value).buildPartial(); - } else { - customClass_ = value; - } - onChanged(); - } else { - customClassBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearCustomClass() { - if (customClassBuilder_ == null) { - customClass_ = null; - onChanged(); - } else { - customClass_ = null; - customClassBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.CustomClass.Builder getCustomClassBuilder() { - - onChanged(); - return getCustomClassFieldBuilder().getBuilder(); - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassOrBuilder() { - if (customClassBuilder_ != null) { - return customClassBuilder_.getMessageOrBuilder(); - } else { - return customClass_ == null ? - com.google.cloud.speech.v1.CustomClass.getDefaultInstance() : customClass_; - } - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> - getCustomClassFieldBuilder() { - if (customClassBuilder_ == null) { - customClassBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder>( - getCustomClass(), - getParentForChildren(), - isClean()); - customClass_ = null; - } - return customClassBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.CreateCustomClassRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.CreateCustomClassRequest) - private static final com.google.cloud.speech.v1.CreateCustomClassRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.CreateCustomClassRequest(); - } - - public static com.google.cloud.speech.v1.CreateCustomClassRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateCustomClassRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateCustomClassRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.CreateCustomClassRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequestOrBuilder.java deleted file mode 100644 index f9dbb4e979ea..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreateCustomClassRequestOrBuilder.java +++ /dev/null @@ -1,94 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public interface CreateCustomClassRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.CreateCustomClassRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The parent resource where this custom class will be created. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
-   * Required. The parent resource where this custom class will be created. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - - /** - *
-   * Required. The ID to use for the custom class, which will become the final
-   * component of the custom class' resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClassId. - */ - java.lang.String getCustomClassId(); - /** - *
-   * Required. The ID to use for the custom class, which will become the final
-   * component of the custom class' resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for customClassId. - */ - com.google.protobuf.ByteString - getCustomClassIdBytes(); - - /** - *
-   * Required. The custom class to create.
-   * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the customClass field is set. - */ - boolean hasCustomClass(); - /** - *
-   * Required. The custom class to create.
-   * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClass. - */ - com.google.cloud.speech.v1.CustomClass getCustomClass(); - /** - *
-   * Required. The custom class to create.
-   * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequest.java deleted file mode 100644 index 04813cef2772..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequest.java +++ /dev/null @@ -1,1060 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Message sent by the client for the `CreatePhraseSet` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.CreatePhraseSetRequest} - */ -public final class CreatePhraseSetRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.CreatePhraseSetRequest) - CreatePhraseSetRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use CreatePhraseSetRequest.newBuilder() to construct. - private CreatePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CreatePhraseSetRequest() { - parent_ = ""; - phraseSetId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CreatePhraseSetRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CreatePhraseSetRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - phraseSetId_ = s; - break; - } - case 26: { - com.google.cloud.speech.v1.PhraseSet.Builder subBuilder = null; - if (phraseSet_ != null) { - subBuilder = phraseSet_.toBuilder(); - } - phraseSet_ = input.readMessage(com.google.cloud.speech.v1.PhraseSet.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(phraseSet_); - phraseSet_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.CreatePhraseSetRequest.class, com.google.cloud.speech.v1.CreatePhraseSetRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - *
-   * Required. The parent resource where this phrase set will be created. Format:
-   * `projects/{project}/locations/{location}/phraseSets`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - *
-   * Required. The parent resource where this phrase set will be created. Format:
-   * `projects/{project}/locations/{location}/phraseSets`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PHRASE_SET_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object phraseSetId_; - /** - *
-   * Required. The ID to use for the phrase set, which will become the final
-   * component of the phrase set's resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSetId. - */ - @java.lang.Override - public java.lang.String getPhraseSetId() { - java.lang.Object ref = phraseSetId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - phraseSetId_ = s; - return s; - } - } - /** - *
-   * Required. The ID to use for the phrase set, which will become the final
-   * component of the phrase set's resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for phraseSetId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPhraseSetIdBytes() { - java.lang.Object ref = phraseSetId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - phraseSetId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PHRASE_SET_FIELD_NUMBER = 3; - private com.google.cloud.speech.v1.PhraseSet phraseSet_; - /** - *
-   * Required. The phrase set to create.
-   * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the phraseSet field is set. - */ - @java.lang.Override - public boolean hasPhraseSet() { - return phraseSet_ != null; - } - /** - *
-   * Required. The phrase set to create.
-   * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSet. - */ - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet getPhraseSet() { - return phraseSet_ == null ? com.google.cloud.speech.v1.PhraseSet.getDefaultInstance() : phraseSet_; - } - /** - *
-   * Required. The phrase set to create.
-   * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetOrBuilder() { - return getPhraseSet(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(phraseSetId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, phraseSetId_); - } - if (phraseSet_ != null) { - output.writeMessage(3, getPhraseSet()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(phraseSetId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, phraseSetId_); - } - if (phraseSet_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getPhraseSet()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.CreatePhraseSetRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.CreatePhraseSetRequest other = (com.google.cloud.speech.v1.CreatePhraseSetRequest) obj; - - if (!getParent() - .equals(other.getParent())) return false; - if (!getPhraseSetId() - .equals(other.getPhraseSetId())) return false; - if (hasPhraseSet() != other.hasPhraseSet()) return false; - if (hasPhraseSet()) { - if (!getPhraseSet() - .equals(other.getPhraseSet())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PHRASE_SET_ID_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSetId().hashCode(); - if (hasPhraseSet()) { - hash = (37 * hash) + PHRASE_SET_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSet().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.CreatePhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.CreatePhraseSetRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `CreatePhraseSet` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.CreatePhraseSetRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.CreatePhraseSetRequest) - com.google.cloud.speech.v1.CreatePhraseSetRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.CreatePhraseSetRequest.class, com.google.cloud.speech.v1.CreatePhraseSetRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.CreatePhraseSetRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - phraseSetId_ = ""; - - if (phraseSetBuilder_ == null) { - phraseSet_ = null; - } else { - phraseSet_ = null; - phraseSetBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.CreatePhraseSetRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.CreatePhraseSetRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.CreatePhraseSetRequest build() { - com.google.cloud.speech.v1.CreatePhraseSetRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.CreatePhraseSetRequest buildPartial() { - com.google.cloud.speech.v1.CreatePhraseSetRequest result = new com.google.cloud.speech.v1.CreatePhraseSetRequest(this); - result.parent_ = parent_; - result.phraseSetId_ = phraseSetId_; - if (phraseSetBuilder_ == null) { - result.phraseSet_ = phraseSet_; - } else { - result.phraseSet_ = phraseSetBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.CreatePhraseSetRequest) { - return mergeFrom((com.google.cloud.speech.v1.CreatePhraseSetRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.CreatePhraseSetRequest other) { - if (other == com.google.cloud.speech.v1.CreatePhraseSetRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (!other.getPhraseSetId().isEmpty()) { - phraseSetId_ = other.phraseSetId_; - onChanged(); - } - if (other.hasPhraseSet()) { - mergePhraseSet(other.getPhraseSet()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.CreatePhraseSetRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.CreatePhraseSetRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
-     * Required. The parent resource where this phrase set will be created. Format:
-     * `projects/{project}/locations/{location}/phraseSets`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The parent resource where this phrase set will be created. Format:
-     * `projects/{project}/locations/{location}/phraseSets`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The parent resource where this phrase set will be created. Format:
-     * `projects/{project}/locations/{location}/phraseSets`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The parent resource where this phrase set will be created. Format:
-     * `projects/{project}/locations/{location}/phraseSets`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
-     * Required. The parent resource where this phrase set will be created. Format:
-     * `projects/{project}/locations/{location}/phraseSets`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private java.lang.Object phraseSetId_ = ""; - /** - *
-     * Required. The ID to use for the phrase set, which will become the final
-     * component of the phrase set's resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSetId. - */ - public java.lang.String getPhraseSetId() { - java.lang.Object ref = phraseSetId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - phraseSetId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The ID to use for the phrase set, which will become the final
-     * component of the phrase set's resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for phraseSetId. - */ - public com.google.protobuf.ByteString - getPhraseSetIdBytes() { - java.lang.Object ref = phraseSetId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - phraseSetId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The ID to use for the phrase set, which will become the final
-     * component of the phrase set's resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param value The phraseSetId to set. - * @return This builder for chaining. - */ - public Builder setPhraseSetId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - phraseSetId_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The ID to use for the phrase set, which will become the final
-     * component of the phrase set's resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return This builder for chaining. - */ - public Builder clearPhraseSetId() { - - phraseSetId_ = getDefaultInstance().getPhraseSetId(); - onChanged(); - return this; - } - /** - *
-     * Required. The ID to use for the phrase set, which will become the final
-     * component of the phrase set's resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param value The bytes for phraseSetId to set. - * @return This builder for chaining. - */ - public Builder setPhraseSetIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - phraseSetId_ = value; - onChanged(); - return this; - } - - private com.google.cloud.speech.v1.PhraseSet phraseSet_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> phraseSetBuilder_; - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the phraseSet field is set. - */ - public boolean hasPhraseSet() { - return phraseSetBuilder_ != null || phraseSet_ != null; - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSet. - */ - public com.google.cloud.speech.v1.PhraseSet getPhraseSet() { - if (phraseSetBuilder_ == null) { - return phraseSet_ == null ? com.google.cloud.speech.v1.PhraseSet.getDefaultInstance() : phraseSet_; - } else { - return phraseSetBuilder_.getMessage(); - } - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setPhraseSet(com.google.cloud.speech.v1.PhraseSet value) { - if (phraseSetBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - phraseSet_ = value; - onChanged(); - } else { - phraseSetBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setPhraseSet( - com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { - if (phraseSetBuilder_ == null) { - phraseSet_ = builderForValue.build(); - onChanged(); - } else { - phraseSetBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergePhraseSet(com.google.cloud.speech.v1.PhraseSet value) { - if (phraseSetBuilder_ == null) { - if (phraseSet_ != null) { - phraseSet_ = - com.google.cloud.speech.v1.PhraseSet.newBuilder(phraseSet_).mergeFrom(value).buildPartial(); - } else { - phraseSet_ = value; - } - onChanged(); - } else { - phraseSetBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearPhraseSet() { - if (phraseSetBuilder_ == null) { - phraseSet_ = null; - onChanged(); - } else { - phraseSet_ = null; - phraseSetBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.PhraseSet.Builder getPhraseSetBuilder() { - - onChanged(); - return getPhraseSetFieldBuilder().getBuilder(); - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetOrBuilder() { - if (phraseSetBuilder_ != null) { - return phraseSetBuilder_.getMessageOrBuilder(); - } else { - return phraseSet_ == null ? - com.google.cloud.speech.v1.PhraseSet.getDefaultInstance() : phraseSet_; - } - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> - getPhraseSetFieldBuilder() { - if (phraseSetBuilder_ == null) { - phraseSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder>( - getPhraseSet(), - getParentForChildren(), - isClean()); - phraseSet_ = null; - } - return phraseSetBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.CreatePhraseSetRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.CreatePhraseSetRequest) - private static final com.google.cloud.speech.v1.CreatePhraseSetRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.CreatePhraseSetRequest(); - } - - public static com.google.cloud.speech.v1.CreatePhraseSetRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreatePhraseSetRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreatePhraseSetRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.CreatePhraseSetRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequestOrBuilder.java deleted file mode 100644 index 913da08c2410..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CreatePhraseSetRequestOrBuilder.java +++ /dev/null @@ -1,94 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public interface CreatePhraseSetRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.CreatePhraseSetRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The parent resource where this phrase set will be created. Format:
-   * `projects/{project}/locations/{location}/phraseSets`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
-   * Required. The parent resource where this phrase set will be created. Format:
-   * `projects/{project}/locations/{location}/phraseSets`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - - /** - *
-   * Required. The ID to use for the phrase set, which will become the final
-   * component of the phrase set's resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSetId. - */ - java.lang.String getPhraseSetId(); - /** - *
-   * Required. The ID to use for the phrase set, which will become the final
-   * component of the phrase set's resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for phraseSetId. - */ - com.google.protobuf.ByteString - getPhraseSetIdBytes(); - - /** - *
-   * Required. The phrase set to create.
-   * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the phraseSet field is set. - */ - boolean hasPhraseSet(); - /** - *
-   * Required. The phrase set to create.
-   * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSet. - */ - com.google.cloud.speech.v1.PhraseSet getPhraseSet(); - /** - *
-   * Required. The phrase set to create.
-   * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClass.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClass.java deleted file mode 100644 index bcbf30da2ab2..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClass.java +++ /dev/null @@ -1,1829 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/resource.proto - -package com.google.cloud.speech.v1; - -/** - *
- * A set of words or phrases that represents a common concept likely to appear
- * in your audio, for example a list of passenger ship names. CustomClass items
- * can be substituted into placeholders that you set in PhraseSet phrases.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.CustomClass} - */ -public final class CustomClass extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.CustomClass) - CustomClassOrBuilder { -private static final long serialVersionUID = 0L; - // Use CustomClass.newBuilder() to construct. - private CustomClass(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CustomClass() { - name_ = ""; - customClassId_ = ""; - items_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CustomClass(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CustomClass( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - customClassId_ = s; - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - items_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - items_.add( - input.readMessage(com.google.cloud.speech.v1.CustomClass.ClassItem.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - items_ = java.util.Collections.unmodifiableList(items_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.CustomClass.class, com.google.cloud.speech.v1.CustomClass.Builder.class); - } - - public interface ClassItemOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.CustomClass.ClassItem) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * The class item's value.
-     * 
- * - * string value = 1; - * @return The value. - */ - java.lang.String getValue(); - /** - *
-     * The class item's value.
-     * 
- * - * string value = 1; - * @return The bytes for value. - */ - com.google.protobuf.ByteString - getValueBytes(); - } - /** - *
-   * An item of the class.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.CustomClass.ClassItem} - */ - public static final class ClassItem extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.CustomClass.ClassItem) - ClassItemOrBuilder { - private static final long serialVersionUID = 0L; - // Use ClassItem.newBuilder() to construct. - private ClassItem(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ClassItem() { - value_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ClassItem(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ClassItem( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - value_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_ClassItem_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_ClassItem_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.CustomClass.ClassItem.class, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private volatile java.lang.Object value_; - /** - *
-     * The class item's value.
-     * 
- * - * string value = 1; - * @return The value. - */ - @java.lang.Override - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } - } - /** - *
-     * The class item's value.
-     * 
- * - * string value = 1; - * @return The bytes for value. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.CustomClass.ClassItem)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.CustomClass.ClassItem other = (com.google.cloud.speech.v1.CustomClass.ClassItem) obj; - - if (!getValue() - .equals(other.getValue())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.CustomClass.ClassItem parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.CustomClass.ClassItem parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.CustomClass.ClassItem parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.CustomClass.ClassItem prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * An item of the class.
-     * 
- * - * Protobuf type {@code google.cloud.speech.v1.CustomClass.ClassItem} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.CustomClass.ClassItem) - com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_ClassItem_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_ClassItem_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.CustomClass.ClassItem.class, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.CustomClass.ClassItem.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - value_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_ClassItem_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass.ClassItem getDefaultInstanceForType() { - return com.google.cloud.speech.v1.CustomClass.ClassItem.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass.ClassItem build() { - com.google.cloud.speech.v1.CustomClass.ClassItem result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass.ClassItem buildPartial() { - com.google.cloud.speech.v1.CustomClass.ClassItem result = new com.google.cloud.speech.v1.CustomClass.ClassItem(this); - result.value_ = value_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.CustomClass.ClassItem) { - return mergeFrom((com.google.cloud.speech.v1.CustomClass.ClassItem)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.CustomClass.ClassItem other) { - if (other == com.google.cloud.speech.v1.CustomClass.ClassItem.getDefaultInstance()) return this; - if (!other.getValue().isEmpty()) { - value_ = other.value_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.CustomClass.ClassItem parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.CustomClass.ClassItem) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object value_ = ""; - /** - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * @return The value. - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * @return The bytes for value. - */ - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - /** - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * @param value The bytes for value to set. - * @return This builder for chaining. - */ - public Builder setValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - value_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.CustomClass.ClassItem) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.CustomClass.ClassItem) - private static final com.google.cloud.speech.v1.CustomClass.ClassItem DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.CustomClass.ClassItem(); - } - - public static com.google.cloud.speech.v1.CustomClass.ClassItem getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ClassItem parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ClassItem(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass.ClassItem getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * The resource name of the custom class.
-   * 
- * - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * The resource name of the custom class.
-   * 
- * - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CUSTOM_CLASS_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object customClassId_; - /** - *
-   * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass. Case sensitive.
-   * 
- * - * string custom_class_id = 2; - * @return The customClassId. - */ - @java.lang.Override - public java.lang.String getCustomClassId() { - java.lang.Object ref = customClassId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - customClassId_ = s; - return s; - } - } - /** - *
-   * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass. Case sensitive.
-   * 
- * - * string custom_class_id = 2; - * @return The bytes for customClassId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCustomClassIdBytes() { - java.lang.Object ref = customClassId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - customClassId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ITEMS_FIELD_NUMBER = 3; - private java.util.List items_; - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public java.util.List getItemsList() { - return items_; - } - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public java.util.List - getItemsOrBuilderList() { - return items_; - } - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public int getItemsCount() { - return items_.size(); - } - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass.ClassItem getItems(int index) { - return items_.get(index); - } - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( - int index) { - return items_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, customClassId_); - } - for (int i = 0; i < items_.size(); i++) { - output.writeMessage(3, items_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, customClassId_); - } - for (int i = 0; i < items_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, items_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.CustomClass)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.CustomClass other = (com.google.cloud.speech.v1.CustomClass) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getCustomClassId() - .equals(other.getCustomClassId())) return false; - if (!getItemsList() - .equals(other.getItemsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + CUSTOM_CLASS_ID_FIELD_NUMBER; - hash = (53 * hash) + getCustomClassId().hashCode(); - if (getItemsCount() > 0) { - hash = (37 * hash) + ITEMS_FIELD_NUMBER; - hash = (53 * hash) + getItemsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.CustomClass parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.CustomClass parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.CustomClass parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.CustomClass parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.CustomClass parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.CustomClass parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.CustomClass parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.CustomClass parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.CustomClass parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.CustomClass parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.CustomClass parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.CustomClass parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.CustomClass prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * A set of words or phrases that represents a common concept likely to appear
-   * in your audio, for example a list of passenger ship names. CustomClass items
-   * can be substituted into placeholders that you set in PhraseSet phrases.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.CustomClass} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.CustomClass) - com.google.cloud.speech.v1.CustomClassOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.CustomClass.class, com.google.cloud.speech.v1.CustomClass.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.CustomClass.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getItemsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - customClassId_ = ""; - - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - itemsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_CustomClass_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass getDefaultInstanceForType() { - return com.google.cloud.speech.v1.CustomClass.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass build() { - com.google.cloud.speech.v1.CustomClass result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass buildPartial() { - com.google.cloud.speech.v1.CustomClass result = new com.google.cloud.speech.v1.CustomClass(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.customClassId_ = customClassId_; - if (itemsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - items_ = java.util.Collections.unmodifiableList(items_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.items_ = items_; - } else { - result.items_ = itemsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.CustomClass) { - return mergeFrom((com.google.cloud.speech.v1.CustomClass)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.CustomClass other) { - if (other == com.google.cloud.speech.v1.CustomClass.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getCustomClassId().isEmpty()) { - customClassId_ = other.customClassId_; - onChanged(); - } - if (itemsBuilder_ == null) { - if (!other.items_.isEmpty()) { - if (items_.isEmpty()) { - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureItemsIsMutable(); - items_.addAll(other.items_); - } - onChanged(); - } - } else { - if (!other.items_.isEmpty()) { - if (itemsBuilder_.isEmpty()) { - itemsBuilder_.dispose(); - itemsBuilder_ = null; - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000001); - itemsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getItemsFieldBuilder() : null; - } else { - itemsBuilder_.addAllMessages(other.items_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.CustomClass parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.CustomClass) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object customClassId_ = ""; - /** - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass. Case sensitive.
-     * 
- * - * string custom_class_id = 2; - * @return The customClassId. - */ - public java.lang.String getCustomClassId() { - java.lang.Object ref = customClassId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - customClassId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass. Case sensitive.
-     * 
- * - * string custom_class_id = 2; - * @return The bytes for customClassId. - */ - public com.google.protobuf.ByteString - getCustomClassIdBytes() { - java.lang.Object ref = customClassId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - customClassId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass. Case sensitive.
-     * 
- * - * string custom_class_id = 2; - * @param value The customClassId to set. - * @return This builder for chaining. - */ - public Builder setCustomClassId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - customClassId_ = value; - onChanged(); - return this; - } - /** - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass. Case sensitive.
-     * 
- * - * string custom_class_id = 2; - * @return This builder for chaining. - */ - public Builder clearCustomClassId() { - - customClassId_ = getDefaultInstance().getCustomClassId(); - onChanged(); - return this; - } - /** - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass. Case sensitive.
-     * 
- * - * string custom_class_id = 2; - * @param value The bytes for customClassId to set. - * @return This builder for chaining. - */ - public Builder setCustomClassIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - customClassId_ = value; - onChanged(); - return this; - } - - private java.util.List items_ = - java.util.Collections.emptyList(); - private void ensureItemsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - items_ = new java.util.ArrayList(items_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass.ClassItem, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder, com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder> itemsBuilder_; - - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public java.util.List getItemsList() { - if (itemsBuilder_ == null) { - return java.util.Collections.unmodifiableList(items_); - } else { - return itemsBuilder_.getMessageList(); - } - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public int getItemsCount() { - if (itemsBuilder_ == null) { - return items_.size(); - } else { - return itemsBuilder_.getCount(); - } - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1.CustomClass.ClassItem getItems(int index) { - if (itemsBuilder_ == null) { - return items_.get(index); - } else { - return itemsBuilder_.getMessage(index); - } - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public Builder setItems( - int index, com.google.cloud.speech.v1.CustomClass.ClassItem value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.set(index, value); - onChanged(); - } else { - itemsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public Builder setItems( - int index, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.set(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public Builder addItems(com.google.cloud.speech.v1.CustomClass.ClassItem value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(value); - onChanged(); - } else { - itemsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public Builder addItems( - int index, com.google.cloud.speech.v1.CustomClass.ClassItem value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(index, value); - onChanged(); - } else { - itemsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public Builder addItems( - com.google.cloud.speech.v1.CustomClass.ClassItem.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public Builder addItems( - int index, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public Builder addAllItems( - java.lang.Iterable values) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, items_); - onChanged(); - } else { - itemsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public Builder clearItems() { - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - itemsBuilder_.clear(); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public Builder removeItems(int index) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.remove(index); - onChanged(); - } else { - itemsBuilder_.remove(index); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1.CustomClass.ClassItem.Builder getItemsBuilder( - int index) { - return getItemsFieldBuilder().getBuilder(index); - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( - int index) { - if (itemsBuilder_ == null) { - return items_.get(index); } else { - return itemsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public java.util.List - getItemsOrBuilderList() { - if (itemsBuilder_ != null) { - return itemsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(items_); - } - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1.CustomClass.ClassItem.Builder addItemsBuilder() { - return getItemsFieldBuilder().addBuilder( - com.google.cloud.speech.v1.CustomClass.ClassItem.getDefaultInstance()); - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1.CustomClass.ClassItem.Builder addItemsBuilder( - int index) { - return getItemsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.CustomClass.ClassItem.getDefaultInstance()); - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - public java.util.List - getItemsBuilderList() { - return getItemsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass.ClassItem, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder, com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder> - getItemsFieldBuilder() { - if (itemsBuilder_ == null) { - itemsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass.ClassItem, com.google.cloud.speech.v1.CustomClass.ClassItem.Builder, com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder>( - items_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - items_ = null; - } - return itemsBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.CustomClass) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.CustomClass) - private static final com.google.cloud.speech.v1.CustomClass DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.CustomClass(); - } - - public static com.google.cloud.speech.v1.CustomClass getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CustomClass parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CustomClass(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassName.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassName.java deleted file mode 100644 index 96235bc68334..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassName.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class CustomClassName implements ResourceName { - private static final PathTemplate PROJECT_LOCATION_CUSTOM_CLASS = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/customClasses/{custom_class}"); - private volatile Map fieldValuesMap; - private final String project; - private final String location; - private final String customClass; - - @Deprecated - protected CustomClassName() { - project = null; - location = null; - customClass = null; - } - - private CustomClassName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - customClass = Preconditions.checkNotNull(builder.getCustomClass()); - } - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getCustomClass() { - return customClass; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static CustomClassName of(String project, String location, String customClass) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setCustomClass(customClass) - .build(); - } - - public static String format(String project, String location, String customClass) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setCustomClass(customClass) - .build() - .toString(); - } - - public static CustomClassName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_LOCATION_CUSTOM_CLASS.validatedMatch( - formattedString, "CustomClassName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("custom_class")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (CustomClassName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION_CUSTOM_CLASS.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (location != null) { - fieldMapBuilder.put("location", location); - } - if (customClass != null) { - fieldMapBuilder.put("custom_class", customClass); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_LOCATION_CUSTOM_CLASS.instantiate( - "project", project, "location", location, "custom_class", customClass); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - CustomClassName that = ((CustomClassName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.location, that.location) - && Objects.equals(this.customClass, that.customClass); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - h *= 1000003; - h ^= Objects.hashCode(customClass); - return h; - } - - /** Builder for projects/{project}/locations/{location}/customClasses/{custom_class}. */ - public static class Builder { - private String project; - private String location; - private String customClass; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getCustomClass() { - return customClass; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - public Builder setCustomClass(String customClass) { - this.customClass = customClass; - return this; - } - - private Builder(CustomClassName customClassName) { - this.project = customClassName.project; - this.location = customClassName.location; - this.customClass = customClassName.customClass; - } - - public CustomClassName build() { - return new CustomClassName(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassOrBuilder.java deleted file mode 100644 index d22bd6cc0b5e..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/CustomClassOrBuilder.java +++ /dev/null @@ -1,95 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/resource.proto - -package com.google.cloud.speech.v1; - -public interface CustomClassOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.CustomClass) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The resource name of the custom class.
-   * 
- * - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * The resource name of the custom class.
-   * 
- * - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-   * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass. Case sensitive.
-   * 
- * - * string custom_class_id = 2; - * @return The customClassId. - */ - java.lang.String getCustomClassId(); - /** - *
-   * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass. Case sensitive.
-   * 
- * - * string custom_class_id = 2; - * @return The bytes for customClassId. - */ - com.google.protobuf.ByteString - getCustomClassIdBytes(); - - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - java.util.List - getItemsList(); - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - com.google.cloud.speech.v1.CustomClass.ClassItem getItems(int index); - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - int getItemsCount(); - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - java.util.List - getItemsOrBuilderList(); - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass.ClassItem items = 3; - */ - com.google.cloud.speech.v1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( - int index); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequest.java deleted file mode 100644 index f07ccb28d69e..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequest.java +++ /dev/null @@ -1,637 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Message sent by the client for the `DeleteCustomClass` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.DeleteCustomClassRequest} - */ -public final class DeleteCustomClassRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.DeleteCustomClassRequest) - DeleteCustomClassRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeleteCustomClassRequest.newBuilder() to construct. - private DeleteCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeleteCustomClassRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeleteCustomClassRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeleteCustomClassRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.DeleteCustomClassRequest.class, com.google.cloud.speech.v1.DeleteCustomClassRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * Required. The name of the custom class to delete. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * Required. The name of the custom class to delete. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.DeleteCustomClassRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.DeleteCustomClassRequest other = (com.google.cloud.speech.v1.DeleteCustomClassRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.DeleteCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.DeleteCustomClassRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `DeleteCustomClass` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.DeleteCustomClassRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.DeleteCustomClassRequest) - com.google.cloud.speech.v1.DeleteCustomClassRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.DeleteCustomClassRequest.class, com.google.cloud.speech.v1.DeleteCustomClassRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.DeleteCustomClassRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.DeleteCustomClassRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.DeleteCustomClassRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.DeleteCustomClassRequest build() { - com.google.cloud.speech.v1.DeleteCustomClassRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.DeleteCustomClassRequest buildPartial() { - com.google.cloud.speech.v1.DeleteCustomClassRequest result = new com.google.cloud.speech.v1.DeleteCustomClassRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.DeleteCustomClassRequest) { - return mergeFrom((com.google.cloud.speech.v1.DeleteCustomClassRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.DeleteCustomClassRequest other) { - if (other == com.google.cloud.speech.v1.DeleteCustomClassRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.DeleteCustomClassRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.DeleteCustomClassRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
-     * Required. The name of the custom class to delete. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The name of the custom class to delete. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The name of the custom class to delete. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The name of the custom class to delete. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * Required. The name of the custom class to delete. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.DeleteCustomClassRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.DeleteCustomClassRequest) - private static final com.google.cloud.speech.v1.DeleteCustomClassRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.DeleteCustomClassRequest(); - } - - public static com.google.cloud.speech.v1.DeleteCustomClassRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteCustomClassRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteCustomClassRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.DeleteCustomClassRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequestOrBuilder.java deleted file mode 100644 index a534c8411380..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeleteCustomClassRequestOrBuilder.java +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public interface DeleteCustomClassRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.DeleteCustomClassRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The name of the custom class to delete. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * Required. The name of the custom class to delete. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequest.java deleted file mode 100644 index c16d6b374bff..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequest.java +++ /dev/null @@ -1,602 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Message sent by the client for the `DeletePhraseSet` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.DeletePhraseSetRequest} - */ -public final class DeletePhraseSetRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.DeletePhraseSetRequest) - DeletePhraseSetRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeletePhraseSetRequest.newBuilder() to construct. - private DeletePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeletePhraseSetRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeletePhraseSetRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeletePhraseSetRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.DeletePhraseSetRequest.class, com.google.cloud.speech.v1.DeletePhraseSetRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * Required. The name of the phrase set to delete. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * Required. The name of the phrase set to delete. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.DeletePhraseSetRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.DeletePhraseSetRequest other = (com.google.cloud.speech.v1.DeletePhraseSetRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.DeletePhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.DeletePhraseSetRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `DeletePhraseSet` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.DeletePhraseSetRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.DeletePhraseSetRequest) - com.google.cloud.speech.v1.DeletePhraseSetRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.DeletePhraseSetRequest.class, com.google.cloud.speech.v1.DeletePhraseSetRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.DeletePhraseSetRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.DeletePhraseSetRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.DeletePhraseSetRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.DeletePhraseSetRequest build() { - com.google.cloud.speech.v1.DeletePhraseSetRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.DeletePhraseSetRequest buildPartial() { - com.google.cloud.speech.v1.DeletePhraseSetRequest result = new com.google.cloud.speech.v1.DeletePhraseSetRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.DeletePhraseSetRequest) { - return mergeFrom((com.google.cloud.speech.v1.DeletePhraseSetRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.DeletePhraseSetRequest other) { - if (other == com.google.cloud.speech.v1.DeletePhraseSetRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.DeletePhraseSetRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.DeletePhraseSetRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
-     * Required. The name of the phrase set to delete. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The name of the phrase set to delete. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The name of the phrase set to delete. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The name of the phrase set to delete. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * Required. The name of the phrase set to delete. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.DeletePhraseSetRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.DeletePhraseSetRequest) - private static final com.google.cloud.speech.v1.DeletePhraseSetRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.DeletePhraseSetRequest(); - } - - public static com.google.cloud.speech.v1.DeletePhraseSetRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeletePhraseSetRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeletePhraseSetRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.DeletePhraseSetRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequestOrBuilder.java deleted file mode 100644 index 6e63a397ad6a..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/DeletePhraseSetRequestOrBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public interface DeletePhraseSetRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.DeletePhraseSetRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The name of the phrase set to delete. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * Required. The name of the phrase set to delete. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequest.java deleted file mode 100644 index d9a29a78b802..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequest.java +++ /dev/null @@ -1,602 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Message sent by the client for the `GetCustomClass` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.GetCustomClassRequest} - */ -public final class GetCustomClassRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.GetCustomClassRequest) - GetCustomClassRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use GetCustomClassRequest.newBuilder() to construct. - private GetCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GetCustomClassRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GetCustomClassRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GetCustomClassRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.GetCustomClassRequest.class, com.google.cloud.speech.v1.GetCustomClassRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * Required. The name of the custom class to retrieve. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * Required. The name of the custom class to retrieve. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.GetCustomClassRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.GetCustomClassRequest other = (com.google.cloud.speech.v1.GetCustomClassRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.GetCustomClassRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.GetCustomClassRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.GetCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.GetCustomClassRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `GetCustomClass` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.GetCustomClassRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.GetCustomClassRequest) - com.google.cloud.speech.v1.GetCustomClassRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.GetCustomClassRequest.class, com.google.cloud.speech.v1.GetCustomClassRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.GetCustomClassRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetCustomClassRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.GetCustomClassRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.GetCustomClassRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.GetCustomClassRequest build() { - com.google.cloud.speech.v1.GetCustomClassRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.GetCustomClassRequest buildPartial() { - com.google.cloud.speech.v1.GetCustomClassRequest result = new com.google.cloud.speech.v1.GetCustomClassRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.GetCustomClassRequest) { - return mergeFrom((com.google.cloud.speech.v1.GetCustomClassRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.GetCustomClassRequest other) { - if (other == com.google.cloud.speech.v1.GetCustomClassRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.GetCustomClassRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.GetCustomClassRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
-     * Required. The name of the custom class to retrieve. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The name of the custom class to retrieve. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The name of the custom class to retrieve. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The name of the custom class to retrieve. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * Required. The name of the custom class to retrieve. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.GetCustomClassRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.GetCustomClassRequest) - private static final com.google.cloud.speech.v1.GetCustomClassRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.GetCustomClassRequest(); - } - - public static com.google.cloud.speech.v1.GetCustomClassRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetCustomClassRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetCustomClassRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.GetCustomClassRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequestOrBuilder.java deleted file mode 100644 index 61476aadbf58..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetCustomClassRequestOrBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public interface GetCustomClassRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.GetCustomClassRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The name of the custom class to retrieve. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * Required. The name of the custom class to retrieve. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequest.java deleted file mode 100644 index b38cf58c73f6..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequest.java +++ /dev/null @@ -1,637 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Message sent by the client for the `GetPhraseSet` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.GetPhraseSetRequest} - */ -public final class GetPhraseSetRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.GetPhraseSetRequest) - GetPhraseSetRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use GetPhraseSetRequest.newBuilder() to construct. - private GetPhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GetPhraseSetRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GetPhraseSetRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GetPhraseSetRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetPhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetPhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.GetPhraseSetRequest.class, com.google.cloud.speech.v1.GetPhraseSetRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * Required. The name of the phrase set to retrieve. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * Required. The name of the phrase set to retrieve. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.GetPhraseSetRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.GetPhraseSetRequest other = (com.google.cloud.speech.v1.GetPhraseSetRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.GetPhraseSetRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.GetPhraseSetRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.GetPhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.GetPhraseSetRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `GetPhraseSet` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.GetPhraseSetRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.GetPhraseSetRequest) - com.google.cloud.speech.v1.GetPhraseSetRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetPhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetPhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.GetPhraseSetRequest.class, com.google.cloud.speech.v1.GetPhraseSetRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.GetPhraseSetRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_GetPhraseSetRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.GetPhraseSetRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.GetPhraseSetRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.GetPhraseSetRequest build() { - com.google.cloud.speech.v1.GetPhraseSetRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.GetPhraseSetRequest buildPartial() { - com.google.cloud.speech.v1.GetPhraseSetRequest result = new com.google.cloud.speech.v1.GetPhraseSetRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.GetPhraseSetRequest) { - return mergeFrom((com.google.cloud.speech.v1.GetPhraseSetRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.GetPhraseSetRequest other) { - if (other == com.google.cloud.speech.v1.GetPhraseSetRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.GetPhraseSetRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.GetPhraseSetRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
-     * Required. The name of the phrase set to retrieve. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The name of the phrase set to retrieve. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The name of the phrase set to retrieve. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The name of the phrase set to retrieve. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * Required. The name of the phrase set to retrieve. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.GetPhraseSetRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.GetPhraseSetRequest) - private static final com.google.cloud.speech.v1.GetPhraseSetRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.GetPhraseSetRequest(); - } - - public static com.google.cloud.speech.v1.GetPhraseSetRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetPhraseSetRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetPhraseSetRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.GetPhraseSetRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequestOrBuilder.java deleted file mode 100644 index a7aa5beacb2e..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/GetPhraseSetRequestOrBuilder.java +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public interface GetPhraseSetRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.GetPhraseSetRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The name of the phrase set to retrieve. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * Required. The name of the phrase set to retrieve. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequest.java deleted file mode 100644 index 0ec369dc1d97..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequest.java +++ /dev/null @@ -1,916 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Message sent by the client for the `ListCustomClasses` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.ListCustomClassesRequest} - */ -public final class ListCustomClassesRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.ListCustomClassesRequest) - ListCustomClassesRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListCustomClassesRequest.newBuilder() to construct. - private ListCustomClassesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListCustomClassesRequest() { - parent_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListCustomClassesRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListCustomClassesRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 16: { - - pageSize_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.ListCustomClassesRequest.class, com.google.cloud.speech.v1.ListCustomClassesRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - *
-   * Required. The parent, which owns this collection of custom classes. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - *
-   * Required. The parent, which owns this collection of custom classes. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; - /** - *
-   * The maximum number of custom classes to return. The service may return
-   * fewer than this value. If unspecified, at most 50 custom classes will be
-   * returned. The maximum value is 1000; values above 1000 will be coerced to
-   * 1000.
-   * 
- * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - *
-   * A page token, received from a previous `ListCustomClass` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListCustomClass` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - *
-   * A page token, received from a previous `ListCustomClass` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListCustomClass` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.ListCustomClassesRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.ListCustomClassesRequest other = (com.google.cloud.speech.v1.ListCustomClassesRequest) obj; - - if (!getParent() - .equals(other.getParent())) return false; - if (getPageSize() - != other.getPageSize()) return false; - if (!getPageToken() - .equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListCustomClassesRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.ListCustomClassesRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.ListCustomClassesRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.ListCustomClassesRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `ListCustomClasses` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.ListCustomClassesRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.ListCustomClassesRequest) - com.google.cloud.speech.v1.ListCustomClassesRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.ListCustomClassesRequest.class, com.google.cloud.speech.v1.ListCustomClassesRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.ListCustomClassesRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListCustomClassesRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.ListCustomClassesRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListCustomClassesRequest build() { - com.google.cloud.speech.v1.ListCustomClassesRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListCustomClassesRequest buildPartial() { - com.google.cloud.speech.v1.ListCustomClassesRequest result = new com.google.cloud.speech.v1.ListCustomClassesRequest(this); - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.ListCustomClassesRequest) { - return mergeFrom((com.google.cloud.speech.v1.ListCustomClassesRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.ListCustomClassesRequest other) { - if (other == com.google.cloud.speech.v1.ListCustomClassesRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.ListCustomClassesRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.ListCustomClassesRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
-     * Required. The parent, which owns this collection of custom classes. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The parent, which owns this collection of custom classes. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The parent, which owns this collection of custom classes. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The parent, which owns this collection of custom classes. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
-     * Required. The parent, which owns this collection of custom classes. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private int pageSize_ ; - /** - *
-     * The maximum number of custom classes to return. The service may return
-     * fewer than this value. If unspecified, at most 50 custom classes will be
-     * returned. The maximum value is 1000; values above 1000 will be coerced to
-     * 1000.
-     * 
- * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - *
-     * The maximum number of custom classes to return. The service may return
-     * fewer than this value. If unspecified, at most 50 custom classes will be
-     * returned. The maximum value is 1000; values above 1000 will be coerced to
-     * 1000.
-     * 
- * - * int32 page_size = 2; - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - *
-     * The maximum number of custom classes to return. The service may return
-     * fewer than this value. If unspecified, at most 50 custom classes will be
-     * returned. The maximum value is 1000; values above 1000 will be coerced to
-     * 1000.
-     * 
- * - * int32 page_size = 2; - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - *
-     * A page token, received from a previous `ListCustomClass` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListCustomClass` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * A page token, received from a previous `ListCustomClass` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListCustomClass` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * A page token, received from a previous `ListCustomClass` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListCustomClass` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - *
-     * A page token, received from a previous `ListCustomClass` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListCustomClass` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - *
-     * A page token, received from a previous `ListCustomClass` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListCustomClass` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.ListCustomClassesRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.ListCustomClassesRequest) - private static final com.google.cloud.speech.v1.ListCustomClassesRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.ListCustomClassesRequest(); - } - - public static com.google.cloud.speech.v1.ListCustomClassesRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListCustomClassesRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListCustomClassesRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListCustomClassesRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequestOrBuilder.java deleted file mode 100644 index 5e2d443bfaad..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesRequestOrBuilder.java +++ /dev/null @@ -1,80 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public interface ListCustomClassesRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.ListCustomClassesRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The parent, which owns this collection of custom classes. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
-   * Required. The parent, which owns this collection of custom classes. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - - /** - *
-   * The maximum number of custom classes to return. The service may return
-   * fewer than this value. If unspecified, at most 50 custom classes will be
-   * returned. The maximum value is 1000; values above 1000 will be coerced to
-   * 1000.
-   * 
- * - * int32 page_size = 2; - * @return The pageSize. - */ - int getPageSize(); - - /** - *
-   * A page token, received from a previous `ListCustomClass` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListCustomClass` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - *
-   * A page token, received from a previous `ListCustomClass` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListCustomClass` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponse.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponse.java deleted file mode 100644 index 702ef6bb24ab..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponse.java +++ /dev/null @@ -1,1045 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Message returned to the client by the `ListCustomClasses` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.ListCustomClassesResponse} - */ -public final class ListCustomClassesResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.ListCustomClassesResponse) - ListCustomClassesResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListCustomClassesResponse.newBuilder() to construct. - private ListCustomClassesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListCustomClassesResponse() { - customClasses_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListCustomClassesResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListCustomClassesResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - customClasses_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - customClasses_.add( - input.readMessage(com.google.cloud.speech.v1.CustomClass.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - customClasses_ = java.util.Collections.unmodifiableList(customClasses_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.ListCustomClassesResponse.class, com.google.cloud.speech.v1.ListCustomClassesResponse.Builder.class); - } - - public static final int CUSTOM_CLASSES_FIELD_NUMBER = 1; - private java.util.List customClasses_; - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - @java.lang.Override - public java.util.List getCustomClassesList() { - return customClasses_; - } - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - @java.lang.Override - public java.util.List - getCustomClassesOrBuilderList() { - return customClasses_; - } - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - @java.lang.Override - public int getCustomClassesCount() { - return customClasses_.size(); - } - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass getCustomClasses(int index) { - return customClasses_.get(index); - } - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index) { - return customClasses_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < customClasses_.size(); i++) { - output.writeMessage(1, customClasses_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < customClasses_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, customClasses_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.ListCustomClassesResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.ListCustomClassesResponse other = (com.google.cloud.speech.v1.ListCustomClassesResponse) obj; - - if (!getCustomClassesList() - .equals(other.getCustomClassesList())) return false; - if (!getNextPageToken() - .equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getCustomClassesCount() > 0) { - hash = (37 * hash) + CUSTOM_CLASSES_FIELD_NUMBER; - hash = (53 * hash) + getCustomClassesList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListCustomClassesResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.ListCustomClassesResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.ListCustomClassesResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.ListCustomClassesResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message returned to the client by the `ListCustomClasses` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.ListCustomClassesResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.ListCustomClassesResponse) - com.google.cloud.speech.v1.ListCustomClassesResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.ListCustomClassesResponse.class, com.google.cloud.speech.v1.ListCustomClassesResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.ListCustomClassesResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getCustomClassesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (customClassesBuilder_ == null) { - customClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - customClassesBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListCustomClassesResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListCustomClassesResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1.ListCustomClassesResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListCustomClassesResponse build() { - com.google.cloud.speech.v1.ListCustomClassesResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListCustomClassesResponse buildPartial() { - com.google.cloud.speech.v1.ListCustomClassesResponse result = new com.google.cloud.speech.v1.ListCustomClassesResponse(this); - int from_bitField0_ = bitField0_; - if (customClassesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - customClasses_ = java.util.Collections.unmodifiableList(customClasses_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.customClasses_ = customClasses_; - } else { - result.customClasses_ = customClassesBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.ListCustomClassesResponse) { - return mergeFrom((com.google.cloud.speech.v1.ListCustomClassesResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.ListCustomClassesResponse other) { - if (other == com.google.cloud.speech.v1.ListCustomClassesResponse.getDefaultInstance()) return this; - if (customClassesBuilder_ == null) { - if (!other.customClasses_.isEmpty()) { - if (customClasses_.isEmpty()) { - customClasses_ = other.customClasses_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCustomClassesIsMutable(); - customClasses_.addAll(other.customClasses_); - } - onChanged(); - } - } else { - if (!other.customClasses_.isEmpty()) { - if (customClassesBuilder_.isEmpty()) { - customClassesBuilder_.dispose(); - customClassesBuilder_ = null; - customClasses_ = other.customClasses_; - bitField0_ = (bitField0_ & ~0x00000001); - customClassesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getCustomClassesFieldBuilder() : null; - } else { - customClassesBuilder_.addAllMessages(other.customClasses_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.ListCustomClassesResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.ListCustomClassesResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List customClasses_ = - java.util.Collections.emptyList(); - private void ensureCustomClassesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - customClasses_ = new java.util.ArrayList(customClasses_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> customClassesBuilder_; - - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public java.util.List getCustomClassesList() { - if (customClassesBuilder_ == null) { - return java.util.Collections.unmodifiableList(customClasses_); - } else { - return customClassesBuilder_.getMessageList(); - } - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public int getCustomClassesCount() { - if (customClassesBuilder_ == null) { - return customClasses_.size(); - } else { - return customClassesBuilder_.getCount(); - } - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public com.google.cloud.speech.v1.CustomClass getCustomClasses(int index) { - if (customClassesBuilder_ == null) { - return customClasses_.get(index); - } else { - return customClassesBuilder_.getMessage(index); - } - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public Builder setCustomClasses( - int index, com.google.cloud.speech.v1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.set(index, value); - onChanged(); - } else { - customClassesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public Builder setCustomClasses( - int index, com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.set(index, builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public Builder addCustomClasses(com.google.cloud.speech.v1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.add(value); - onChanged(); - } else { - customClassesBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public Builder addCustomClasses( - int index, com.google.cloud.speech.v1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.add(index, value); - onChanged(); - } else { - customClassesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public Builder addCustomClasses( - com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.add(builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public Builder addCustomClasses( - int index, com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.add(index, builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public Builder addAllCustomClasses( - java.lang.Iterable values) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, customClasses_); - onChanged(); - } else { - customClassesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public Builder clearCustomClasses() { - if (customClassesBuilder_ == null) { - customClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - customClassesBuilder_.clear(); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public Builder removeCustomClasses(int index) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.remove(index); - onChanged(); - } else { - customClassesBuilder_.remove(index); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public com.google.cloud.speech.v1.CustomClass.Builder getCustomClassesBuilder( - int index) { - return getCustomClassesFieldBuilder().getBuilder(index); - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index) { - if (customClassesBuilder_ == null) { - return customClasses_.get(index); } else { - return customClassesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public java.util.List - getCustomClassesOrBuilderList() { - if (customClassesBuilder_ != null) { - return customClassesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(customClasses_); - } - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public com.google.cloud.speech.v1.CustomClass.Builder addCustomClassesBuilder() { - return getCustomClassesFieldBuilder().addBuilder( - com.google.cloud.speech.v1.CustomClass.getDefaultInstance()); - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public com.google.cloud.speech.v1.CustomClass.Builder addCustomClassesBuilder( - int index) { - return getCustomClassesFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.CustomClass.getDefaultInstance()); - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - public java.util.List - getCustomClassesBuilderList() { - return getCustomClassesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> - getCustomClassesFieldBuilder() { - if (customClassesBuilder_ == null) { - customClassesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder>( - customClasses_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - customClasses_ = null; - } - return customClassesBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.ListCustomClassesResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.ListCustomClassesResponse) - private static final com.google.cloud.speech.v1.ListCustomClassesResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.ListCustomClassesResponse(); - } - - public static com.google.cloud.speech.v1.ListCustomClassesResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListCustomClassesResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListCustomClassesResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListCustomClassesResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponseOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponseOrBuilder.java deleted file mode 100644 index 59b5c44f8cf4..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListCustomClassesResponseOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public interface ListCustomClassesResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.ListCustomClassesResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - java.util.List - getCustomClassesList(); - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - com.google.cloud.speech.v1.CustomClass getCustomClasses(int index); - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - int getCustomClassesCount(); - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - java.util.List - getCustomClassesOrBuilderList(); - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 1; - */ - com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index); - - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequest.java deleted file mode 100644 index e574eaab8aa9..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequest.java +++ /dev/null @@ -1,916 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Message sent by the client for the `ListPhraseSet` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.ListPhraseSetRequest} - */ -public final class ListPhraseSetRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.ListPhraseSetRequest) - ListPhraseSetRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListPhraseSetRequest.newBuilder() to construct. - private ListPhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListPhraseSetRequest() { - parent_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListPhraseSetRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListPhraseSetRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 16: { - - pageSize_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.ListPhraseSetRequest.class, com.google.cloud.speech.v1.ListPhraseSetRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - *
-   * Required. The parent, which owns this collection of phrase set. Format:
-   * `projects/{project}/locations/{location}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - *
-   * Required. The parent, which owns this collection of phrase set. Format:
-   * `projects/{project}/locations/{location}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; - /** - *
-   * The maximum number of phrase sets to return. The service may return
-   * fewer than this value. If unspecified, at most 50 phrase sets will be
-   * returned. The maximum value is 1000; values above 1000 will be coerced to
-   * 1000.
-   * 
- * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - *
-   * A page token, received from a previous `ListPhraseSet` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListPhraseSet` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - *
-   * A page token, received from a previous `ListPhraseSet` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListPhraseSet` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.ListPhraseSetRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.ListPhraseSetRequest other = (com.google.cloud.speech.v1.ListPhraseSetRequest) obj; - - if (!getParent() - .equals(other.getParent())) return false; - if (getPageSize() - != other.getPageSize()) return false; - if (!getPageToken() - .equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListPhraseSetRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.ListPhraseSetRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.ListPhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.ListPhraseSetRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `ListPhraseSet` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.ListPhraseSetRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.ListPhraseSetRequest) - com.google.cloud.speech.v1.ListPhraseSetRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.ListPhraseSetRequest.class, com.google.cloud.speech.v1.ListPhraseSetRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.ListPhraseSetRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListPhraseSetRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.ListPhraseSetRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListPhraseSetRequest build() { - com.google.cloud.speech.v1.ListPhraseSetRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListPhraseSetRequest buildPartial() { - com.google.cloud.speech.v1.ListPhraseSetRequest result = new com.google.cloud.speech.v1.ListPhraseSetRequest(this); - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.ListPhraseSetRequest) { - return mergeFrom((com.google.cloud.speech.v1.ListPhraseSetRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.ListPhraseSetRequest other) { - if (other == com.google.cloud.speech.v1.ListPhraseSetRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.ListPhraseSetRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.ListPhraseSetRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
-     * Required. The parent, which owns this collection of phrase set. Format:
-     * `projects/{project}/locations/{location}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The parent, which owns this collection of phrase set. Format:
-     * `projects/{project}/locations/{location}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The parent, which owns this collection of phrase set. Format:
-     * `projects/{project}/locations/{location}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The parent, which owns this collection of phrase set. Format:
-     * `projects/{project}/locations/{location}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
-     * Required. The parent, which owns this collection of phrase set. Format:
-     * `projects/{project}/locations/{location}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private int pageSize_ ; - /** - *
-     * The maximum number of phrase sets to return. The service may return
-     * fewer than this value. If unspecified, at most 50 phrase sets will be
-     * returned. The maximum value is 1000; values above 1000 will be coerced to
-     * 1000.
-     * 
- * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - *
-     * The maximum number of phrase sets to return. The service may return
-     * fewer than this value. If unspecified, at most 50 phrase sets will be
-     * returned. The maximum value is 1000; values above 1000 will be coerced to
-     * 1000.
-     * 
- * - * int32 page_size = 2; - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - *
-     * The maximum number of phrase sets to return. The service may return
-     * fewer than this value. If unspecified, at most 50 phrase sets will be
-     * returned. The maximum value is 1000; values above 1000 will be coerced to
-     * 1000.
-     * 
- * - * int32 page_size = 2; - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - *
-     * A page token, received from a previous `ListPhraseSet` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListPhraseSet` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * A page token, received from a previous `ListPhraseSet` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListPhraseSet` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * A page token, received from a previous `ListPhraseSet` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListPhraseSet` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - *
-     * A page token, received from a previous `ListPhraseSet` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListPhraseSet` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - *
-     * A page token, received from a previous `ListPhraseSet` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListPhraseSet` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.ListPhraseSetRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.ListPhraseSetRequest) - private static final com.google.cloud.speech.v1.ListPhraseSetRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.ListPhraseSetRequest(); - } - - public static com.google.cloud.speech.v1.ListPhraseSetRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListPhraseSetRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListPhraseSetRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListPhraseSetRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequestOrBuilder.java deleted file mode 100644 index 0077943458ba..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetRequestOrBuilder.java +++ /dev/null @@ -1,80 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public interface ListPhraseSetRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.ListPhraseSetRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The parent, which owns this collection of phrase set. Format:
-   * `projects/{project}/locations/{location}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
-   * Required. The parent, which owns this collection of phrase set. Format:
-   * `projects/{project}/locations/{location}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - - /** - *
-   * The maximum number of phrase sets to return. The service may return
-   * fewer than this value. If unspecified, at most 50 phrase sets will be
-   * returned. The maximum value is 1000; values above 1000 will be coerced to
-   * 1000.
-   * 
- * - * int32 page_size = 2; - * @return The pageSize. - */ - int getPageSize(); - - /** - *
-   * A page token, received from a previous `ListPhraseSet` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListPhraseSet` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - *
-   * A page token, received from a previous `ListPhraseSet` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListPhraseSet` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponse.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponse.java deleted file mode 100644 index e03484719a02..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponse.java +++ /dev/null @@ -1,1045 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Message returned to the client by the `ListPhraseSet` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.ListPhraseSetResponse} - */ -public final class ListPhraseSetResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.ListPhraseSetResponse) - ListPhraseSetResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListPhraseSetResponse.newBuilder() to construct. - private ListPhraseSetResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListPhraseSetResponse() { - phraseSets_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListPhraseSetResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListPhraseSetResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - phraseSets_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phraseSets_.add( - input.readMessage(com.google.cloud.speech.v1.PhraseSet.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.ListPhraseSetResponse.class, com.google.cloud.speech.v1.ListPhraseSetResponse.Builder.class); - } - - public static final int PHRASE_SETS_FIELD_NUMBER = 1; - private java.util.List phraseSets_; - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public java.util.List getPhraseSetsList() { - return phraseSets_; - } - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public java.util.List - getPhraseSetsOrBuilderList() { - return phraseSets_; - } - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public int getPhraseSetsCount() { - return phraseSets_.size(); - } - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet getPhraseSets(int index) { - return phraseSets_.get(index); - } - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetsOrBuilder( - int index) { - return phraseSets_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < phraseSets_.size(); i++) { - output.writeMessage(1, phraseSets_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < phraseSets_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, phraseSets_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.ListPhraseSetResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.ListPhraseSetResponse other = (com.google.cloud.speech.v1.ListPhraseSetResponse) obj; - - if (!getPhraseSetsList() - .equals(other.getPhraseSetsList())) return false; - if (!getNextPageToken() - .equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPhraseSetsCount() > 0) { - hash = (37 * hash) + PHRASE_SETS_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSetsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListPhraseSetResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.ListPhraseSetResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.ListPhraseSetResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.ListPhraseSetResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message returned to the client by the `ListPhraseSet` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.ListPhraseSetResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.ListPhraseSetResponse) - com.google.cloud.speech.v1.ListPhraseSetResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.ListPhraseSetResponse.class, com.google.cloud.speech.v1.ListPhraseSetResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.ListPhraseSetResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getPhraseSetsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (phraseSetsBuilder_ == null) { - phraseSets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - phraseSetsBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_ListPhraseSetResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListPhraseSetResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1.ListPhraseSetResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListPhraseSetResponse build() { - com.google.cloud.speech.v1.ListPhraseSetResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListPhraseSetResponse buildPartial() { - com.google.cloud.speech.v1.ListPhraseSetResponse result = new com.google.cloud.speech.v1.ListPhraseSetResponse(this); - int from_bitField0_ = bitField0_; - if (phraseSetsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phraseSets_ = phraseSets_; - } else { - result.phraseSets_ = phraseSetsBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.ListPhraseSetResponse) { - return mergeFrom((com.google.cloud.speech.v1.ListPhraseSetResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.ListPhraseSetResponse other) { - if (other == com.google.cloud.speech.v1.ListPhraseSetResponse.getDefaultInstance()) return this; - if (phraseSetsBuilder_ == null) { - if (!other.phraseSets_.isEmpty()) { - if (phraseSets_.isEmpty()) { - phraseSets_ = other.phraseSets_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhraseSetsIsMutable(); - phraseSets_.addAll(other.phraseSets_); - } - onChanged(); - } - } else { - if (!other.phraseSets_.isEmpty()) { - if (phraseSetsBuilder_.isEmpty()) { - phraseSetsBuilder_.dispose(); - phraseSetsBuilder_ = null; - phraseSets_ = other.phraseSets_; - bitField0_ = (bitField0_ & ~0x00000001); - phraseSetsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPhraseSetsFieldBuilder() : null; - } else { - phraseSetsBuilder_.addAllMessages(other.phraseSets_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.ListPhraseSetResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.ListPhraseSetResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List phraseSets_ = - java.util.Collections.emptyList(); - private void ensurePhraseSetsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - phraseSets_ = new java.util.ArrayList(phraseSets_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> phraseSetsBuilder_; - - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public java.util.List getPhraseSetsList() { - if (phraseSetsBuilder_ == null) { - return java.util.Collections.unmodifiableList(phraseSets_); - } else { - return phraseSetsBuilder_.getMessageList(); - } - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public int getPhraseSetsCount() { - if (phraseSetsBuilder_ == null) { - return phraseSets_.size(); - } else { - return phraseSetsBuilder_.getCount(); - } - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1.PhraseSet getPhraseSets(int index) { - if (phraseSetsBuilder_ == null) { - return phraseSets_.get(index); - } else { - return phraseSetsBuilder_.getMessage(index); - } - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder setPhraseSets( - int index, com.google.cloud.speech.v1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.set(index, value); - onChanged(); - } else { - phraseSetsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder setPhraseSets( - int index, com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.set(index, builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets(com.google.cloud.speech.v1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.add(value); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - int index, com.google.cloud.speech.v1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.add(index, value); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.add(builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - int index, com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.add(index, builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder addAllPhraseSets( - java.lang.Iterable values) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, phraseSets_); - onChanged(); - } else { - phraseSetsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder clearPhraseSets() { - if (phraseSetsBuilder_ == null) { - phraseSets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - phraseSetsBuilder_.clear(); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder removePhraseSets(int index) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.remove(index); - onChanged(); - } else { - phraseSetsBuilder_.remove(index); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1.PhraseSet.Builder getPhraseSetsBuilder( - int index) { - return getPhraseSetsFieldBuilder().getBuilder(index); - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetsOrBuilder( - int index) { - if (phraseSetsBuilder_ == null) { - return phraseSets_.get(index); } else { - return phraseSetsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public java.util.List - getPhraseSetsOrBuilderList() { - if (phraseSetsBuilder_ != null) { - return phraseSetsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(phraseSets_); - } - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1.PhraseSet.Builder addPhraseSetsBuilder() { - return getPhraseSetsFieldBuilder().addBuilder( - com.google.cloud.speech.v1.PhraseSet.getDefaultInstance()); - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1.PhraseSet.Builder addPhraseSetsBuilder( - int index) { - return getPhraseSetsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.PhraseSet.getDefaultInstance()); - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public java.util.List - getPhraseSetsBuilderList() { - return getPhraseSetsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> - getPhraseSetsFieldBuilder() { - if (phraseSetsBuilder_ == null) { - phraseSetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder>( - phraseSets_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - phraseSets_ = null; - } - return phraseSetsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.ListPhraseSetResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.ListPhraseSetResponse) - private static final com.google.cloud.speech.v1.ListPhraseSetResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.ListPhraseSetResponse(); - } - - public static com.google.cloud.speech.v1.ListPhraseSetResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListPhraseSetResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListPhraseSetResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.ListPhraseSetResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponseOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponseOrBuilder.java deleted file mode 100644 index 8f78e4160d41..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/ListPhraseSetResponseOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public interface ListPhraseSetResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.ListPhraseSetResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - java.util.List - getPhraseSetsList(); - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - com.google.cloud.speech.v1.PhraseSet getPhraseSets(int index); - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - int getPhraseSetsCount(); - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - java.util.List - getPhraseSetsOrBuilderList(); - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetsOrBuilder( - int index); - - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LocationName.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LocationName.java deleted file mode 100644 index 3c3cf94f255a..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LocationName.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class LocationName implements ResourceName { - private static final PathTemplate PROJECT_LOCATION = - PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); - private volatile Map fieldValuesMap; - private final String project; - private final String location; - - @Deprecated - protected LocationName() { - project = null; - location = null; - } - - private LocationName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - } - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static LocationName of(String project, String location) { - return newBuilder().setProject(project).setLocation(location).build(); - } - - public static String format(String project, String location) { - return newBuilder().setProject(project).setLocation(location).build().toString(); - } - - public static LocationName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_LOCATION.validatedMatch( - formattedString, "LocationName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("location")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (LocationName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (location != null) { - fieldMapBuilder.put("location", location); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_LOCATION.instantiate("project", project, "location", location); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - LocationName that = ((LocationName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.location, that.location); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - return h; - } - - /** Builder for projects/{project}/locations/{location}. */ - public static class Builder { - private String project; - private String location; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - private Builder(LocationName locationName) { - this.project = locationName.project; - this.location = locationName.location; - } - - public LocationName build() { - return new LocationName(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadata.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadata.java deleted file mode 100644 index 6dec13323dd3..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadata.java +++ /dev/null @@ -1,1162 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Describes the progress of a long-running `LongRunningRecognize` call. It is
- * included in the `metadata` field of the `Operation` returned by the
- * `GetOperation` call of the `google::longrunning::Operations` service.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeMetadata} - */ -public final class LongRunningRecognizeMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.LongRunningRecognizeMetadata) - LongRunningRecognizeMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use LongRunningRecognizeMetadata.newBuilder() to construct. - private LongRunningRecognizeMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LongRunningRecognizeMetadata() { - uri_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new LongRunningRecognizeMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LongRunningRecognizeMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - progressPercent_ = input.readInt32(); - break; - } - case 18: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastUpdateTime_ != null) { - subBuilder = lastUpdateTime_.toBuilder(); - } - lastUpdateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastUpdateTime_); - lastUpdateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - uri_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.LongRunningRecognizeMetadata.class, com.google.cloud.speech.v1.LongRunningRecognizeMetadata.Builder.class); - } - - public static final int PROGRESS_PERCENT_FIELD_NUMBER = 1; - private int progressPercent_; - /** - *
-   * Approximate percentage of audio processed thus far. Guaranteed to be 100
-   * when the audio is fully processed and the results are available.
-   * 
- * - * int32 progress_percent = 1; - * @return The progressPercent. - */ - @java.lang.Override - public int getProgressPercent() { - return progressPercent_; - } - - public static final int START_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Timestamp startTime_; - /** - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * @return Whether the startTime field is set. - */ - @java.lang.Override - public boolean hasStartTime() { - return startTime_ != null; - } - /** - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * @return The startTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getStartTime() { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } - /** - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - return getStartTime(); - } - - public static final int LAST_UPDATE_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Timestamp lastUpdateTime_; - /** - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * @return Whether the lastUpdateTime field is set. - */ - @java.lang.Override - public boolean hasLastUpdateTime() { - return lastUpdateTime_ != null; - } - /** - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * @return The lastUpdateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getLastUpdateTime() { - return lastUpdateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lastUpdateTime_; - } - /** - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { - return getLastUpdateTime(); - } - - public static final int URI_FIELD_NUMBER = 4; - private volatile java.lang.Object uri_; - /** - *
-   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
-   * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The uri. - */ - @java.lang.Override - public java.lang.String getUri() { - java.lang.Object ref = uri_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uri_ = s; - return s; - } - } - /** - *
-   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
-   * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for uri. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUriBytes() { - java.lang.Object ref = uri_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uri_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (progressPercent_ != 0) { - output.writeInt32(1, progressPercent_); - } - if (startTime_ != null) { - output.writeMessage(2, getStartTime()); - } - if (lastUpdateTime_ != null) { - output.writeMessage(3, getLastUpdateTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, uri_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (progressPercent_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, progressPercent_); - } - if (startTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getStartTime()); - } - if (lastUpdateTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getLastUpdateTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, uri_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.LongRunningRecognizeMetadata)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.LongRunningRecognizeMetadata other = (com.google.cloud.speech.v1.LongRunningRecognizeMetadata) obj; - - if (getProgressPercent() - != other.getProgressPercent()) return false; - if (hasStartTime() != other.hasStartTime()) return false; - if (hasStartTime()) { - if (!getStartTime() - .equals(other.getStartTime())) return false; - } - if (hasLastUpdateTime() != other.hasLastUpdateTime()) return false; - if (hasLastUpdateTime()) { - if (!getLastUpdateTime() - .equals(other.getLastUpdateTime())) return false; - } - if (!getUri() - .equals(other.getUri())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PROGRESS_PERCENT_FIELD_NUMBER; - hash = (53 * hash) + getProgressPercent(); - if (hasStartTime()) { - hash = (37 * hash) + START_TIME_FIELD_NUMBER; - hash = (53 * hash) + getStartTime().hashCode(); - } - if (hasLastUpdateTime()) { - hash = (37 * hash) + LAST_UPDATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getLastUpdateTime().hashCode(); - } - hash = (37 * hash) + URI_FIELD_NUMBER; - hash = (53 * hash) + getUri().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.LongRunningRecognizeMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Describes the progress of a long-running `LongRunningRecognize` call. It is
-   * included in the `metadata` field of the `Operation` returned by the
-   * `GetOperation` call of the `google::longrunning::Operations` service.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.LongRunningRecognizeMetadata) - com.google.cloud.speech.v1.LongRunningRecognizeMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.LongRunningRecognizeMetadata.class, com.google.cloud.speech.v1.LongRunningRecognizeMetadata.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.LongRunningRecognizeMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - progressPercent_ = 0; - - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = null; - } else { - lastUpdateTime_ = null; - lastUpdateTimeBuilder_ = null; - } - uri_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeMetadata getDefaultInstanceForType() { - return com.google.cloud.speech.v1.LongRunningRecognizeMetadata.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeMetadata build() { - com.google.cloud.speech.v1.LongRunningRecognizeMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeMetadata buildPartial() { - com.google.cloud.speech.v1.LongRunningRecognizeMetadata result = new com.google.cloud.speech.v1.LongRunningRecognizeMetadata(this); - result.progressPercent_ = progressPercent_; - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (lastUpdateTimeBuilder_ == null) { - result.lastUpdateTime_ = lastUpdateTime_; - } else { - result.lastUpdateTime_ = lastUpdateTimeBuilder_.build(); - } - result.uri_ = uri_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.LongRunningRecognizeMetadata) { - return mergeFrom((com.google.cloud.speech.v1.LongRunningRecognizeMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.LongRunningRecognizeMetadata other) { - if (other == com.google.cloud.speech.v1.LongRunningRecognizeMetadata.getDefaultInstance()) return this; - if (other.getProgressPercent() != 0) { - setProgressPercent(other.getProgressPercent()); - } - if (other.hasStartTime()) { - mergeStartTime(other.getStartTime()); - } - if (other.hasLastUpdateTime()) { - mergeLastUpdateTime(other.getLastUpdateTime()); - } - if (!other.getUri().isEmpty()) { - uri_ = other.uri_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.LongRunningRecognizeMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.LongRunningRecognizeMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int progressPercent_ ; - /** - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - * @return The progressPercent. - */ - @java.lang.Override - public int getProgressPercent() { - return progressPercent_; - } - /** - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - * @param value The progressPercent to set. - * @return This builder for chaining. - */ - public Builder setProgressPercent(int value) { - - progressPercent_ = value; - onChanged(); - return this; - } - /** - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - * @return This builder for chaining. - */ - public Builder clearProgressPercent() { - - progressPercent_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp startTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - * @return Whether the startTime field is set. - */ - public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - * @return The startTime. - */ - public com.google.protobuf.Timestamp getStartTime() { - if (startTimeBuilder_ == null) { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } else { - return startTimeBuilder_.getMessage(); - } - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder setStartTime(com.google.protobuf.Timestamp value) { - if (startTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - startTime_ = value; - onChanged(); - } else { - startTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder setStartTime( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (startTimeBuilder_ == null) { - startTime_ = builderForValue.build(); - onChanged(); - } else { - startTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder mergeStartTime(com.google.protobuf.Timestamp value) { - if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); - } else { - startTime_ = value; - } - onChanged(); - } else { - startTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - - onChanged(); - return getStartTimeFieldBuilder().getBuilder(); - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - if (startTimeBuilder_ != null) { - return startTimeBuilder_.getMessageOrBuilder(); - } else { - return startTime_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getStartTimeFieldBuilder() { - if (startTimeBuilder_ == null) { - startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - getStartTime(), - getParentForChildren(), - isClean()); - startTime_ = null; - } - return startTimeBuilder_; - } - - private com.google.protobuf.Timestamp lastUpdateTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> lastUpdateTimeBuilder_; - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * @return Whether the lastUpdateTime field is set. - */ - public boolean hasLastUpdateTime() { - return lastUpdateTimeBuilder_ != null || lastUpdateTime_ != null; - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * @return The lastUpdateTime. - */ - public com.google.protobuf.Timestamp getLastUpdateTime() { - if (lastUpdateTimeBuilder_ == null) { - return lastUpdateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lastUpdateTime_; - } else { - return lastUpdateTimeBuilder_.getMessage(); - } - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder setLastUpdateTime(com.google.protobuf.Timestamp value) { - if (lastUpdateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - lastUpdateTime_ = value; - onChanged(); - } else { - lastUpdateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder setLastUpdateTime( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = builderForValue.build(); - onChanged(); - } else { - lastUpdateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder mergeLastUpdateTime(com.google.protobuf.Timestamp value) { - if (lastUpdateTimeBuilder_ == null) { - if (lastUpdateTime_ != null) { - lastUpdateTime_ = - com.google.protobuf.Timestamp.newBuilder(lastUpdateTime_).mergeFrom(value).buildPartial(); - } else { - lastUpdateTime_ = value; - } - onChanged(); - } else { - lastUpdateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder clearLastUpdateTime() { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = null; - onChanged(); - } else { - lastUpdateTime_ = null; - lastUpdateTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.Timestamp.Builder getLastUpdateTimeBuilder() { - - onChanged(); - return getLastUpdateTimeFieldBuilder().getBuilder(); - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { - if (lastUpdateTimeBuilder_ != null) { - return lastUpdateTimeBuilder_.getMessageOrBuilder(); - } else { - return lastUpdateTime_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : lastUpdateTime_; - } - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getLastUpdateTimeFieldBuilder() { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - getLastUpdateTime(), - getParentForChildren(), - isClean()); - lastUpdateTime_ = null; - } - return lastUpdateTimeBuilder_; - } - - private java.lang.Object uri_ = ""; - /** - *
-     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The uri. - */ - public java.lang.String getUri() { - java.lang.Object ref = uri_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uri_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for uri. - */ - public com.google.protobuf.ByteString - getUriBytes() { - java.lang.Object ref = uri_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uri_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The uri to set. - * @return This builder for chaining. - */ - public Builder setUri( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uri_ = value; - onChanged(); - return this; - } - /** - *
-     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return This builder for chaining. - */ - public Builder clearUri() { - - uri_ = getDefaultInstance().getUri(); - onChanged(); - return this; - } - /** - *
-     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The bytes for uri to set. - * @return This builder for chaining. - */ - public Builder setUriBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uri_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.LongRunningRecognizeMetadata) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.LongRunningRecognizeMetadata) - private static final com.google.cloud.speech.v1.LongRunningRecognizeMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.LongRunningRecognizeMetadata(); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LongRunningRecognizeMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LongRunningRecognizeMetadata(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadataOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadataOrBuilder.java deleted file mode 100644 index ccedbf890615..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeMetadataOrBuilder.java +++ /dev/null @@ -1,96 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface LongRunningRecognizeMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.LongRunningRecognizeMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Approximate percentage of audio processed thus far. Guaranteed to be 100
-   * when the audio is fully processed and the results are available.
-   * 
- * - * int32 progress_percent = 1; - * @return The progressPercent. - */ - int getProgressPercent(); - - /** - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * @return Whether the startTime field is set. - */ - boolean hasStartTime(); - /** - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * @return The startTime. - */ - com.google.protobuf.Timestamp getStartTime(); - /** - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); - - /** - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * @return Whether the lastUpdateTime field is set. - */ - boolean hasLastUpdateTime(); - /** - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * @return The lastUpdateTime. - */ - com.google.protobuf.Timestamp getLastUpdateTime(); - /** - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder(); - - /** - *
-   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
-   * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The uri. - */ - java.lang.String getUri(); - /** - *
-   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
-   * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for uri. - */ - com.google.protobuf.ByteString - getUriBytes(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequest.java deleted file mode 100644 index 76f44fd6ea4d..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequest.java +++ /dev/null @@ -1,1151 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * The top-level message sent by the client for the `LongRunningRecognize`
- * method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeRequest} - */ -public final class LongRunningRecognizeRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.LongRunningRecognizeRequest) - LongRunningRecognizeRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use LongRunningRecognizeRequest.newBuilder() to construct. - private LongRunningRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LongRunningRecognizeRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new LongRunningRecognizeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LongRunningRecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.cloud.speech.v1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = input.readMessage(com.google.cloud.speech.v1.RecognitionConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.cloud.speech.v1.RecognitionAudio.Builder subBuilder = null; - if (audio_ != null) { - subBuilder = audio_.toBuilder(); - } - audio_ = input.readMessage(com.google.cloud.speech.v1.RecognitionAudio.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(audio_); - audio_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - com.google.cloud.speech.v1.TranscriptOutputConfig.Builder subBuilder = null; - if (outputConfig_ != null) { - subBuilder = outputConfig_.toBuilder(); - } - outputConfig_ = input.readMessage(com.google.cloud.speech.v1.TranscriptOutputConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(outputConfig_); - outputConfig_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.LongRunningRecognizeRequest.class, com.google.cloud.speech.v1.LongRunningRecognizeRequest.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1.RecognitionConfig config_; - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig getConfig() { - return config_ == null ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; - } - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int AUDIO_FIELD_NUMBER = 2; - private com.google.cloud.speech.v1.RecognitionAudio audio_; - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the audio field is set. - */ - @java.lang.Override - public boolean hasAudio() { - return audio_ != null; - } - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The audio. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudio getAudio() { - return audio_ == null ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() : audio_; - } - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder() { - return getAudio(); - } - - public static final int OUTPUT_CONFIG_FIELD_NUMBER = 4; - private com.google.cloud.speech.v1.TranscriptOutputConfig outputConfig_; - /** - *
-   * Optional. Specifies an optional destination for the recognition results.
-   * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return Whether the outputConfig field is set. - */ - @java.lang.Override - public boolean hasOutputConfig() { - return outputConfig_ != null; - } - /** - *
-   * Optional. Specifies an optional destination for the recognition results.
-   * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return The outputConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig() { - return outputConfig_ == null ? com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } - /** - *
-   * Optional. Specifies an optional destination for the recognition results.
-   * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - @java.lang.Override - public com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { - return getOutputConfig(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (audio_ != null) { - output.writeMessage(2, getAudio()); - } - if (outputConfig_ != null) { - output.writeMessage(4, getOutputConfig()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getConfig()); - } - if (audio_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getAudio()); - } - if (outputConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getOutputConfig()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.LongRunningRecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.LongRunningRecognizeRequest other = (com.google.cloud.speech.v1.LongRunningRecognizeRequest) obj; - - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig() - .equals(other.getConfig())) return false; - } - if (hasAudio() != other.hasAudio()) return false; - if (hasAudio()) { - if (!getAudio() - .equals(other.getAudio())) return false; - } - if (hasOutputConfig() != other.hasOutputConfig()) return false; - if (hasOutputConfig()) { - if (!getOutputConfig() - .equals(other.getOutputConfig())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - if (hasAudio()) { - hash = (37 * hash) + AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getAudio().hashCode(); - } - if (hasOutputConfig()) { - hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getOutputConfig().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.LongRunningRecognizeRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * The top-level message sent by the client for the `LongRunningRecognize`
-   * method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.LongRunningRecognizeRequest) - com.google.cloud.speech.v1.LongRunningRecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.LongRunningRecognizeRequest.class, com.google.cloud.speech.v1.LongRunningRecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.LongRunningRecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - if (audioBuilder_ == null) { - audio_ = null; - } else { - audio_ = null; - audioBuilder_ = null; - } - if (outputConfigBuilder_ == null) { - outputConfig_ = null; - } else { - outputConfig_ = null; - outputConfigBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.LongRunningRecognizeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeRequest build() { - com.google.cloud.speech.v1.LongRunningRecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeRequest buildPartial() { - com.google.cloud.speech.v1.LongRunningRecognizeRequest result = new com.google.cloud.speech.v1.LongRunningRecognizeRequest(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - if (audioBuilder_ == null) { - result.audio_ = audio_; - } else { - result.audio_ = audioBuilder_.build(); - } - if (outputConfigBuilder_ == null) { - result.outputConfig_ = outputConfig_; - } else { - result.outputConfig_ = outputConfigBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.LongRunningRecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1.LongRunningRecognizeRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.LongRunningRecognizeRequest other) { - if (other == com.google.cloud.speech.v1.LongRunningRecognizeRequest.getDefaultInstance()) return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.hasAudio()) { - mergeAudio(other.getAudio()); - } - if (other.hasOutputConfig()) { - mergeOutputConfig(other.getOutputConfig()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.LongRunningRecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.LongRunningRecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1.RecognitionConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder> configBuilder_; - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - public com.google.cloud.speech.v1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setConfig(com.google.cloud.speech.v1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setConfig( - com.google.cloud.speech.v1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeConfig(com.google.cloud.speech.v1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1.RecognitionConfig.newBuilder(config_).mergeFrom(value).buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null ? - com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; - } - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder>( - getConfig(), - getParentForChildren(), - isClean()); - config_ = null; - } - return configBuilder_; - } - - private com.google.cloud.speech.v1.RecognitionAudio audio_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionAudio, com.google.cloud.speech.v1.RecognitionAudio.Builder, com.google.cloud.speech.v1.RecognitionAudioOrBuilder> audioBuilder_; - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the audio field is set. - */ - public boolean hasAudio() { - return audioBuilder_ != null || audio_ != null; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The audio. - */ - public com.google.cloud.speech.v1.RecognitionAudio getAudio() { - if (audioBuilder_ == null) { - return audio_ == null ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() : audio_; - } else { - return audioBuilder_.getMessage(); - } - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setAudio(com.google.cloud.speech.v1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - audio_ = value; - onChanged(); - } else { - audioBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setAudio( - com.google.cloud.speech.v1.RecognitionAudio.Builder builderForValue) { - if (audioBuilder_ == null) { - audio_ = builderForValue.build(); - onChanged(); - } else { - audioBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeAudio(com.google.cloud.speech.v1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (audio_ != null) { - audio_ = - com.google.cloud.speech.v1.RecognitionAudio.newBuilder(audio_).mergeFrom(value).buildPartial(); - } else { - audio_ = value; - } - onChanged(); - } else { - audioBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearAudio() { - if (audioBuilder_ == null) { - audio_ = null; - onChanged(); - } else { - audio_ = null; - audioBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.RecognitionAudio.Builder getAudioBuilder() { - - onChanged(); - return getAudioFieldBuilder().getBuilder(); - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder() { - if (audioBuilder_ != null) { - return audioBuilder_.getMessageOrBuilder(); - } else { - return audio_ == null ? - com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() : audio_; - } - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionAudio, com.google.cloud.speech.v1.RecognitionAudio.Builder, com.google.cloud.speech.v1.RecognitionAudioOrBuilder> - getAudioFieldBuilder() { - if (audioBuilder_ == null) { - audioBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionAudio, com.google.cloud.speech.v1.RecognitionAudio.Builder, com.google.cloud.speech.v1.RecognitionAudioOrBuilder>( - getAudio(), - getParentForChildren(), - isClean()); - audio_ = null; - } - return audioBuilder_; - } - - private com.google.cloud.speech.v1.TranscriptOutputConfig outputConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.TranscriptOutputConfig, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder> outputConfigBuilder_; - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return Whether the outputConfig field is set. - */ - public boolean hasOutputConfig() { - return outputConfigBuilder_ != null || outputConfig_ != null; - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return The outputConfig. - */ - public com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig() { - if (outputConfigBuilder_ == null) { - return outputConfig_ == null ? com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } else { - return outputConfigBuilder_.getMessage(); - } - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - public Builder setOutputConfig(com.google.cloud.speech.v1.TranscriptOutputConfig value) { - if (outputConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - outputConfig_ = value; - onChanged(); - } else { - outputConfigBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - public Builder setOutputConfig( - com.google.cloud.speech.v1.TranscriptOutputConfig.Builder builderForValue) { - if (outputConfigBuilder_ == null) { - outputConfig_ = builderForValue.build(); - onChanged(); - } else { - outputConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - public Builder mergeOutputConfig(com.google.cloud.speech.v1.TranscriptOutputConfig value) { - if (outputConfigBuilder_ == null) { - if (outputConfig_ != null) { - outputConfig_ = - com.google.cloud.speech.v1.TranscriptOutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); - } else { - outputConfig_ = value; - } - onChanged(); - } else { - outputConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - public Builder clearOutputConfig() { - if (outputConfigBuilder_ == null) { - outputConfig_ = null; - onChanged(); - } else { - outputConfig_ = null; - outputConfigBuilder_ = null; - } - - return this; - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - public com.google.cloud.speech.v1.TranscriptOutputConfig.Builder getOutputConfigBuilder() { - - onChanged(); - return getOutputConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - public com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { - if (outputConfigBuilder_ != null) { - return outputConfigBuilder_.getMessageOrBuilder(); - } else { - return outputConfig_ == null ? - com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.TranscriptOutputConfig, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder> - getOutputConfigFieldBuilder() { - if (outputConfigBuilder_ == null) { - outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.TranscriptOutputConfig, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder>( - getOutputConfig(), - getParentForChildren(), - isClean()); - outputConfig_ = null; - } - return outputConfigBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.LongRunningRecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.LongRunningRecognizeRequest) - private static final com.google.cloud.speech.v1.LongRunningRecognizeRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.LongRunningRecognizeRequest(); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LongRunningRecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LongRunningRecognizeRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequestOrBuilder.java deleted file mode 100644 index fe890f69a390..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeRequestOrBuilder.java +++ /dev/null @@ -1,93 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface LongRunningRecognizeRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.LongRunningRecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - com.google.cloud.speech.v1.RecognitionConfig getConfig(); - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the audio field is set. - */ - boolean hasAudio(); - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The audio. - */ - com.google.cloud.speech.v1.RecognitionAudio getAudio(); - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder(); - - /** - *
-   * Optional. Specifies an optional destination for the recognition results.
-   * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return Whether the outputConfig field is set. - */ - boolean hasOutputConfig(); - /** - *
-   * Optional. Specifies an optional destination for the recognition results.
-   * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return The outputConfig. - */ - com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig(); - /** - *
-   * Optional. Specifies an optional destination for the recognition results.
-   * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java deleted file mode 100644 index 4a952b510c81..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponse.java +++ /dev/null @@ -1,1611 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * The only message returned to the client by the `LongRunningRecognize` method.
- * It contains the result as zero or more sequential `SpeechRecognitionResult`
- * messages. It is included in the `result.response` field of the `Operation`
- * returned by the `GetOperation` call of the `google::longrunning::Operations`
- * service.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeResponse} - */ -public final class LongRunningRecognizeResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.LongRunningRecognizeResponse) - LongRunningRecognizeResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use LongRunningRecognizeResponse.newBuilder() to construct. - private LongRunningRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LongRunningRecognizeResponse() { - results_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new LongRunningRecognizeResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LongRunningRecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage(com.google.cloud.speech.v1.SpeechRecognitionResult.parser(), extensionRegistry)); - break; - } - case 26: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (totalBilledTime_ != null) { - subBuilder = totalBilledTime_.toBuilder(); - } - totalBilledTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(totalBilledTime_); - totalBilledTime_ = subBuilder.buildPartial(); - } - - break; - } - case 50: { - com.google.cloud.speech.v1.TranscriptOutputConfig.Builder subBuilder = null; - if (outputConfig_ != null) { - subBuilder = outputConfig_.toBuilder(); - } - outputConfig_ = input.readMessage(com.google.cloud.speech.v1.TranscriptOutputConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(outputConfig_); - outputConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 58: { - com.google.rpc.Status.Builder subBuilder = null; - if (outputError_ != null) { - subBuilder = outputError_.toBuilder(); - } - outputError_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(outputError_); - outputError_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.LongRunningRecognizeResponse.class, com.google.cloud.speech.v1.LongRunningRecognizeResponse.Builder.class); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List getResultsList() { - return results_; - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List - getResultsOrBuilderList() { - return results_; - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public int getResultsCount() { - return results_.size(); - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - public static final int TOTAL_BILLED_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Duration totalBilledTime_; - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return Whether the totalBilledTime field is set. - */ - @java.lang.Override - public boolean hasTotalBilledTime() { - return totalBilledTime_ != null; - } - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return The totalBilledTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getTotalBilledTime() { - return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { - return getTotalBilledTime(); - } - - public static final int OUTPUT_CONFIG_FIELD_NUMBER = 6; - private com.google.cloud.speech.v1.TranscriptOutputConfig outputConfig_; - /** - *
-   * Original output config if present in the request.
-   * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - * @return Whether the outputConfig field is set. - */ - @java.lang.Override - public boolean hasOutputConfig() { - return outputConfig_ != null; - } - /** - *
-   * Original output config if present in the request.
-   * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - * @return The outputConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig() { - return outputConfig_ == null ? com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } - /** - *
-   * Original output config if present in the request.
-   * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - */ - @java.lang.Override - public com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { - return getOutputConfig(); - } - - public static final int OUTPUT_ERROR_FIELD_NUMBER = 7; - private com.google.rpc.Status outputError_; - /** - *
-   * If the transcript output fails this field contains the relevant error.
-   * 
- * - * .google.rpc.Status output_error = 7; - * @return Whether the outputError field is set. - */ - @java.lang.Override - public boolean hasOutputError() { - return outputError_ != null; - } - /** - *
-   * If the transcript output fails this field contains the relevant error.
-   * 
- * - * .google.rpc.Status output_error = 7; - * @return The outputError. - */ - @java.lang.Override - public com.google.rpc.Status getOutputError() { - return outputError_ == null ? com.google.rpc.Status.getDefaultInstance() : outputError_; - } - /** - *
-   * If the transcript output fails this field contains the relevant error.
-   * 
- * - * .google.rpc.Status output_error = 7; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { - return getOutputError(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - if (totalBilledTime_ != null) { - output.writeMessage(3, getTotalBilledTime()); - } - if (outputConfig_ != null) { - output.writeMessage(6, getOutputConfig()); - } - if (outputError_ != null) { - output.writeMessage(7, getOutputError()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, results_.get(i)); - } - if (totalBilledTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getTotalBilledTime()); - } - if (outputConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getOutputConfig()); - } - if (outputError_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getOutputError()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.LongRunningRecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.LongRunningRecognizeResponse other = (com.google.cloud.speech.v1.LongRunningRecognizeResponse) obj; - - if (!getResultsList() - .equals(other.getResultsList())) return false; - if (hasTotalBilledTime() != other.hasTotalBilledTime()) return false; - if (hasTotalBilledTime()) { - if (!getTotalBilledTime() - .equals(other.getTotalBilledTime())) return false; - } - if (hasOutputConfig() != other.hasOutputConfig()) return false; - if (hasOutputConfig()) { - if (!getOutputConfig() - .equals(other.getOutputConfig())) return false; - } - if (hasOutputError() != other.hasOutputError()) return false; - if (hasOutputError()) { - if (!getOutputError() - .equals(other.getOutputError())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - if (hasTotalBilledTime()) { - hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; - hash = (53 * hash) + getTotalBilledTime().hashCode(); - } - if (hasOutputConfig()) { - hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getOutputConfig().hashCode(); - } - if (hasOutputError()) { - hash = (37 * hash) + OUTPUT_ERROR_FIELD_NUMBER; - hash = (53 * hash) + getOutputError().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.LongRunningRecognizeResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * The only message returned to the client by the `LongRunningRecognize` method.
-   * It contains the result as zero or more sequential `SpeechRecognitionResult`
-   * messages. It is included in the `result.response` field of the `Operation`
-   * returned by the `GetOperation` call of the `google::longrunning::Operations`
-   * service.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.LongRunningRecognizeResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.LongRunningRecognizeResponse) - com.google.cloud.speech.v1.LongRunningRecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.LongRunningRecognizeResponse.class, com.google.cloud.speech.v1.LongRunningRecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.LongRunningRecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = null; - } else { - totalBilledTime_ = null; - totalBilledTimeBuilder_ = null; - } - if (outputConfigBuilder_ == null) { - outputConfig_ = null; - } else { - outputConfig_ = null; - outputConfigBuilder_ = null; - } - if (outputErrorBuilder_ == null) { - outputError_ = null; - } else { - outputError_ = null; - outputErrorBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1.LongRunningRecognizeResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeResponse build() { - com.google.cloud.speech.v1.LongRunningRecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeResponse buildPartial() { - com.google.cloud.speech.v1.LongRunningRecognizeResponse result = new com.google.cloud.speech.v1.LongRunningRecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - if (totalBilledTimeBuilder_ == null) { - result.totalBilledTime_ = totalBilledTime_; - } else { - result.totalBilledTime_ = totalBilledTimeBuilder_.build(); - } - if (outputConfigBuilder_ == null) { - result.outputConfig_ = outputConfig_; - } else { - result.outputConfig_ = outputConfigBuilder_.build(); - } - if (outputErrorBuilder_ == null) { - result.outputError_ = outputError_; - } else { - result.outputError_ = outputErrorBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.LongRunningRecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1.LongRunningRecognizeResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.LongRunningRecognizeResponse other) { - if (other == com.google.cloud.speech.v1.LongRunningRecognizeResponse.getDefaultInstance()) return this; - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResultsFieldBuilder() : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - if (other.hasTotalBilledTime()) { - mergeTotalBilledTime(other.getTotalBilledTime()); - } - if (other.hasOutputConfig()) { - mergeOutputConfig(other.getOutputConfig()); - } - if (other.hasOutputError()) { - mergeOutputError(other.getOutputError()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.LongRunningRecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.LongRunningRecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List results_ = - java.util.Collections.emptyList(); - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = new java.util.ArrayList(results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionResult, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder> resultsBuilder_; - - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public java.util.List getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder().addBuilder( - com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionResult, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionResult, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder>( - results_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - results_ = null; - } - return resultsBuilder_; - } - - private com.google.protobuf.Duration totalBilledTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalBilledTimeBuilder_; - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return Whether the totalBilledTime field is set. - */ - public boolean hasTotalBilledTime() { - return totalBilledTimeBuilder_ != null || totalBilledTime_ != null; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return The totalBilledTime. - */ - public com.google.protobuf.Duration getTotalBilledTime() { - if (totalBilledTimeBuilder_ == null) { - return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } else { - return totalBilledTimeBuilder_.getMessage(); - } - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder setTotalBilledTime(com.google.protobuf.Duration value) { - if (totalBilledTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - totalBilledTime_ = value; - onChanged(); - } else { - totalBilledTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder setTotalBilledTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = builderForValue.build(); - onChanged(); - } else { - totalBilledTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder mergeTotalBilledTime(com.google.protobuf.Duration value) { - if (totalBilledTimeBuilder_ == null) { - if (totalBilledTime_ != null) { - totalBilledTime_ = - com.google.protobuf.Duration.newBuilder(totalBilledTime_).mergeFrom(value).buildPartial(); - } else { - totalBilledTime_ = value; - } - onChanged(); - } else { - totalBilledTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder clearTotalBilledTime() { - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = null; - onChanged(); - } else { - totalBilledTime_ = null; - totalBilledTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public com.google.protobuf.Duration.Builder getTotalBilledTimeBuilder() { - - onChanged(); - return getTotalBilledTimeFieldBuilder().getBuilder(); - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { - if (totalBilledTimeBuilder_ != null) { - return totalBilledTimeBuilder_.getMessageOrBuilder(); - } else { - return totalBilledTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getTotalBilledTimeFieldBuilder() { - if (totalBilledTimeBuilder_ == null) { - totalBilledTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getTotalBilledTime(), - getParentForChildren(), - isClean()); - totalBilledTime_ = null; - } - return totalBilledTimeBuilder_; - } - - private com.google.cloud.speech.v1.TranscriptOutputConfig outputConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.TranscriptOutputConfig, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder> outputConfigBuilder_; - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - * @return Whether the outputConfig field is set. - */ - public boolean hasOutputConfig() { - return outputConfigBuilder_ != null || outputConfig_ != null; - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - * @return The outputConfig. - */ - public com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig() { - if (outputConfigBuilder_ == null) { - return outputConfig_ == null ? com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } else { - return outputConfigBuilder_.getMessage(); - } - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - */ - public Builder setOutputConfig(com.google.cloud.speech.v1.TranscriptOutputConfig value) { - if (outputConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - outputConfig_ = value; - onChanged(); - } else { - outputConfigBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - */ - public Builder setOutputConfig( - com.google.cloud.speech.v1.TranscriptOutputConfig.Builder builderForValue) { - if (outputConfigBuilder_ == null) { - outputConfig_ = builderForValue.build(); - onChanged(); - } else { - outputConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - */ - public Builder mergeOutputConfig(com.google.cloud.speech.v1.TranscriptOutputConfig value) { - if (outputConfigBuilder_ == null) { - if (outputConfig_ != null) { - outputConfig_ = - com.google.cloud.speech.v1.TranscriptOutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); - } else { - outputConfig_ = value; - } - onChanged(); - } else { - outputConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - */ - public Builder clearOutputConfig() { - if (outputConfigBuilder_ == null) { - outputConfig_ = null; - onChanged(); - } else { - outputConfig_ = null; - outputConfigBuilder_ = null; - } - - return this; - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - */ - public com.google.cloud.speech.v1.TranscriptOutputConfig.Builder getOutputConfigBuilder() { - - onChanged(); - return getOutputConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - */ - public com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { - if (outputConfigBuilder_ != null) { - return outputConfigBuilder_.getMessageOrBuilder(); - } else { - return outputConfig_ == null ? - com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.TranscriptOutputConfig, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder> - getOutputConfigFieldBuilder() { - if (outputConfigBuilder_ == null) { - outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.TranscriptOutputConfig, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder>( - getOutputConfig(), - getParentForChildren(), - isClean()); - outputConfig_ = null; - } - return outputConfigBuilder_; - } - - private com.google.rpc.Status outputError_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> outputErrorBuilder_; - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - * @return Whether the outputError field is set. - */ - public boolean hasOutputError() { - return outputErrorBuilder_ != null || outputError_ != null; - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - * @return The outputError. - */ - public com.google.rpc.Status getOutputError() { - if (outputErrorBuilder_ == null) { - return outputError_ == null ? com.google.rpc.Status.getDefaultInstance() : outputError_; - } else { - return outputErrorBuilder_.getMessage(); - } - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - public Builder setOutputError(com.google.rpc.Status value) { - if (outputErrorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - outputError_ = value; - onChanged(); - } else { - outputErrorBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - public Builder setOutputError( - com.google.rpc.Status.Builder builderForValue) { - if (outputErrorBuilder_ == null) { - outputError_ = builderForValue.build(); - onChanged(); - } else { - outputErrorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - public Builder mergeOutputError(com.google.rpc.Status value) { - if (outputErrorBuilder_ == null) { - if (outputError_ != null) { - outputError_ = - com.google.rpc.Status.newBuilder(outputError_).mergeFrom(value).buildPartial(); - } else { - outputError_ = value; - } - onChanged(); - } else { - outputErrorBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - public Builder clearOutputError() { - if (outputErrorBuilder_ == null) { - outputError_ = null; - onChanged(); - } else { - outputError_ = null; - outputErrorBuilder_ = null; - } - - return this; - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - public com.google.rpc.Status.Builder getOutputErrorBuilder() { - - onChanged(); - return getOutputErrorFieldBuilder().getBuilder(); - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { - if (outputErrorBuilder_ != null) { - return outputErrorBuilder_.getMessageOrBuilder(); - } else { - return outputError_ == null ? - com.google.rpc.Status.getDefaultInstance() : outputError_; - } - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getOutputErrorFieldBuilder() { - if (outputErrorBuilder_ == null) { - outputErrorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( - getOutputError(), - getParentForChildren(), - isClean()); - outputError_ = null; - } - return outputErrorBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.LongRunningRecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.LongRunningRecognizeResponse) - private static final com.google.cloud.speech.v1.LongRunningRecognizeResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.LongRunningRecognizeResponse(); - } - - public static com.google.cloud.speech.v1.LongRunningRecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LongRunningRecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LongRunningRecognizeResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.LongRunningRecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java deleted file mode 100644 index 231d7ae91417..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/LongRunningRecognizeResponseOrBuilder.java +++ /dev/null @@ -1,139 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface LongRunningRecognizeResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.LongRunningRecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsList(); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - int getResultsCount(); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index); - - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return Whether the totalBilledTime field is set. - */ - boolean hasTotalBilledTime(); - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return The totalBilledTime. - */ - com.google.protobuf.Duration getTotalBilledTime(); - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); - - /** - *
-   * Original output config if present in the request.
-   * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - * @return Whether the outputConfig field is set. - */ - boolean hasOutputConfig(); - /** - *
-   * Original output config if present in the request.
-   * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - * @return The outputConfig. - */ - com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig(); - /** - *
-   * Original output config if present in the request.
-   * 
- * - * .google.cloud.speech.v1.TranscriptOutputConfig output_config = 6; - */ - com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder(); - - /** - *
-   * If the transcript output fails this field contains the relevant error.
-   * 
- * - * .google.rpc.Status output_error = 7; - * @return Whether the outputError field is set. - */ - boolean hasOutputError(); - /** - *
-   * If the transcript output fails this field contains the relevant error.
-   * 
- * - * .google.rpc.Status output_error = 7; - * @return The outputError. - */ - com.google.rpc.Status getOutputError(); - /** - *
-   * If the transcript output fails this field contains the relevant error.
-   * 
- * - * .google.rpc.Status output_error = 7; - */ - com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSet.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSet.java deleted file mode 100644 index 0ec604f92928..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSet.java +++ /dev/null @@ -1,1944 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/resource.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Provides "hints" to the speech recognizer to favor specific words and phrases
- * in the results.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.PhraseSet} - */ -public final class PhraseSet extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.PhraseSet) - PhraseSetOrBuilder { -private static final long serialVersionUID = 0L; - // Use PhraseSet.newBuilder() to construct. - private PhraseSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PhraseSet() { - name_ = ""; - phrases_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PhraseSet(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PhraseSet( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phrases_.add( - input.readMessage(com.google.cloud.speech.v1.PhraseSet.Phrase.parser(), extensionRegistry)); - break; - } - case 37: { - - boost_ = input.readFloat(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = java.util.Collections.unmodifiableList(phrases_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.PhraseSet.class, com.google.cloud.speech.v1.PhraseSet.Builder.class); - } - - public interface PhraseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.PhraseSet.Phrase) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * The phrase itself.
-     * 
- * - * string value = 1; - * @return The value. - */ - java.lang.String getValue(); - /** - *
-     * The phrase itself.
-     * 
- * - * string value = 1; - * @return The bytes for value. - */ - com.google.protobuf.ByteString - getValueBytes(); - - /** - *
-     * Hint Boost. Overrides the boost set at the phrase set level.
-     * Positive value will increase the probability that a specific phrase will
-     * be recognized over other similar sounding phrases. The higher the boost,
-     * the higher the chance of false positive recognition as well. Negative
-     * boost will simply be ignored. Though `boost` can accept a wide range of
-     * positive values, most use cases are best served
-     * with values between 0 and 20. We recommend using a binary search approach
-     * to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 2; - * @return The boost. - */ - float getBoost(); - } - /** - *
-   * A phrases containing words and phrase "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also include pre-built or custom classes containing groups
-   * of words that represent common concepts that occur in natural language. For
-   * example, rather than providing a phrase hint for every month of the
-   * year (e.g. "i was born in january", "i was born in febuary", ...), use the
-   * pre-built `$MONTH` class improves the likelihood of correctly transcribing
-   * audio that includes months (e.g. "i was born in $month").
-   * To refer to pre-built classes, use the class' symbol prepended with `$`
-   * e.g. `$MONTH`. To refer to custom classes that were defined inline in the
-   * request, set the class's `custom_class_id` to a string unique to all class
-   * resources and inline classes. Then use the class' id wrapped in $`{...}`
-   * e.g. "${my-months}". To refer to custom classes resources, use the class'
-   * id wrapped in `${}` (e.g. `${my-months}`).
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
-   * `eu` location value.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.PhraseSet.Phrase} - */ - public static final class Phrase extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.PhraseSet.Phrase) - PhraseOrBuilder { - private static final long serialVersionUID = 0L; - // Use Phrase.newBuilder() to construct. - private Phrase(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Phrase() { - value_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Phrase(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Phrase( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - value_ = s; - break; - } - case 21: { - - boost_ = input.readFloat(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_Phrase_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_Phrase_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.PhraseSet.Phrase.class, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private volatile java.lang.Object value_; - /** - *
-     * The phrase itself.
-     * 
- * - * string value = 1; - * @return The value. - */ - @java.lang.Override - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } - } - /** - *
-     * The phrase itself.
-     * 
- * - * string value = 1; - * @return The bytes for value. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BOOST_FIELD_NUMBER = 2; - private float boost_; - /** - *
-     * Hint Boost. Overrides the boost set at the phrase set level.
-     * Positive value will increase the probability that a specific phrase will
-     * be recognized over other similar sounding phrases. The higher the boost,
-     * the higher the chance of false positive recognition as well. Negative
-     * boost will simply be ignored. Though `boost` can accept a wide range of
-     * positive values, most use cases are best served
-     * with values between 0 and 20. We recommend using a binary search approach
-     * to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 2; - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); - } - if (java.lang.Float.floatToRawIntBits(boost_) != 0) { - output.writeFloat(2, boost_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); - } - if (java.lang.Float.floatToRawIntBits(boost_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(2, boost_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.PhraseSet.Phrase)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.PhraseSet.Phrase other = (com.google.cloud.speech.v1.PhraseSet.Phrase) obj; - - if (!getValue() - .equals(other.getValue())) return false; - if (java.lang.Float.floatToIntBits(getBoost()) - != java.lang.Float.floatToIntBits( - other.getBoost())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (37 * hash) + BOOST_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getBoost()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.PhraseSet.Phrase parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.PhraseSet.Phrase parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.PhraseSet.Phrase parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.PhraseSet.Phrase prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * A phrases containing words and phrase "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also include pre-built or custom classes containing groups
-     * of words that represent common concepts that occur in natural language. For
-     * example, rather than providing a phrase hint for every month of the
-     * year (e.g. "i was born in january", "i was born in febuary", ...), use the
-     * pre-built `$MONTH` class improves the likelihood of correctly transcribing
-     * audio that includes months (e.g. "i was born in $month").
-     * To refer to pre-built classes, use the class' symbol prepended with `$`
-     * e.g. `$MONTH`. To refer to custom classes that were defined inline in the
-     * request, set the class's `custom_class_id` to a string unique to all class
-     * resources and inline classes. Then use the class' id wrapped in $`{...}`
-     * e.g. "${my-months}". To refer to custom classes resources, use the class'
-     * id wrapped in `${}` (e.g. `${my-months}`).
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
-     * `eu` location value.
-     * 
- * - * Protobuf type {@code google.cloud.speech.v1.PhraseSet.Phrase} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.PhraseSet.Phrase) - com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_Phrase_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_Phrase_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.PhraseSet.Phrase.class, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.PhraseSet.Phrase.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - value_ = ""; - - boost_ = 0F; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_Phrase_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet.Phrase getDefaultInstanceForType() { - return com.google.cloud.speech.v1.PhraseSet.Phrase.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet.Phrase build() { - com.google.cloud.speech.v1.PhraseSet.Phrase result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet.Phrase buildPartial() { - com.google.cloud.speech.v1.PhraseSet.Phrase result = new com.google.cloud.speech.v1.PhraseSet.Phrase(this); - result.value_ = value_; - result.boost_ = boost_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.PhraseSet.Phrase) { - return mergeFrom((com.google.cloud.speech.v1.PhraseSet.Phrase)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.PhraseSet.Phrase other) { - if (other == com.google.cloud.speech.v1.PhraseSet.Phrase.getDefaultInstance()) return this; - if (!other.getValue().isEmpty()) { - value_ = other.value_; - onChanged(); - } - if (other.getBoost() != 0F) { - setBoost(other.getBoost()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.PhraseSet.Phrase parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.PhraseSet.Phrase) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object value_ = ""; - /** - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * @return The value. - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * @return The bytes for value. - */ - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - /** - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * @param value The bytes for value to set. - * @return This builder for chaining. - */ - public Builder setValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - value_ = value; - onChanged(); - return this; - } - - private float boost_ ; - /** - *
-       * Hint Boost. Overrides the boost set at the phrase set level.
-       * Positive value will increase the probability that a specific phrase will
-       * be recognized over other similar sounding phrases. The higher the boost,
-       * the higher the chance of false positive recognition as well. Negative
-       * boost will simply be ignored. Though `boost` can accept a wide range of
-       * positive values, most use cases are best served
-       * with values between 0 and 20. We recommend using a binary search approach
-       * to finding the optimal value for your use case. Speech recognition
-       * will skip PhraseSets with a boost value of 0.
-       * 
- * - * float boost = 2; - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - /** - *
-       * Hint Boost. Overrides the boost set at the phrase set level.
-       * Positive value will increase the probability that a specific phrase will
-       * be recognized over other similar sounding phrases. The higher the boost,
-       * the higher the chance of false positive recognition as well. Negative
-       * boost will simply be ignored. Though `boost` can accept a wide range of
-       * positive values, most use cases are best served
-       * with values between 0 and 20. We recommend using a binary search approach
-       * to finding the optimal value for your use case. Speech recognition
-       * will skip PhraseSets with a boost value of 0.
-       * 
- * - * float boost = 2; - * @param value The boost to set. - * @return This builder for chaining. - */ - public Builder setBoost(float value) { - - boost_ = value; - onChanged(); - return this; - } - /** - *
-       * Hint Boost. Overrides the boost set at the phrase set level.
-       * Positive value will increase the probability that a specific phrase will
-       * be recognized over other similar sounding phrases. The higher the boost,
-       * the higher the chance of false positive recognition as well. Negative
-       * boost will simply be ignored. Though `boost` can accept a wide range of
-       * positive values, most use cases are best served
-       * with values between 0 and 20. We recommend using a binary search approach
-       * to finding the optimal value for your use case. Speech recognition
-       * will skip PhraseSets with a boost value of 0.
-       * 
- * - * float boost = 2; - * @return This builder for chaining. - */ - public Builder clearBoost() { - - boost_ = 0F; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.PhraseSet.Phrase) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.PhraseSet.Phrase) - private static final com.google.cloud.speech.v1.PhraseSet.Phrase DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.PhraseSet.Phrase(); - } - - public static com.google.cloud.speech.v1.PhraseSet.Phrase getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Phrase parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Phrase(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet.Phrase getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * The resource name of the phrase set.
-   * 
- * - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * The resource name of the phrase set.
-   * 
- * - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PHRASES_FIELD_NUMBER = 2; - private java.util.List phrases_; - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public java.util.List getPhrasesList() { - return phrases_; - } - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public java.util.List - getPhrasesOrBuilderList() { - return phrases_; - } - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public int getPhrasesCount() { - return phrases_.size(); - } - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet.Phrase getPhrases(int index) { - return phrases_.get(index); - } - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( - int index) { - return phrases_.get(index); - } - - public static final int BOOST_FIELD_NUMBER = 4; - private float boost_; - /** - *
-   * Hint Boost. Positive value will increase the probability that a specific
-   * phrase will be recognized over other similar sounding phrases. The higher
-   * the boost, the higher the chance of false positive recognition as well.
-   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-   * enabled, so negative boost will simply be ignored. Though `boost` can
-   * accept a wide range of positive values, most use cases are best served with
-   * values between 0 (exclusive) and 20. We recommend using a binary search
-   * approach to finding the optimal value for your use case. Speech recognition
-   * will skip PhraseSets with a boost value of 0.
-   * 
- * - * float boost = 4; - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - for (int i = 0; i < phrases_.size(); i++) { - output.writeMessage(2, phrases_.get(i)); - } - if (java.lang.Float.floatToRawIntBits(boost_) != 0) { - output.writeFloat(4, boost_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - for (int i = 0; i < phrases_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, phrases_.get(i)); - } - if (java.lang.Float.floatToRawIntBits(boost_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(4, boost_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.PhraseSet)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.PhraseSet other = (com.google.cloud.speech.v1.PhraseSet) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getPhrasesList() - .equals(other.getPhrasesList())) return false; - if (java.lang.Float.floatToIntBits(getBoost()) - != java.lang.Float.floatToIntBits( - other.getBoost())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (getPhrasesCount() > 0) { - hash = (37 * hash) + PHRASES_FIELD_NUMBER; - hash = (53 * hash) + getPhrasesList().hashCode(); - } - hash = (37 * hash) + BOOST_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getBoost()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.PhraseSet parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.PhraseSet parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.PhraseSet parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.PhraseSet parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.PhraseSet parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.PhraseSet parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.PhraseSet parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.PhraseSet parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.PhraseSet parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.PhraseSet parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.PhraseSet parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.PhraseSet parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.PhraseSet prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Provides "hints" to the speech recognizer to favor specific words and phrases
-   * in the results.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.PhraseSet} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.PhraseSet) - com.google.cloud.speech.v1.PhraseSetOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.PhraseSet.class, com.google.cloud.speech.v1.PhraseSet.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.PhraseSet.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getPhrasesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (phrasesBuilder_ == null) { - phrases_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - phrasesBuilder_.clear(); - } - boost_ = 0F; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_PhraseSet_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet getDefaultInstanceForType() { - return com.google.cloud.speech.v1.PhraseSet.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet build() { - com.google.cloud.speech.v1.PhraseSet result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet buildPartial() { - com.google.cloud.speech.v1.PhraseSet result = new com.google.cloud.speech.v1.PhraseSet(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (phrasesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - phrases_ = java.util.Collections.unmodifiableList(phrases_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phrases_ = phrases_; - } else { - result.phrases_ = phrasesBuilder_.build(); - } - result.boost_ = boost_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.PhraseSet) { - return mergeFrom((com.google.cloud.speech.v1.PhraseSet)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.PhraseSet other) { - if (other == com.google.cloud.speech.v1.PhraseSet.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (phrasesBuilder_ == null) { - if (!other.phrases_.isEmpty()) { - if (phrases_.isEmpty()) { - phrases_ = other.phrases_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhrasesIsMutable(); - phrases_.addAll(other.phrases_); - } - onChanged(); - } - } else { - if (!other.phrases_.isEmpty()) { - if (phrasesBuilder_.isEmpty()) { - phrasesBuilder_.dispose(); - phrasesBuilder_ = null; - phrases_ = other.phrases_; - bitField0_ = (bitField0_ & ~0x00000001); - phrasesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPhrasesFieldBuilder() : null; - } else { - phrasesBuilder_.addAllMessages(other.phrases_); - } - } - } - if (other.getBoost() != 0F) { - setBoost(other.getBoost()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.PhraseSet parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.PhraseSet) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.util.List phrases_ = - java.util.Collections.emptyList(); - private void ensurePhrasesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - phrases_ = new java.util.ArrayList(phrases_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet.Phrase, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder, com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder> phrasesBuilder_; - - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public java.util.List getPhrasesList() { - if (phrasesBuilder_ == null) { - return java.util.Collections.unmodifiableList(phrases_); - } else { - return phrasesBuilder_.getMessageList(); - } - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public int getPhrasesCount() { - if (phrasesBuilder_ == null) { - return phrases_.size(); - } else { - return phrasesBuilder_.getCount(); - } - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1.PhraseSet.Phrase getPhrases(int index) { - if (phrasesBuilder_ == null) { - return phrases_.get(index); - } else { - return phrasesBuilder_.getMessage(index); - } - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public Builder setPhrases( - int index, com.google.cloud.speech.v1.PhraseSet.Phrase value) { - if (phrasesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.set(index, value); - onChanged(); - } else { - phrasesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public Builder setPhrases( - int index, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder builderForValue) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - phrases_.set(index, builderForValue.build()); - onChanged(); - } else { - phrasesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public Builder addPhrases(com.google.cloud.speech.v1.PhraseSet.Phrase value) { - if (phrasesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.add(value); - onChanged(); - } else { - phrasesBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public Builder addPhrases( - int index, com.google.cloud.speech.v1.PhraseSet.Phrase value) { - if (phrasesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.add(index, value); - onChanged(); - } else { - phrasesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public Builder addPhrases( - com.google.cloud.speech.v1.PhraseSet.Phrase.Builder builderForValue) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - phrases_.add(builderForValue.build()); - onChanged(); - } else { - phrasesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public Builder addPhrases( - int index, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder builderForValue) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - phrases_.add(index, builderForValue.build()); - onChanged(); - } else { - phrasesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public Builder addAllPhrases( - java.lang.Iterable values) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, phrases_); - onChanged(); - } else { - phrasesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public Builder clearPhrases() { - if (phrasesBuilder_ == null) { - phrases_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - phrasesBuilder_.clear(); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public Builder removePhrases(int index) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - phrases_.remove(index); - onChanged(); - } else { - phrasesBuilder_.remove(index); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1.PhraseSet.Phrase.Builder getPhrasesBuilder( - int index) { - return getPhrasesFieldBuilder().getBuilder(index); - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( - int index) { - if (phrasesBuilder_ == null) { - return phrases_.get(index); } else { - return phrasesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public java.util.List - getPhrasesOrBuilderList() { - if (phrasesBuilder_ != null) { - return phrasesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(phrases_); - } - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1.PhraseSet.Phrase.Builder addPhrasesBuilder() { - return getPhrasesFieldBuilder().addBuilder( - com.google.cloud.speech.v1.PhraseSet.Phrase.getDefaultInstance()); - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1.PhraseSet.Phrase.Builder addPhrasesBuilder( - int index) { - return getPhrasesFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.PhraseSet.Phrase.getDefaultInstance()); - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - public java.util.List - getPhrasesBuilderList() { - return getPhrasesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet.Phrase, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder, com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder> - getPhrasesFieldBuilder() { - if (phrasesBuilder_ == null) { - phrasesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet.Phrase, com.google.cloud.speech.v1.PhraseSet.Phrase.Builder, com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder>( - phrases_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - phrases_ = null; - } - return phrasesBuilder_; - } - - private float boost_ ; - /** - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 (exclusive) and 20. We recommend using a binary search
-     * approach to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 4; - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - /** - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 (exclusive) and 20. We recommend using a binary search
-     * approach to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 4; - * @param value The boost to set. - * @return This builder for chaining. - */ - public Builder setBoost(float value) { - - boost_ = value; - onChanged(); - return this; - } - /** - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 (exclusive) and 20. We recommend using a binary search
-     * approach to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 4; - * @return This builder for chaining. - */ - public Builder clearBoost() { - - boost_ = 0F; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.PhraseSet) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.PhraseSet) - private static final com.google.cloud.speech.v1.PhraseSet DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.PhraseSet(); - } - - public static com.google.cloud.speech.v1.PhraseSet getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PhraseSet parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PhraseSet(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetName.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetName.java deleted file mode 100644 index 99a8feeee073..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetName.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class PhraseSetName implements ResourceName { - private static final PathTemplate PROJECT_LOCATION_PHRASE_SET = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/phraseSets/{phrase_set}"); - private volatile Map fieldValuesMap; - private final String project; - private final String location; - private final String phraseSet; - - @Deprecated - protected PhraseSetName() { - project = null; - location = null; - phraseSet = null; - } - - private PhraseSetName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - phraseSet = Preconditions.checkNotNull(builder.getPhraseSet()); - } - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getPhraseSet() { - return phraseSet; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static PhraseSetName of(String project, String location, String phraseSet) { - return newBuilder().setProject(project).setLocation(location).setPhraseSet(phraseSet).build(); - } - - public static String format(String project, String location, String phraseSet) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setPhraseSet(phraseSet) - .build() - .toString(); - } - - public static PhraseSetName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_LOCATION_PHRASE_SET.validatedMatch( - formattedString, "PhraseSetName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("phrase_set")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (PhraseSetName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION_PHRASE_SET.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (location != null) { - fieldMapBuilder.put("location", location); - } - if (phraseSet != null) { - fieldMapBuilder.put("phrase_set", phraseSet); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_LOCATION_PHRASE_SET.instantiate( - "project", project, "location", location, "phrase_set", phraseSet); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - PhraseSetName that = ((PhraseSetName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.location, that.location) - && Objects.equals(this.phraseSet, that.phraseSet); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - h *= 1000003; - h ^= Objects.hashCode(phraseSet); - return h; - } - - /** Builder for projects/{project}/locations/{location}/phraseSets/{phrase_set}. */ - public static class Builder { - private String project; - private String location; - private String phraseSet; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getPhraseSet() { - return phraseSet; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - public Builder setPhraseSet(String phraseSet) { - this.phraseSet = phraseSet; - return this; - } - - private Builder(PhraseSetName phraseSetName) { - this.project = phraseSetName.project; - this.location = phraseSetName.location; - this.phraseSet = phraseSetName.phraseSet; - } - - public PhraseSetName build() { - return new PhraseSetName(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetOrBuilder.java deleted file mode 100644 index c57c3c5d692d..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/PhraseSetOrBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/resource.proto - -package com.google.cloud.speech.v1; - -public interface PhraseSetOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.PhraseSet) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The resource name of the phrase set.
-   * 
- * - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * The resource name of the phrase set.
-   * 
- * - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - java.util.List - getPhrasesList(); - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - com.google.cloud.speech.v1.PhraseSet.Phrase getPhrases(int index); - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - int getPhrasesCount(); - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - java.util.List - getPhrasesOrBuilderList(); - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet.Phrase phrases = 2; - */ - com.google.cloud.speech.v1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( - int index); - - /** - *
-   * Hint Boost. Positive value will increase the probability that a specific
-   * phrase will be recognized over other similar sounding phrases. The higher
-   * the boost, the higher the chance of false positive recognition as well.
-   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-   * enabled, so negative boost will simply be ignored. Though `boost` can
-   * accept a wide range of positive values, most use cases are best served with
-   * values between 0 (exclusive) and 20. We recommend using a binary search
-   * approach to finding the optimal value for your use case. Speech recognition
-   * will skip PhraseSets with a boost value of 0.
-   * 
- * - * float boost = 4; - * @return The boost. - */ - float getBoost(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudio.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudio.java deleted file mode 100644 index 13a01ffc4a4e..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudio.java +++ /dev/null @@ -1,906 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Contains audio data in the encoding specified in the `RecognitionConfig`.
- * Either `content` or `uri` must be supplied. Supplying both or neither
- * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
- * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognitionAudio} - */ -public final class RecognitionAudio extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognitionAudio) - RecognitionAudioOrBuilder { -private static final long serialVersionUID = 0L; - // Use RecognitionAudio.newBuilder() to construct. - private RecognitionAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RecognitionAudio() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RecognitionAudio(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RecognitionAudio( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - audioSource_ = input.readBytes(); - audioSourceCase_ = 1; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - audioSourceCase_ = 2; - audioSource_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionAudio_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionAudio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognitionAudio.class, com.google.cloud.speech.v1.RecognitionAudio.Builder.class); - } - - private int audioSourceCase_ = 0; - private java.lang.Object audioSource_; - public enum AudioSourceCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - CONTENT(1), - URI(2), - AUDIOSOURCE_NOT_SET(0); - private final int value; - private AudioSourceCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static AudioSourceCase valueOf(int value) { - return forNumber(value); - } - - public static AudioSourceCase forNumber(int value) { - switch (value) { - case 1: return CONTENT; - case 2: return URI; - case 0: return AUDIOSOURCE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public AudioSourceCase - getAudioSourceCase() { - return AudioSourceCase.forNumber( - audioSourceCase_); - } - - public static final int CONTENT_FIELD_NUMBER = 1; - /** - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - * @return Whether the content field is set. - */ - @java.lang.Override - public boolean hasContent() { - return audioSourceCase_ == 1; - } - /** - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - * @return The content. - */ - @java.lang.Override - public com.google.protobuf.ByteString getContent() { - if (audioSourceCase_ == 1) { - return (com.google.protobuf.ByteString) audioSource_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - public static final int URI_FIELD_NUMBER = 2; - /** - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * @return Whether the uri field is set. - */ - public boolean hasUri() { - return audioSourceCase_ == 2; - } - /** - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * @return The uri. - */ - public java.lang.String getUri() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (audioSourceCase_ == 2) { - audioSource_ = s; - } - return s; - } - } - /** - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * @return The bytes for uri. - */ - public com.google.protobuf.ByteString - getUriBytes() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (audioSourceCase_ == 2) { - audioSource_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (audioSourceCase_ == 1) { - output.writeBytes( - 1, (com.google.protobuf.ByteString) audioSource_); - } - if (audioSourceCase_ == 2) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, audioSource_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (audioSourceCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize( - 1, (com.google.protobuf.ByteString) audioSource_); - } - if (audioSourceCase_ == 2) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, audioSource_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.RecognitionAudio)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.RecognitionAudio other = (com.google.cloud.speech.v1.RecognitionAudio) obj; - - if (!getAudioSourceCase().equals(other.getAudioSourceCase())) return false; - switch (audioSourceCase_) { - case 1: - if (!getContent() - .equals(other.getContent())) return false; - break; - case 2: - if (!getUri() - .equals(other.getUri())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (audioSourceCase_) { - case 1: - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - break; - case 2: - hash = (37 * hash) + URI_FIELD_NUMBER; - hash = (53 * hash) + getUri().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionAudio parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionAudio parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionAudio parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognitionAudio parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognitionAudio parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.RecognitionAudio prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Contains audio data in the encoding specified in the `RecognitionConfig`.
-   * Either `content` or `uri` must be supplied. Supplying both or neither
-   * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognitionAudio} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognitionAudio) - com.google.cloud.speech.v1.RecognitionAudioOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionAudio_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionAudio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognitionAudio.class, com.google.cloud.speech.v1.RecognitionAudio.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.RecognitionAudio.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - audioSourceCase_ = 0; - audioSource_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionAudio_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudio getDefaultInstanceForType() { - return com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudio build() { - com.google.cloud.speech.v1.RecognitionAudio result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudio buildPartial() { - com.google.cloud.speech.v1.RecognitionAudio result = new com.google.cloud.speech.v1.RecognitionAudio(this); - if (audioSourceCase_ == 1) { - result.audioSource_ = audioSource_; - } - if (audioSourceCase_ == 2) { - result.audioSource_ = audioSource_; - } - result.audioSourceCase_ = audioSourceCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.RecognitionAudio) { - return mergeFrom((com.google.cloud.speech.v1.RecognitionAudio)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.RecognitionAudio other) { - if (other == com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance()) return this; - switch (other.getAudioSourceCase()) { - case CONTENT: { - setContent(other.getContent()); - break; - } - case URI: { - audioSourceCase_ = 2; - audioSource_ = other.audioSource_; - onChanged(); - break; - } - case AUDIOSOURCE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.RecognitionAudio parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.RecognitionAudio) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int audioSourceCase_ = 0; - private java.lang.Object audioSource_; - public AudioSourceCase - getAudioSourceCase() { - return AudioSourceCase.forNumber( - audioSourceCase_); - } - - public Builder clearAudioSource() { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - return this; - } - - - /** - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * @return Whether the content field is set. - */ - public boolean hasContent() { - return audioSourceCase_ == 1; - } - /** - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * @return The content. - */ - public com.google.protobuf.ByteString getContent() { - if (audioSourceCase_ == 1) { - return (com.google.protobuf.ByteString) audioSource_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - audioSourceCase_ = 1; - audioSource_ = value; - onChanged(); - return this; - } - /** - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * @return This builder for chaining. - */ - public Builder clearContent() { - if (audioSourceCase_ == 1) { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - } - return this; - } - - /** - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * @return Whether the uri field is set. - */ - @java.lang.Override - public boolean hasUri() { - return audioSourceCase_ == 2; - } - /** - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * @return The uri. - */ - @java.lang.Override - public java.lang.String getUri() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (audioSourceCase_ == 2) { - audioSource_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * @return The bytes for uri. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUriBytes() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (audioSourceCase_ == 2) { - audioSource_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * @param value The uri to set. - * @return This builder for chaining. - */ - public Builder setUri( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - audioSourceCase_ = 2; - audioSource_ = value; - onChanged(); - return this; - } - /** - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * @return This builder for chaining. - */ - public Builder clearUri() { - if (audioSourceCase_ == 2) { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - } - return this; - } - /** - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * @param value The bytes for uri to set. - * @return This builder for chaining. - */ - public Builder setUriBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - audioSourceCase_ = 2; - audioSource_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.RecognitionAudio) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionAudio) - private static final com.google.cloud.speech.v1.RecognitionAudio DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognitionAudio(); - } - - public static com.google.cloud.speech.v1.RecognitionAudio getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognitionAudio parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionAudio(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudio getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudioOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudioOrBuilder.java deleted file mode 100644 index 4347fb6f5a58..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionAudioOrBuilder.java +++ /dev/null @@ -1,81 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface RecognitionAudioOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognitionAudio) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - * @return Whether the content field is set. - */ - boolean hasContent(); - /** - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - * @return The content. - */ - com.google.protobuf.ByteString getContent(); - - /** - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * @return Whether the uri field is set. - */ - boolean hasUri(); - /** - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * @return The uri. - */ - java.lang.String getUri(); - /** - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * @return The bytes for uri. - */ - com.google.protobuf.ByteString - getUriBytes(); - - public com.google.cloud.speech.v1.RecognitionAudio.AudioSourceCase getAudioSourceCase(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java deleted file mode 100644 index 46cadf00f3e3..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfig.java +++ /dev/null @@ -1,4838 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Provides information to the recognizer that specifies how to process the
- * request.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognitionConfig} - */ -public final class RecognitionConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognitionConfig) - RecognitionConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use RecognitionConfig.newBuilder() to construct. - private RecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RecognitionConfig() { - encoding_ = 0; - languageCode_ = ""; - alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - speechContexts_ = java.util.Collections.emptyList(); - model_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RecognitionConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RecognitionConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - int rawValue = input.readEnum(); - - encoding_ = rawValue; - break; - } - case 16: { - - sampleRateHertz_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - languageCode_ = s; - break; - } - case 32: { - - maxAlternatives_ = input.readInt32(); - break; - } - case 40: { - - profanityFilter_ = input.readBool(); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - speechContexts_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - speechContexts_.add( - input.readMessage(com.google.cloud.speech.v1.SpeechContext.parser(), extensionRegistry)); - break; - } - case 56: { - - audioChannelCount_ = input.readInt32(); - break; - } - case 64: { - - enableWordTimeOffsets_ = input.readBool(); - break; - } - case 74: { - com.google.cloud.speech.v1.RecognitionMetadata.Builder subBuilder = null; - if (metadata_ != null) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = input.readMessage(com.google.cloud.speech.v1.RecognitionMetadata.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - - break; - } - case 88: { - - enableAutomaticPunctuation_ = input.readBool(); - break; - } - case 96: { - - enableSeparateRecognitionPerChannel_ = input.readBool(); - break; - } - case 106: { - java.lang.String s = input.readStringRequireUtf8(); - - model_ = s; - break; - } - case 112: { - - useEnhanced_ = input.readBool(); - break; - } - case 120: { - - enableWordConfidence_ = input.readBool(); - break; - } - case 146: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - alternativeLanguageCodes_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - alternativeLanguageCodes_.add(s); - break; - } - case 154: { - com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder subBuilder = null; - if (diarizationConfig_ != null) { - subBuilder = diarizationConfig_.toBuilder(); - } - diarizationConfig_ = input.readMessage(com.google.cloud.speech.v1.SpeakerDiarizationConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(diarizationConfig_); - diarizationConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 162: { - com.google.cloud.speech.v1.SpeechAdaptation.Builder subBuilder = null; - if (adaptation_ != null) { - subBuilder = adaptation_.toBuilder(); - } - adaptation_ = input.readMessage(com.google.cloud.speech.v1.SpeechAdaptation.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(adaptation_); - adaptation_ = subBuilder.buildPartial(); - } - - break; - } - case 178: { - com.google.protobuf.BoolValue.Builder subBuilder = null; - if (enableSpokenPunctuation_ != null) { - subBuilder = enableSpokenPunctuation_.toBuilder(); - } - enableSpokenPunctuation_ = input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(enableSpokenPunctuation_); - enableSpokenPunctuation_ = subBuilder.buildPartial(); - } - - break; - } - case 186: { - com.google.protobuf.BoolValue.Builder subBuilder = null; - if (enableSpokenEmojis_ != null) { - subBuilder = enableSpokenEmojis_.toBuilder(); - } - enableSpokenEmojis_ = input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(enableSpokenEmojis_); - enableSpokenEmojis_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); - } - if (((mutable_bitField0_ & 0x00000001) != 0)) { - alternativeLanguageCodes_ = alternativeLanguageCodes_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognitionConfig.class, com.google.cloud.speech.v1.RecognitionConfig.Builder.class); - } - - /** - *
-   * The encoding of the audio data sent in the request.
-   * All encodings support only 1 channel (mono) audio, unless the
-   * `audio_channel_count` and `enable_separate_recognition_per_channel` fields
-   * are set.
-   * For best results, the audio source should be captured and transmitted using
-   * a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
-   * recognition can be reduced if lossy codecs are used to capture or transmit
-   * audio, particularly if background noise is present. Lossy codecs include
-   * `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`,
-   * and `WEBM_OPUS`.
-   * The `FLAC` and `WAV` audio file formats include a header that describes the
-   * included audio content. You can request recognition for `WAV` files that
-   * contain either `LINEAR16` or `MULAW` encoded audio.
-   * If you send `FLAC` or `WAV` audio file format in
-   * your request, you do not need to specify an `AudioEncoding`; the audio
-   * encoding format is determined from the file header. If you specify
-   * an `AudioEncoding` when you send  send `FLAC` or `WAV` audio, the
-   * encoding configuration must match the encoding described in the audio
-   * header; otherwise the request returns an
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1.RecognitionConfig.AudioEncoding} - */ - public enum AudioEncoding - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * Not specified.
-     * 
- * - * ENCODING_UNSPECIFIED = 0; - */ - ENCODING_UNSPECIFIED(0), - /** - *
-     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
-     * 
- * - * LINEAR16 = 1; - */ - LINEAR16(1), - /** - *
-     * `FLAC` (Free Lossless Audio
-     * Codec) is the recommended encoding because it is
-     * lossless--therefore recognition is not compromised--and
-     * requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
-     * encoding supports 16-bit and 24-bit samples, however, not all fields in
-     * `STREAMINFO` are supported.
-     * 
- * - * FLAC = 2; - */ - FLAC(2), - /** - *
-     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
-     * 
- * - * MULAW = 3; - */ - MULAW(3), - /** - *
-     * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
-     * 
- * - * AMR = 4; - */ - AMR(4), - /** - *
-     * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
-     * 
- * - * AMR_WB = 5; - */ - AMR_WB(5), - /** - *
-     * Opus encoded audio frames in Ogg container
-     * ([OggOpus](https://wiki.xiph.org/OggOpus)).
-     * `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
-     * 
- * - * OGG_OPUS = 6; - */ - OGG_OPUS(6), - /** - *
-     * Although the use of lossy encodings is not recommended, if a very low
-     * bitrate encoding is required, `OGG_OPUS` is highly preferred over
-     * Speex encoding. The [Speex](https://speex.org/)  encoding supported by
-     * Cloud Speech API has a header byte in each block, as in MIME type
-     * `audio/x-speex-with-header-byte`.
-     * It is a variant of the RTP Speex encoding defined in
-     * [RFC 5574](https://tools.ietf.org/html/rfc5574).
-     * The stream is a sequence of blocks, one block per RTP packet. Each block
-     * starts with a byte containing the length of the block, in bytes, followed
-     * by one or more frames of Speex data, padded to an integral number of
-     * bytes (octets) as specified in RFC 5574. In other words, each RTP header
-     * is replaced with a single byte containing the block length. Only Speex
-     * wideband is supported. `sample_rate_hertz` must be 16000.
-     * 
- * - * SPEEX_WITH_HEADER_BYTE = 7; - */ - SPEEX_WITH_HEADER_BYTE(7), - /** - *
-     * Opus encoded audio frames in WebM container
-     * ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be
-     * one of 8000, 12000, 16000, 24000, or 48000.
-     * 
- * - * WEBM_OPUS = 9; - */ - WEBM_OPUS(9), - UNRECOGNIZED(-1), - ; - - /** - *
-     * Not specified.
-     * 
- * - * ENCODING_UNSPECIFIED = 0; - */ - public static final int ENCODING_UNSPECIFIED_VALUE = 0; - /** - *
-     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
-     * 
- * - * LINEAR16 = 1; - */ - public static final int LINEAR16_VALUE = 1; - /** - *
-     * `FLAC` (Free Lossless Audio
-     * Codec) is the recommended encoding because it is
-     * lossless--therefore recognition is not compromised--and
-     * requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
-     * encoding supports 16-bit and 24-bit samples, however, not all fields in
-     * `STREAMINFO` are supported.
-     * 
- * - * FLAC = 2; - */ - public static final int FLAC_VALUE = 2; - /** - *
-     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
-     * 
- * - * MULAW = 3; - */ - public static final int MULAW_VALUE = 3; - /** - *
-     * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
-     * 
- * - * AMR = 4; - */ - public static final int AMR_VALUE = 4; - /** - *
-     * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
-     * 
- * - * AMR_WB = 5; - */ - public static final int AMR_WB_VALUE = 5; - /** - *
-     * Opus encoded audio frames in Ogg container
-     * ([OggOpus](https://wiki.xiph.org/OggOpus)).
-     * `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
-     * 
- * - * OGG_OPUS = 6; - */ - public static final int OGG_OPUS_VALUE = 6; - /** - *
-     * Although the use of lossy encodings is not recommended, if a very low
-     * bitrate encoding is required, `OGG_OPUS` is highly preferred over
-     * Speex encoding. The [Speex](https://speex.org/)  encoding supported by
-     * Cloud Speech API has a header byte in each block, as in MIME type
-     * `audio/x-speex-with-header-byte`.
-     * It is a variant of the RTP Speex encoding defined in
-     * [RFC 5574](https://tools.ietf.org/html/rfc5574).
-     * The stream is a sequence of blocks, one block per RTP packet. Each block
-     * starts with a byte containing the length of the block, in bytes, followed
-     * by one or more frames of Speex data, padded to an integral number of
-     * bytes (octets) as specified in RFC 5574. In other words, each RTP header
-     * is replaced with a single byte containing the block length. Only Speex
-     * wideband is supported. `sample_rate_hertz` must be 16000.
-     * 
- * - * SPEEX_WITH_HEADER_BYTE = 7; - */ - public static final int SPEEX_WITH_HEADER_BYTE_VALUE = 7; - /** - *
-     * Opus encoded audio frames in WebM container
-     * ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be
-     * one of 8000, 12000, 16000, 24000, or 48000.
-     * 
- * - * WEBM_OPUS = 9; - */ - public static final int WEBM_OPUS_VALUE = 9; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static AudioEncoding valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static AudioEncoding forNumber(int value) { - switch (value) { - case 0: return ENCODING_UNSPECIFIED; - case 1: return LINEAR16; - case 2: return FLAC; - case 3: return MULAW; - case 4: return AMR; - case 5: return AMR_WB; - case 6: return OGG_OPUS; - case 7: return SPEEX_WITH_HEADER_BYTE; - case 9: return WEBM_OPUS; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - AudioEncoding> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public AudioEncoding findValueByNumber(int number) { - return AudioEncoding.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.cloud.speech.v1.RecognitionConfig.getDescriptor().getEnumTypes().get(0); - } - - private static final AudioEncoding[] VALUES = values(); - - public static AudioEncoding valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private AudioEncoding(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionConfig.AudioEncoding) - } - - public static final int ENCODING_FIELD_NUMBER = 1; - private int encoding_; - /** - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * @return The enum numeric value on the wire for encoding. - */ - @java.lang.Override public int getEncodingValue() { - return encoding_; - } - /** - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * @return The encoding. - */ - @java.lang.Override public com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding getEncoding() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding result = com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.valueOf(encoding_); - return result == null ? com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.UNRECOGNIZED : result; - } - - public static final int SAMPLE_RATE_HERTZ_FIELD_NUMBER = 2; - private int sampleRateHertz_; - /** - *
-   * Sample rate in Hertz of the audio data sent in all
-   * `RecognitionAudio` messages. Valid values are: 8000-48000.
-   * 16000 is optimal. For best results, set the sampling rate of the audio
-   * source to 16000 Hz. If that's not possible, use the native sample rate of
-   * the audio source (instead of re-sampling).
-   * This field is optional for FLAC and WAV audio files, but is
-   * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-   * 
- * - * int32 sample_rate_hertz = 2; - * @return The sampleRateHertz. - */ - @java.lang.Override - public int getSampleRateHertz() { - return sampleRateHertz_; - } - - public static final int AUDIO_CHANNEL_COUNT_FIELD_NUMBER = 7; - private int audioChannelCount_; - /** - *
-   * The number of channels in the input audio data.
-   * ONLY set this for MULTI-CHANNEL recognition.
-   * Valid values for LINEAR16 and FLAC are `1`-`8`.
-   * Valid values for OGG_OPUS are '1'-'254'.
-   * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
-   * If `0` or omitted, defaults to one channel (mono).
-   * Note: We only recognize the first channel by default.
-   * To perform independent recognition on each channel set
-   * `enable_separate_recognition_per_channel` to 'true'.
-   * 
- * - * int32 audio_channel_count = 7; - * @return The audioChannelCount. - */ - @java.lang.Override - public int getAudioChannelCount() { - return audioChannelCount_; - } - - public static final int ENABLE_SEPARATE_RECOGNITION_PER_CHANNEL_FIELD_NUMBER = 12; - private boolean enableSeparateRecognitionPerChannel_; - /** - *
-   * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-   * to get each channel recognized separately. The recognition result will
-   * contain a `channel_tag` field to state which channel that result belongs
-   * to. If this is not true, we will only recognize the first channel. The
-   * request is billed cumulatively for all channels recognized:
-   * `audio_channel_count` multiplied by the length of the audio.
-   * 
- * - * bool enable_separate_recognition_per_channel = 12; - * @return The enableSeparateRecognitionPerChannel. - */ - @java.lang.Override - public boolean getEnableSeparateRecognitionPerChannel() { - return enableSeparateRecognitionPerChannel_; - } - - public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; - private volatile java.lang.Object languageCode_; - /** - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The languageCode. - */ - @java.lang.Override - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } - } - /** - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for languageCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ALTERNATIVE_LANGUAGE_CODES_FIELD_NUMBER = 18; - private com.google.protobuf.LazyStringList alternativeLanguageCodes_; - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @return A list containing the alternativeLanguageCodes. - */ - public com.google.protobuf.ProtocolStringList - getAlternativeLanguageCodesList() { - return alternativeLanguageCodes_; - } - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @return The count of alternativeLanguageCodes. - */ - public int getAlternativeLanguageCodesCount() { - return alternativeLanguageCodes_.size(); - } - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index of the element to return. - * @return The alternativeLanguageCodes at the given index. - */ - public java.lang.String getAlternativeLanguageCodes(int index) { - return alternativeLanguageCodes_.get(index); - } - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index of the value to return. - * @return The bytes of the alternativeLanguageCodes at the given index. - */ - public com.google.protobuf.ByteString - getAlternativeLanguageCodesBytes(int index) { - return alternativeLanguageCodes_.getByteString(index); - } - - public static final int MAX_ALTERNATIVES_FIELD_NUMBER = 4; - private int maxAlternatives_; - /** - *
-   * Maximum number of recognition hypotheses to be returned.
-   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-   * within each `SpeechRecognitionResult`.
-   * The server may return fewer than `max_alternatives`.
-   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-   * one. If omitted, will return a maximum of one.
-   * 
- * - * int32 max_alternatives = 4; - * @return The maxAlternatives. - */ - @java.lang.Override - public int getMaxAlternatives() { - return maxAlternatives_; - } - - public static final int PROFANITY_FILTER_FIELD_NUMBER = 5; - private boolean profanityFilter_; - /** - *
-   * If set to `true`, the server will attempt to filter out
-   * profanities, replacing all but the initial character in each filtered word
-   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-   * won't be filtered out.
-   * 
- * - * bool profanity_filter = 5; - * @return The profanityFilter. - */ - @java.lang.Override - public boolean getProfanityFilter() { - return profanityFilter_; - } - - public static final int ADAPTATION_FIELD_NUMBER = 20; - private com.google.cloud.speech.v1.SpeechAdaptation adaptation_; - /** - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-   * documentation.
-   * When speech adaptation is set it supersedes the `speech_contexts` field.
-   * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - * @return Whether the adaptation field is set. - */ - @java.lang.Override - public boolean hasAdaptation() { - return adaptation_ != null; - } - /** - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-   * documentation.
-   * When speech adaptation is set it supersedes the `speech_contexts` field.
-   * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - * @return The adaptation. - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechAdaptation getAdaptation() { - return adaptation_ == null ? com.google.cloud.speech.v1.SpeechAdaptation.getDefaultInstance() : adaptation_; - } - /** - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-   * documentation.
-   * When speech adaptation is set it supersedes the `speech_contexts` field.
-   * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechAdaptationOrBuilder getAdaptationOrBuilder() { - return getAdaptation(); - } - - public static final int SPEECH_CONTEXTS_FIELD_NUMBER = 6; - private java.util.List speechContexts_; - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public java.util.List getSpeechContextsList() { - return speechContexts_; - } - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public java.util.List - getSpeechContextsOrBuilderList() { - return speechContexts_; - } - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public int getSpeechContextsCount() { - return speechContexts_.size(); - } - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechContext getSpeechContexts(int index) { - return speechContexts_.get(index); - } - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechContextOrBuilder getSpeechContextsOrBuilder( - int index) { - return speechContexts_.get(index); - } - - public static final int ENABLE_WORD_TIME_OFFSETS_FIELD_NUMBER = 8; - private boolean enableWordTimeOffsets_; - /** - *
-   * If `true`, the top result includes a list of words and
-   * the start and end time offsets (timestamps) for those words. If
-   * `false`, no word-level time offset information is returned. The default is
-   * `false`.
-   * 
- * - * bool enable_word_time_offsets = 8; - * @return The enableWordTimeOffsets. - */ - @java.lang.Override - public boolean getEnableWordTimeOffsets() { - return enableWordTimeOffsets_; - } - - public static final int ENABLE_WORD_CONFIDENCE_FIELD_NUMBER = 15; - private boolean enableWordConfidence_; - /** - *
-   * If `true`, the top result includes a list of words and the
-   * confidence for those words. If `false`, no word-level confidence
-   * information is returned. The default is `false`.
-   * 
- * - * bool enable_word_confidence = 15; - * @return The enableWordConfidence. - */ - @java.lang.Override - public boolean getEnableWordConfidence() { - return enableWordConfidence_; - } - - public static final int ENABLE_AUTOMATIC_PUNCTUATION_FIELD_NUMBER = 11; - private boolean enableAutomaticPunctuation_; - /** - *
-   * If 'true', adds punctuation to recognition result hypotheses.
-   * This feature is only available in select languages. Setting this for
-   * requests in other languages has no effect at all.
-   * The default 'false' value does not add punctuation to result hypotheses.
-   * 
- * - * bool enable_automatic_punctuation = 11; - * @return The enableAutomaticPunctuation. - */ - @java.lang.Override - public boolean getEnableAutomaticPunctuation() { - return enableAutomaticPunctuation_; - } - - public static final int ENABLE_SPOKEN_PUNCTUATION_FIELD_NUMBER = 22; - private com.google.protobuf.BoolValue enableSpokenPunctuation_; - /** - *
-   * The spoken punctuation behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * e.g. command_and_search will enable spoken punctuation by default
-   * If 'true', replaces spoken punctuation with the corresponding symbols in
-   * the request. For example, "how are you question mark" becomes "how are
-   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-   * for support. If 'false', spoken punctuation is not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - * @return Whether the enableSpokenPunctuation field is set. - */ - @java.lang.Override - public boolean hasEnableSpokenPunctuation() { - return enableSpokenPunctuation_ != null; - } - /** - *
-   * The spoken punctuation behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * e.g. command_and_search will enable spoken punctuation by default
-   * If 'true', replaces spoken punctuation with the corresponding symbols in
-   * the request. For example, "how are you question mark" becomes "how are
-   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-   * for support. If 'false', spoken punctuation is not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - * @return The enableSpokenPunctuation. - */ - @java.lang.Override - public com.google.protobuf.BoolValue getEnableSpokenPunctuation() { - return enableSpokenPunctuation_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenPunctuation_; - } - /** - *
-   * The spoken punctuation behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * e.g. command_and_search will enable spoken punctuation by default
-   * If 'true', replaces spoken punctuation with the corresponding symbols in
-   * the request. For example, "how are you question mark" becomes "how are
-   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-   * for support. If 'false', spoken punctuation is not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - @java.lang.Override - public com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilder() { - return getEnableSpokenPunctuation(); - } - - public static final int ENABLE_SPOKEN_EMOJIS_FIELD_NUMBER = 23; - private com.google.protobuf.BoolValue enableSpokenEmojis_; - /** - *
-   * The spoken emoji behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * If 'true', adds spoken emoji formatting for the request. This will replace
-   * spoken emojis with the corresponding Unicode symbols in the final
-   * transcript. If 'false', spoken emojis are not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - * @return Whether the enableSpokenEmojis field is set. - */ - @java.lang.Override - public boolean hasEnableSpokenEmojis() { - return enableSpokenEmojis_ != null; - } - /** - *
-   * The spoken emoji behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * If 'true', adds spoken emoji formatting for the request. This will replace
-   * spoken emojis with the corresponding Unicode symbols in the final
-   * transcript. If 'false', spoken emojis are not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - * @return The enableSpokenEmojis. - */ - @java.lang.Override - public com.google.protobuf.BoolValue getEnableSpokenEmojis() { - return enableSpokenEmojis_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenEmojis_; - } - /** - *
-   * The spoken emoji behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * If 'true', adds spoken emoji formatting for the request. This will replace
-   * spoken emojis with the corresponding Unicode symbols in the final
-   * transcript. If 'false', spoken emojis are not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - @java.lang.Override - public com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder() { - return getEnableSpokenEmojis(); - } - - public static final int DIARIZATION_CONFIG_FIELD_NUMBER = 19; - private com.google.cloud.speech.v1.SpeakerDiarizationConfig diarizationConfig_; - /** - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - * @return Whether the diarizationConfig field is set. - */ - @java.lang.Override - public boolean hasDiarizationConfig() { - return diarizationConfig_ != null; - } - /** - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - * @return The diarizationConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDiarizationConfig() { - return diarizationConfig_ == null ? com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance() : diarizationConfig_; - } - /** - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder() { - return getDiarizationConfig(); - } - - public static final int METADATA_FIELD_NUMBER = 9; - private com.google.cloud.speech.v1.RecognitionMetadata metadata_; - /** - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - * @return Whether the metadata field is set. - */ - @java.lang.Override - public boolean hasMetadata() { - return metadata_ != null; - } - /** - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - * @return The metadata. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata getMetadata() { - return metadata_ == null ? com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance() : metadata_; - } - /** - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadataOrBuilder getMetadataOrBuilder() { - return getMetadata(); - } - - public static final int MODEL_FIELD_NUMBER = 13; - private volatile java.lang.Object model_; - /** - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_long</code></td>
-   *     <td>Best for long form content like media or conversation.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_short</code></td>
-   *     <td>Best for short form content like commands or single shot directed
-   *     speech.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_conversation</code></td>
-   *     <td>Best for audio that originated from a conversation between a
-   *         medical provider and patient.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_dictation</code></td>
-   *     <td>Best for audio that originated from dictation notes by a medical
-   *         provider.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * @return The model. - */ - @java.lang.Override - public java.lang.String getModel() { - java.lang.Object ref = model_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - model_ = s; - return s; - } - } - /** - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_long</code></td>
-   *     <td>Best for long form content like media or conversation.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_short</code></td>
-   *     <td>Best for short form content like commands or single shot directed
-   *     speech.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_conversation</code></td>
-   *     <td>Best for audio that originated from a conversation between a
-   *         medical provider and patient.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_dictation</code></td>
-   *     <td>Best for audio that originated from dictation notes by a medical
-   *         provider.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * @return The bytes for model. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getModelBytes() { - java.lang.Object ref = model_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - model_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int USE_ENHANCED_FIELD_NUMBER = 14; - private boolean useEnhanced_; - /** - *
-   * Set to true to use an enhanced model for speech recognition.
-   * If `use_enhanced` is set to true and the `model` field is not set, then
-   * an appropriate enhanced model is chosen if an enhanced model exists for
-   * the audio.
-   * If `use_enhanced` is true and an enhanced version of the specified model
-   * does not exist, then the speech is recognized using the standard version
-   * of the specified model.
-   * 
- * - * bool use_enhanced = 14; - * @return The useEnhanced. - */ - @java.lang.Override - public boolean getUseEnhanced() { - return useEnhanced_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (encoding_ != com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED.getNumber()) { - output.writeEnum(1, encoding_); - } - if (sampleRateHertz_ != 0) { - output.writeInt32(2, sampleRateHertz_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); - } - if (maxAlternatives_ != 0) { - output.writeInt32(4, maxAlternatives_); - } - if (profanityFilter_ != false) { - output.writeBool(5, profanityFilter_); - } - for (int i = 0; i < speechContexts_.size(); i++) { - output.writeMessage(6, speechContexts_.get(i)); - } - if (audioChannelCount_ != 0) { - output.writeInt32(7, audioChannelCount_); - } - if (enableWordTimeOffsets_ != false) { - output.writeBool(8, enableWordTimeOffsets_); - } - if (metadata_ != null) { - output.writeMessage(9, getMetadata()); - } - if (enableAutomaticPunctuation_ != false) { - output.writeBool(11, enableAutomaticPunctuation_); - } - if (enableSeparateRecognitionPerChannel_ != false) { - output.writeBool(12, enableSeparateRecognitionPerChannel_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 13, model_); - } - if (useEnhanced_ != false) { - output.writeBool(14, useEnhanced_); - } - if (enableWordConfidence_ != false) { - output.writeBool(15, enableWordConfidence_); - } - for (int i = 0; i < alternativeLanguageCodes_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 18, alternativeLanguageCodes_.getRaw(i)); - } - if (diarizationConfig_ != null) { - output.writeMessage(19, getDiarizationConfig()); - } - if (adaptation_ != null) { - output.writeMessage(20, getAdaptation()); - } - if (enableSpokenPunctuation_ != null) { - output.writeMessage(22, getEnableSpokenPunctuation()); - } - if (enableSpokenEmojis_ != null) { - output.writeMessage(23, getEnableSpokenEmojis()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (encoding_ != com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, encoding_); - } - if (sampleRateHertz_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, sampleRateHertz_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); - } - if (maxAlternatives_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, maxAlternatives_); - } - if (profanityFilter_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, profanityFilter_); - } - for (int i = 0; i < speechContexts_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, speechContexts_.get(i)); - } - if (audioChannelCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, audioChannelCount_); - } - if (enableWordTimeOffsets_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(8, enableWordTimeOffsets_); - } - if (metadata_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, getMetadata()); - } - if (enableAutomaticPunctuation_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(11, enableAutomaticPunctuation_); - } - if (enableSeparateRecognitionPerChannel_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(12, enableSeparateRecognitionPerChannel_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, model_); - } - if (useEnhanced_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(14, useEnhanced_); - } - if (enableWordConfidence_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(15, enableWordConfidence_); - } - { - int dataSize = 0; - for (int i = 0; i < alternativeLanguageCodes_.size(); i++) { - dataSize += computeStringSizeNoTag(alternativeLanguageCodes_.getRaw(i)); - } - size += dataSize; - size += 2 * getAlternativeLanguageCodesList().size(); - } - if (diarizationConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(19, getDiarizationConfig()); - } - if (adaptation_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(20, getAdaptation()); - } - if (enableSpokenPunctuation_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(22, getEnableSpokenPunctuation()); - } - if (enableSpokenEmojis_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(23, getEnableSpokenEmojis()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.RecognitionConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.RecognitionConfig other = (com.google.cloud.speech.v1.RecognitionConfig) obj; - - if (encoding_ != other.encoding_) return false; - if (getSampleRateHertz() - != other.getSampleRateHertz()) return false; - if (getAudioChannelCount() - != other.getAudioChannelCount()) return false; - if (getEnableSeparateRecognitionPerChannel() - != other.getEnableSeparateRecognitionPerChannel()) return false; - if (!getLanguageCode() - .equals(other.getLanguageCode())) return false; - if (!getAlternativeLanguageCodesList() - .equals(other.getAlternativeLanguageCodesList())) return false; - if (getMaxAlternatives() - != other.getMaxAlternatives()) return false; - if (getProfanityFilter() - != other.getProfanityFilter()) return false; - if (hasAdaptation() != other.hasAdaptation()) return false; - if (hasAdaptation()) { - if (!getAdaptation() - .equals(other.getAdaptation())) return false; - } - if (!getSpeechContextsList() - .equals(other.getSpeechContextsList())) return false; - if (getEnableWordTimeOffsets() - != other.getEnableWordTimeOffsets()) return false; - if (getEnableWordConfidence() - != other.getEnableWordConfidence()) return false; - if (getEnableAutomaticPunctuation() - != other.getEnableAutomaticPunctuation()) return false; - if (hasEnableSpokenPunctuation() != other.hasEnableSpokenPunctuation()) return false; - if (hasEnableSpokenPunctuation()) { - if (!getEnableSpokenPunctuation() - .equals(other.getEnableSpokenPunctuation())) return false; - } - if (hasEnableSpokenEmojis() != other.hasEnableSpokenEmojis()) return false; - if (hasEnableSpokenEmojis()) { - if (!getEnableSpokenEmojis() - .equals(other.getEnableSpokenEmojis())) return false; - } - if (hasDiarizationConfig() != other.hasDiarizationConfig()) return false; - if (hasDiarizationConfig()) { - if (!getDiarizationConfig() - .equals(other.getDiarizationConfig())) return false; - } - if (hasMetadata() != other.hasMetadata()) return false; - if (hasMetadata()) { - if (!getMetadata() - .equals(other.getMetadata())) return false; - } - if (!getModel() - .equals(other.getModel())) return false; - if (getUseEnhanced() - != other.getUseEnhanced()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENCODING_FIELD_NUMBER; - hash = (53 * hash) + encoding_; - hash = (37 * hash) + SAMPLE_RATE_HERTZ_FIELD_NUMBER; - hash = (53 * hash) + getSampleRateHertz(); - hash = (37 * hash) + AUDIO_CHANNEL_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getAudioChannelCount(); - hash = (37 * hash) + ENABLE_SEPARATE_RECOGNITION_PER_CHANNEL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableSeparateRecognitionPerChannel()); - hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getLanguageCode().hashCode(); - if (getAlternativeLanguageCodesCount() > 0) { - hash = (37 * hash) + ALTERNATIVE_LANGUAGE_CODES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativeLanguageCodesList().hashCode(); - } - hash = (37 * hash) + MAX_ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getMaxAlternatives(); - hash = (37 * hash) + PROFANITY_FILTER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getProfanityFilter()); - if (hasAdaptation()) { - hash = (37 * hash) + ADAPTATION_FIELD_NUMBER; - hash = (53 * hash) + getAdaptation().hashCode(); - } - if (getSpeechContextsCount() > 0) { - hash = (37 * hash) + SPEECH_CONTEXTS_FIELD_NUMBER; - hash = (53 * hash) + getSpeechContextsList().hashCode(); - } - hash = (37 * hash) + ENABLE_WORD_TIME_OFFSETS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableWordTimeOffsets()); - hash = (37 * hash) + ENABLE_WORD_CONFIDENCE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableWordConfidence()); - hash = (37 * hash) + ENABLE_AUTOMATIC_PUNCTUATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableAutomaticPunctuation()); - if (hasEnableSpokenPunctuation()) { - hash = (37 * hash) + ENABLE_SPOKEN_PUNCTUATION_FIELD_NUMBER; - hash = (53 * hash) + getEnableSpokenPunctuation().hashCode(); - } - if (hasEnableSpokenEmojis()) { - hash = (37 * hash) + ENABLE_SPOKEN_EMOJIS_FIELD_NUMBER; - hash = (53 * hash) + getEnableSpokenEmojis().hashCode(); - } - if (hasDiarizationConfig()) { - hash = (37 * hash) + DIARIZATION_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getDiarizationConfig().hashCode(); - } - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - hash = (37 * hash) + MODEL_FIELD_NUMBER; - hash = (53 * hash) + getModel().hashCode(); - hash = (37 * hash) + USE_ENHANCED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUseEnhanced()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognitionConfig parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognitionConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.RecognitionConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognitionConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognitionConfig) - com.google.cloud.speech.v1.RecognitionConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognitionConfig.class, com.google.cloud.speech.v1.RecognitionConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.RecognitionConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getSpeechContextsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - encoding_ = 0; - - sampleRateHertz_ = 0; - - audioChannelCount_ = 0; - - enableSeparateRecognitionPerChannel_ = false; - - languageCode_ = ""; - - alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - maxAlternatives_ = 0; - - profanityFilter_ = false; - - if (adaptationBuilder_ == null) { - adaptation_ = null; - } else { - adaptation_ = null; - adaptationBuilder_ = null; - } - if (speechContextsBuilder_ == null) { - speechContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - speechContextsBuilder_.clear(); - } - enableWordTimeOffsets_ = false; - - enableWordConfidence_ = false; - - enableAutomaticPunctuation_ = false; - - if (enableSpokenPunctuationBuilder_ == null) { - enableSpokenPunctuation_ = null; - } else { - enableSpokenPunctuation_ = null; - enableSpokenPunctuationBuilder_ = null; - } - if (enableSpokenEmojisBuilder_ == null) { - enableSpokenEmojis_ = null; - } else { - enableSpokenEmojis_ = null; - enableSpokenEmojisBuilder_ = null; - } - if (diarizationConfigBuilder_ == null) { - diarizationConfig_ = null; - } else { - diarizationConfig_ = null; - diarizationConfigBuilder_ = null; - } - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadata_ = null; - metadataBuilder_ = null; - } - model_ = ""; - - useEnhanced_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig build() { - com.google.cloud.speech.v1.RecognitionConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig buildPartial() { - com.google.cloud.speech.v1.RecognitionConfig result = new com.google.cloud.speech.v1.RecognitionConfig(this); - int from_bitField0_ = bitField0_; - result.encoding_ = encoding_; - result.sampleRateHertz_ = sampleRateHertz_; - result.audioChannelCount_ = audioChannelCount_; - result.enableSeparateRecognitionPerChannel_ = enableSeparateRecognitionPerChannel_; - result.languageCode_ = languageCode_; - if (((bitField0_ & 0x00000001) != 0)) { - alternativeLanguageCodes_ = alternativeLanguageCodes_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternativeLanguageCodes_ = alternativeLanguageCodes_; - result.maxAlternatives_ = maxAlternatives_; - result.profanityFilter_ = profanityFilter_; - if (adaptationBuilder_ == null) { - result.adaptation_ = adaptation_; - } else { - result.adaptation_ = adaptationBuilder_.build(); - } - if (speechContextsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.speechContexts_ = speechContexts_; - } else { - result.speechContexts_ = speechContextsBuilder_.build(); - } - result.enableWordTimeOffsets_ = enableWordTimeOffsets_; - result.enableWordConfidence_ = enableWordConfidence_; - result.enableAutomaticPunctuation_ = enableAutomaticPunctuation_; - if (enableSpokenPunctuationBuilder_ == null) { - result.enableSpokenPunctuation_ = enableSpokenPunctuation_; - } else { - result.enableSpokenPunctuation_ = enableSpokenPunctuationBuilder_.build(); - } - if (enableSpokenEmojisBuilder_ == null) { - result.enableSpokenEmojis_ = enableSpokenEmojis_; - } else { - result.enableSpokenEmojis_ = enableSpokenEmojisBuilder_.build(); - } - if (diarizationConfigBuilder_ == null) { - result.diarizationConfig_ = diarizationConfig_; - } else { - result.diarizationConfig_ = diarizationConfigBuilder_.build(); - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - result.model_ = model_; - result.useEnhanced_ = useEnhanced_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.RecognitionConfig) { - return mergeFrom((com.google.cloud.speech.v1.RecognitionConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.RecognitionConfig other) { - if (other == com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance()) return this; - if (other.encoding_ != 0) { - setEncodingValue(other.getEncodingValue()); - } - if (other.getSampleRateHertz() != 0) { - setSampleRateHertz(other.getSampleRateHertz()); - } - if (other.getAudioChannelCount() != 0) { - setAudioChannelCount(other.getAudioChannelCount()); - } - if (other.getEnableSeparateRecognitionPerChannel() != false) { - setEnableSeparateRecognitionPerChannel(other.getEnableSeparateRecognitionPerChannel()); - } - if (!other.getLanguageCode().isEmpty()) { - languageCode_ = other.languageCode_; - onChanged(); - } - if (!other.alternativeLanguageCodes_.isEmpty()) { - if (alternativeLanguageCodes_.isEmpty()) { - alternativeLanguageCodes_ = other.alternativeLanguageCodes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativeLanguageCodesIsMutable(); - alternativeLanguageCodes_.addAll(other.alternativeLanguageCodes_); - } - onChanged(); - } - if (other.getMaxAlternatives() != 0) { - setMaxAlternatives(other.getMaxAlternatives()); - } - if (other.getProfanityFilter() != false) { - setProfanityFilter(other.getProfanityFilter()); - } - if (other.hasAdaptation()) { - mergeAdaptation(other.getAdaptation()); - } - if (speechContextsBuilder_ == null) { - if (!other.speechContexts_.isEmpty()) { - if (speechContexts_.isEmpty()) { - speechContexts_ = other.speechContexts_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureSpeechContextsIsMutable(); - speechContexts_.addAll(other.speechContexts_); - } - onChanged(); - } - } else { - if (!other.speechContexts_.isEmpty()) { - if (speechContextsBuilder_.isEmpty()) { - speechContextsBuilder_.dispose(); - speechContextsBuilder_ = null; - speechContexts_ = other.speechContexts_; - bitField0_ = (bitField0_ & ~0x00000002); - speechContextsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getSpeechContextsFieldBuilder() : null; - } else { - speechContextsBuilder_.addAllMessages(other.speechContexts_); - } - } - } - if (other.getEnableWordTimeOffsets() != false) { - setEnableWordTimeOffsets(other.getEnableWordTimeOffsets()); - } - if (other.getEnableWordConfidence() != false) { - setEnableWordConfidence(other.getEnableWordConfidence()); - } - if (other.getEnableAutomaticPunctuation() != false) { - setEnableAutomaticPunctuation(other.getEnableAutomaticPunctuation()); - } - if (other.hasEnableSpokenPunctuation()) { - mergeEnableSpokenPunctuation(other.getEnableSpokenPunctuation()); - } - if (other.hasEnableSpokenEmojis()) { - mergeEnableSpokenEmojis(other.getEnableSpokenEmojis()); - } - if (other.hasDiarizationConfig()) { - mergeDiarizationConfig(other.getDiarizationConfig()); - } - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (!other.getModel().isEmpty()) { - model_ = other.model_; - onChanged(); - } - if (other.getUseEnhanced() != false) { - setUseEnhanced(other.getUseEnhanced()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.RecognitionConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.RecognitionConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int encoding_ = 0; - /** - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * @return The enum numeric value on the wire for encoding. - */ - @java.lang.Override public int getEncodingValue() { - return encoding_; - } - /** - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * @param value The enum numeric value on the wire for encoding to set. - * @return This builder for chaining. - */ - public Builder setEncodingValue(int value) { - - encoding_ = value; - onChanged(); - return this; - } - /** - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * @return The encoding. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding getEncoding() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding result = com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.valueOf(encoding_); - return result == null ? com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding.UNRECOGNIZED : result; - } - /** - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * @param value The encoding to set. - * @return This builder for chaining. - */ - public Builder setEncoding(com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding value) { - if (value == null) { - throw new NullPointerException(); - } - - encoding_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * @return This builder for chaining. - */ - public Builder clearEncoding() { - - encoding_ = 0; - onChanged(); - return this; - } - - private int sampleRateHertz_ ; - /** - *
-     * Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * This field is optional for FLAC and WAV audio files, but is
-     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * int32 sample_rate_hertz = 2; - * @return The sampleRateHertz. - */ - @java.lang.Override - public int getSampleRateHertz() { - return sampleRateHertz_; - } - /** - *
-     * Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * This field is optional for FLAC and WAV audio files, but is
-     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * int32 sample_rate_hertz = 2; - * @param value The sampleRateHertz to set. - * @return This builder for chaining. - */ - public Builder setSampleRateHertz(int value) { - - sampleRateHertz_ = value; - onChanged(); - return this; - } - /** - *
-     * Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * This field is optional for FLAC and WAV audio files, but is
-     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-     * 
- * - * int32 sample_rate_hertz = 2; - * @return This builder for chaining. - */ - public Builder clearSampleRateHertz() { - - sampleRateHertz_ = 0; - onChanged(); - return this; - } - - private int audioChannelCount_ ; - /** - *
-     * The number of channels in the input audio data.
-     * ONLY set this for MULTI-CHANNEL recognition.
-     * Valid values for LINEAR16 and FLAC are `1`-`8`.
-     * Valid values for OGG_OPUS are '1'-'254'.
-     * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
-     * If `0` or omitted, defaults to one channel (mono).
-     * Note: We only recognize the first channel by default.
-     * To perform independent recognition on each channel set
-     * `enable_separate_recognition_per_channel` to 'true'.
-     * 
- * - * int32 audio_channel_count = 7; - * @return The audioChannelCount. - */ - @java.lang.Override - public int getAudioChannelCount() { - return audioChannelCount_; - } - /** - *
-     * The number of channels in the input audio data.
-     * ONLY set this for MULTI-CHANNEL recognition.
-     * Valid values for LINEAR16 and FLAC are `1`-`8`.
-     * Valid values for OGG_OPUS are '1'-'254'.
-     * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
-     * If `0` or omitted, defaults to one channel (mono).
-     * Note: We only recognize the first channel by default.
-     * To perform independent recognition on each channel set
-     * `enable_separate_recognition_per_channel` to 'true'.
-     * 
- * - * int32 audio_channel_count = 7; - * @param value The audioChannelCount to set. - * @return This builder for chaining. - */ - public Builder setAudioChannelCount(int value) { - - audioChannelCount_ = value; - onChanged(); - return this; - } - /** - *
-     * The number of channels in the input audio data.
-     * ONLY set this for MULTI-CHANNEL recognition.
-     * Valid values for LINEAR16 and FLAC are `1`-`8`.
-     * Valid values for OGG_OPUS are '1'-'254'.
-     * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
-     * If `0` or omitted, defaults to one channel (mono).
-     * Note: We only recognize the first channel by default.
-     * To perform independent recognition on each channel set
-     * `enable_separate_recognition_per_channel` to 'true'.
-     * 
- * - * int32 audio_channel_count = 7; - * @return This builder for chaining. - */ - public Builder clearAudioChannelCount() { - - audioChannelCount_ = 0; - onChanged(); - return this; - } - - private boolean enableSeparateRecognitionPerChannel_ ; - /** - *
-     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-     * to get each channel recognized separately. The recognition result will
-     * contain a `channel_tag` field to state which channel that result belongs
-     * to. If this is not true, we will only recognize the first channel. The
-     * request is billed cumulatively for all channels recognized:
-     * `audio_channel_count` multiplied by the length of the audio.
-     * 
- * - * bool enable_separate_recognition_per_channel = 12; - * @return The enableSeparateRecognitionPerChannel. - */ - @java.lang.Override - public boolean getEnableSeparateRecognitionPerChannel() { - return enableSeparateRecognitionPerChannel_; - } - /** - *
-     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-     * to get each channel recognized separately. The recognition result will
-     * contain a `channel_tag` field to state which channel that result belongs
-     * to. If this is not true, we will only recognize the first channel. The
-     * request is billed cumulatively for all channels recognized:
-     * `audio_channel_count` multiplied by the length of the audio.
-     * 
- * - * bool enable_separate_recognition_per_channel = 12; - * @param value The enableSeparateRecognitionPerChannel to set. - * @return This builder for chaining. - */ - public Builder setEnableSeparateRecognitionPerChannel(boolean value) { - - enableSeparateRecognitionPerChannel_ = value; - onChanged(); - return this; - } - /** - *
-     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-     * to get each channel recognized separately. The recognition result will
-     * contain a `channel_tag` field to state which channel that result belongs
-     * to. If this is not true, we will only recognize the first channel. The
-     * request is billed cumulatively for all channels recognized:
-     * `audio_channel_count` multiplied by the length of the audio.
-     * 
- * - * bool enable_separate_recognition_per_channel = 12; - * @return This builder for chaining. - */ - public Builder clearEnableSeparateRecognitionPerChannel() { - - enableSeparateRecognitionPerChannel_ = false; - onChanged(); - return this; - } - - private java.lang.Object languageCode_ = ""; - /** - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The languageCode. - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for languageCode. - */ - public com.google.protobuf.ByteString - getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param value The languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCode( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - languageCode_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return This builder for chaining. - */ - public Builder clearLanguageCode() { - - languageCode_ = getDefaultInstance().getLanguageCode(); - onChanged(); - return this; - } - /** - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param value The bytes for languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCodeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - languageCode_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureAlternativeLanguageCodesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - alternativeLanguageCodes_ = new com.google.protobuf.LazyStringArrayList(alternativeLanguageCodes_); - bitField0_ |= 0x00000001; - } - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @return A list containing the alternativeLanguageCodes. - */ - public com.google.protobuf.ProtocolStringList - getAlternativeLanguageCodesList() { - return alternativeLanguageCodes_.getUnmodifiableView(); - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @return The count of alternativeLanguageCodes. - */ - public int getAlternativeLanguageCodesCount() { - return alternativeLanguageCodes_.size(); - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index of the element to return. - * @return The alternativeLanguageCodes at the given index. - */ - public java.lang.String getAlternativeLanguageCodes(int index) { - return alternativeLanguageCodes_.get(index); - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index of the value to return. - * @return The bytes of the alternativeLanguageCodes at the given index. - */ - public com.google.protobuf.ByteString - getAlternativeLanguageCodesBytes(int index) { - return alternativeLanguageCodes_.getByteString(index); - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index to set the value at. - * @param value The alternativeLanguageCodes to set. - * @return This builder for chaining. - */ - public Builder setAlternativeLanguageCodes( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativeLanguageCodesIsMutable(); - alternativeLanguageCodes_.set(index, value); - onChanged(); - return this; - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @param value The alternativeLanguageCodes to add. - * @return This builder for chaining. - */ - public Builder addAlternativeLanguageCodes( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativeLanguageCodesIsMutable(); - alternativeLanguageCodes_.add(value); - onChanged(); - return this; - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @param values The alternativeLanguageCodes to add. - * @return This builder for chaining. - */ - public Builder addAllAlternativeLanguageCodes( - java.lang.Iterable values) { - ensureAlternativeLanguageCodesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, alternativeLanguageCodes_); - onChanged(); - return this; - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @return This builder for chaining. - */ - public Builder clearAlternativeLanguageCodes() { - alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @param value The bytes of the alternativeLanguageCodes to add. - * @return This builder for chaining. - */ - public Builder addAlternativeLanguageCodesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAlternativeLanguageCodesIsMutable(); - alternativeLanguageCodes_.add(value); - onChanged(); - return this; - } - - private int maxAlternatives_ ; - /** - *
-     * Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - * @return The maxAlternatives. - */ - @java.lang.Override - public int getMaxAlternatives() { - return maxAlternatives_; - } - /** - *
-     * Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - * @param value The maxAlternatives to set. - * @return This builder for chaining. - */ - public Builder setMaxAlternatives(int value) { - - maxAlternatives_ = value; - onChanged(); - return this; - } - /** - *
-     * Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - * @return This builder for chaining. - */ - public Builder clearMaxAlternatives() { - - maxAlternatives_ = 0; - onChanged(); - return this; - } - - private boolean profanityFilter_ ; - /** - *
-     * If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - * @return The profanityFilter. - */ - @java.lang.Override - public boolean getProfanityFilter() { - return profanityFilter_; - } - /** - *
-     * If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - * @param value The profanityFilter to set. - * @return This builder for chaining. - */ - public Builder setProfanityFilter(boolean value) { - - profanityFilter_ = value; - onChanged(); - return this; - } - /** - *
-     * If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - * @return This builder for chaining. - */ - public Builder clearProfanityFilter() { - - profanityFilter_ = false; - onChanged(); - return this; - } - - private com.google.cloud.speech.v1.SpeechAdaptation adaptation_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.SpeechAdaptation, com.google.cloud.speech.v1.SpeechAdaptation.Builder, com.google.cloud.speech.v1.SpeechAdaptationOrBuilder> adaptationBuilder_; - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - * @return Whether the adaptation field is set. - */ - public boolean hasAdaptation() { - return adaptationBuilder_ != null || adaptation_ != null; - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - * @return The adaptation. - */ - public com.google.cloud.speech.v1.SpeechAdaptation getAdaptation() { - if (adaptationBuilder_ == null) { - return adaptation_ == null ? com.google.cloud.speech.v1.SpeechAdaptation.getDefaultInstance() : adaptation_; - } else { - return adaptationBuilder_.getMessage(); - } - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - */ - public Builder setAdaptation(com.google.cloud.speech.v1.SpeechAdaptation value) { - if (adaptationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - adaptation_ = value; - onChanged(); - } else { - adaptationBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - */ - public Builder setAdaptation( - com.google.cloud.speech.v1.SpeechAdaptation.Builder builderForValue) { - if (adaptationBuilder_ == null) { - adaptation_ = builderForValue.build(); - onChanged(); - } else { - adaptationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - */ - public Builder mergeAdaptation(com.google.cloud.speech.v1.SpeechAdaptation value) { - if (adaptationBuilder_ == null) { - if (adaptation_ != null) { - adaptation_ = - com.google.cloud.speech.v1.SpeechAdaptation.newBuilder(adaptation_).mergeFrom(value).buildPartial(); - } else { - adaptation_ = value; - } - onChanged(); - } else { - adaptationBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - */ - public Builder clearAdaptation() { - if (adaptationBuilder_ == null) { - adaptation_ = null; - onChanged(); - } else { - adaptation_ = null; - adaptationBuilder_ = null; - } - - return this; - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - */ - public com.google.cloud.speech.v1.SpeechAdaptation.Builder getAdaptationBuilder() { - - onChanged(); - return getAdaptationFieldBuilder().getBuilder(); - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - */ - public com.google.cloud.speech.v1.SpeechAdaptationOrBuilder getAdaptationOrBuilder() { - if (adaptationBuilder_ != null) { - return adaptationBuilder_.getMessageOrBuilder(); - } else { - return adaptation_ == null ? - com.google.cloud.speech.v1.SpeechAdaptation.getDefaultInstance() : adaptation_; - } - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.SpeechAdaptation, com.google.cloud.speech.v1.SpeechAdaptation.Builder, com.google.cloud.speech.v1.SpeechAdaptationOrBuilder> - getAdaptationFieldBuilder() { - if (adaptationBuilder_ == null) { - adaptationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.SpeechAdaptation, com.google.cloud.speech.v1.SpeechAdaptation.Builder, com.google.cloud.speech.v1.SpeechAdaptationOrBuilder>( - getAdaptation(), - getParentForChildren(), - isClean()); - adaptation_ = null; - } - return adaptationBuilder_; - } - - private java.util.List speechContexts_ = - java.util.Collections.emptyList(); - private void ensureSpeechContextsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - speechContexts_ = new java.util.ArrayList(speechContexts_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechContext, com.google.cloud.speech.v1.SpeechContext.Builder, com.google.cloud.speech.v1.SpeechContextOrBuilder> speechContextsBuilder_; - - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public java.util.List getSpeechContextsList() { - if (speechContextsBuilder_ == null) { - return java.util.Collections.unmodifiableList(speechContexts_); - } else { - return speechContextsBuilder_.getMessageList(); - } - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public int getSpeechContextsCount() { - if (speechContextsBuilder_ == null) { - return speechContexts_.size(); - } else { - return speechContextsBuilder_.getCount(); - } - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1.SpeechContext getSpeechContexts(int index) { - if (speechContextsBuilder_ == null) { - return speechContexts_.get(index); - } else { - return speechContextsBuilder_.getMessage(index); - } - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder setSpeechContexts( - int index, com.google.cloud.speech.v1.SpeechContext value) { - if (speechContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpeechContextsIsMutable(); - speechContexts_.set(index, value); - onChanged(); - } else { - speechContextsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder setSpeechContexts( - int index, com.google.cloud.speech.v1.SpeechContext.Builder builderForValue) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.set(index, builderForValue.build()); - onChanged(); - } else { - speechContextsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts(com.google.cloud.speech.v1.SpeechContext value) { - if (speechContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpeechContextsIsMutable(); - speechContexts_.add(value); - onChanged(); - } else { - speechContextsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts( - int index, com.google.cloud.speech.v1.SpeechContext value) { - if (speechContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpeechContextsIsMutable(); - speechContexts_.add(index, value); - onChanged(); - } else { - speechContextsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts( - com.google.cloud.speech.v1.SpeechContext.Builder builderForValue) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.add(builderForValue.build()); - onChanged(); - } else { - speechContextsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts( - int index, com.google.cloud.speech.v1.SpeechContext.Builder builderForValue) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.add(index, builderForValue.build()); - onChanged(); - } else { - speechContextsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder addAllSpeechContexts( - java.lang.Iterable values) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, speechContexts_); - onChanged(); - } else { - speechContextsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder clearSpeechContexts() { - if (speechContextsBuilder_ == null) { - speechContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - speechContextsBuilder_.clear(); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public Builder removeSpeechContexts(int index) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.remove(index); - onChanged(); - } else { - speechContextsBuilder_.remove(index); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1.SpeechContext.Builder getSpeechContextsBuilder( - int index) { - return getSpeechContextsFieldBuilder().getBuilder(index); - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1.SpeechContextOrBuilder getSpeechContextsOrBuilder( - int index) { - if (speechContextsBuilder_ == null) { - return speechContexts_.get(index); } else { - return speechContextsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public java.util.List - getSpeechContextsOrBuilderList() { - if (speechContextsBuilder_ != null) { - return speechContextsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(speechContexts_); - } - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1.SpeechContext.Builder addSpeechContextsBuilder() { - return getSpeechContextsFieldBuilder().addBuilder( - com.google.cloud.speech.v1.SpeechContext.getDefaultInstance()); - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1.SpeechContext.Builder addSpeechContextsBuilder( - int index) { - return getSpeechContextsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.SpeechContext.getDefaultInstance()); - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - public java.util.List - getSpeechContextsBuilderList() { - return getSpeechContextsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechContext, com.google.cloud.speech.v1.SpeechContext.Builder, com.google.cloud.speech.v1.SpeechContextOrBuilder> - getSpeechContextsFieldBuilder() { - if (speechContextsBuilder_ == null) { - speechContextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechContext, com.google.cloud.speech.v1.SpeechContext.Builder, com.google.cloud.speech.v1.SpeechContextOrBuilder>( - speechContexts_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - speechContexts_ = null; - } - return speechContextsBuilder_; - } - - private boolean enableWordTimeOffsets_ ; - /** - *
-     * If `true`, the top result includes a list of words and
-     * the start and end time offsets (timestamps) for those words. If
-     * `false`, no word-level time offset information is returned. The default is
-     * `false`.
-     * 
- * - * bool enable_word_time_offsets = 8; - * @return The enableWordTimeOffsets. - */ - @java.lang.Override - public boolean getEnableWordTimeOffsets() { - return enableWordTimeOffsets_; - } - /** - *
-     * If `true`, the top result includes a list of words and
-     * the start and end time offsets (timestamps) for those words. If
-     * `false`, no word-level time offset information is returned. The default is
-     * `false`.
-     * 
- * - * bool enable_word_time_offsets = 8; - * @param value The enableWordTimeOffsets to set. - * @return This builder for chaining. - */ - public Builder setEnableWordTimeOffsets(boolean value) { - - enableWordTimeOffsets_ = value; - onChanged(); - return this; - } - /** - *
-     * If `true`, the top result includes a list of words and
-     * the start and end time offsets (timestamps) for those words. If
-     * `false`, no word-level time offset information is returned. The default is
-     * `false`.
-     * 
- * - * bool enable_word_time_offsets = 8; - * @return This builder for chaining. - */ - public Builder clearEnableWordTimeOffsets() { - - enableWordTimeOffsets_ = false; - onChanged(); - return this; - } - - private boolean enableWordConfidence_ ; - /** - *
-     * If `true`, the top result includes a list of words and the
-     * confidence for those words. If `false`, no word-level confidence
-     * information is returned. The default is `false`.
-     * 
- * - * bool enable_word_confidence = 15; - * @return The enableWordConfidence. - */ - @java.lang.Override - public boolean getEnableWordConfidence() { - return enableWordConfidence_; - } - /** - *
-     * If `true`, the top result includes a list of words and the
-     * confidence for those words. If `false`, no word-level confidence
-     * information is returned. The default is `false`.
-     * 
- * - * bool enable_word_confidence = 15; - * @param value The enableWordConfidence to set. - * @return This builder for chaining. - */ - public Builder setEnableWordConfidence(boolean value) { - - enableWordConfidence_ = value; - onChanged(); - return this; - } - /** - *
-     * If `true`, the top result includes a list of words and the
-     * confidence for those words. If `false`, no word-level confidence
-     * information is returned. The default is `false`.
-     * 
- * - * bool enable_word_confidence = 15; - * @return This builder for chaining. - */ - public Builder clearEnableWordConfidence() { - - enableWordConfidence_ = false; - onChanged(); - return this; - } - - private boolean enableAutomaticPunctuation_ ; - /** - *
-     * If 'true', adds punctuation to recognition result hypotheses.
-     * This feature is only available in select languages. Setting this for
-     * requests in other languages has no effect at all.
-     * The default 'false' value does not add punctuation to result hypotheses.
-     * 
- * - * bool enable_automatic_punctuation = 11; - * @return The enableAutomaticPunctuation. - */ - @java.lang.Override - public boolean getEnableAutomaticPunctuation() { - return enableAutomaticPunctuation_; - } - /** - *
-     * If 'true', adds punctuation to recognition result hypotheses.
-     * This feature is only available in select languages. Setting this for
-     * requests in other languages has no effect at all.
-     * The default 'false' value does not add punctuation to result hypotheses.
-     * 
- * - * bool enable_automatic_punctuation = 11; - * @param value The enableAutomaticPunctuation to set. - * @return This builder for chaining. - */ - public Builder setEnableAutomaticPunctuation(boolean value) { - - enableAutomaticPunctuation_ = value; - onChanged(); - return this; - } - /** - *
-     * If 'true', adds punctuation to recognition result hypotheses.
-     * This feature is only available in select languages. Setting this for
-     * requests in other languages has no effect at all.
-     * The default 'false' value does not add punctuation to result hypotheses.
-     * 
- * - * bool enable_automatic_punctuation = 11; - * @return This builder for chaining. - */ - public Builder clearEnableAutomaticPunctuation() { - - enableAutomaticPunctuation_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.BoolValue enableSpokenPunctuation_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> enableSpokenPunctuationBuilder_; - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - * @return Whether the enableSpokenPunctuation field is set. - */ - public boolean hasEnableSpokenPunctuation() { - return enableSpokenPunctuationBuilder_ != null || enableSpokenPunctuation_ != null; - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - * @return The enableSpokenPunctuation. - */ - public com.google.protobuf.BoolValue getEnableSpokenPunctuation() { - if (enableSpokenPunctuationBuilder_ == null) { - return enableSpokenPunctuation_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenPunctuation_; - } else { - return enableSpokenPunctuationBuilder_.getMessage(); - } - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - public Builder setEnableSpokenPunctuation(com.google.protobuf.BoolValue value) { - if (enableSpokenPunctuationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - enableSpokenPunctuation_ = value; - onChanged(); - } else { - enableSpokenPunctuationBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - public Builder setEnableSpokenPunctuation( - com.google.protobuf.BoolValue.Builder builderForValue) { - if (enableSpokenPunctuationBuilder_ == null) { - enableSpokenPunctuation_ = builderForValue.build(); - onChanged(); - } else { - enableSpokenPunctuationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - public Builder mergeEnableSpokenPunctuation(com.google.protobuf.BoolValue value) { - if (enableSpokenPunctuationBuilder_ == null) { - if (enableSpokenPunctuation_ != null) { - enableSpokenPunctuation_ = - com.google.protobuf.BoolValue.newBuilder(enableSpokenPunctuation_).mergeFrom(value).buildPartial(); - } else { - enableSpokenPunctuation_ = value; - } - onChanged(); - } else { - enableSpokenPunctuationBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - public Builder clearEnableSpokenPunctuation() { - if (enableSpokenPunctuationBuilder_ == null) { - enableSpokenPunctuation_ = null; - onChanged(); - } else { - enableSpokenPunctuation_ = null; - enableSpokenPunctuationBuilder_ = null; - } - - return this; - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - public com.google.protobuf.BoolValue.Builder getEnableSpokenPunctuationBuilder() { - - onChanged(); - return getEnableSpokenPunctuationFieldBuilder().getBuilder(); - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - public com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilder() { - if (enableSpokenPunctuationBuilder_ != null) { - return enableSpokenPunctuationBuilder_.getMessageOrBuilder(); - } else { - return enableSpokenPunctuation_ == null ? - com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenPunctuation_; - } - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> - getEnableSpokenPunctuationFieldBuilder() { - if (enableSpokenPunctuationBuilder_ == null) { - enableSpokenPunctuationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder>( - getEnableSpokenPunctuation(), - getParentForChildren(), - isClean()); - enableSpokenPunctuation_ = null; - } - return enableSpokenPunctuationBuilder_; - } - - private com.google.protobuf.BoolValue enableSpokenEmojis_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> enableSpokenEmojisBuilder_; - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - * @return Whether the enableSpokenEmojis field is set. - */ - public boolean hasEnableSpokenEmojis() { - return enableSpokenEmojisBuilder_ != null || enableSpokenEmojis_ != null; - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - * @return The enableSpokenEmojis. - */ - public com.google.protobuf.BoolValue getEnableSpokenEmojis() { - if (enableSpokenEmojisBuilder_ == null) { - return enableSpokenEmojis_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenEmojis_; - } else { - return enableSpokenEmojisBuilder_.getMessage(); - } - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - public Builder setEnableSpokenEmojis(com.google.protobuf.BoolValue value) { - if (enableSpokenEmojisBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - enableSpokenEmojis_ = value; - onChanged(); - } else { - enableSpokenEmojisBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - public Builder setEnableSpokenEmojis( - com.google.protobuf.BoolValue.Builder builderForValue) { - if (enableSpokenEmojisBuilder_ == null) { - enableSpokenEmojis_ = builderForValue.build(); - onChanged(); - } else { - enableSpokenEmojisBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - public Builder mergeEnableSpokenEmojis(com.google.protobuf.BoolValue value) { - if (enableSpokenEmojisBuilder_ == null) { - if (enableSpokenEmojis_ != null) { - enableSpokenEmojis_ = - com.google.protobuf.BoolValue.newBuilder(enableSpokenEmojis_).mergeFrom(value).buildPartial(); - } else { - enableSpokenEmojis_ = value; - } - onChanged(); - } else { - enableSpokenEmojisBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - public Builder clearEnableSpokenEmojis() { - if (enableSpokenEmojisBuilder_ == null) { - enableSpokenEmojis_ = null; - onChanged(); - } else { - enableSpokenEmojis_ = null; - enableSpokenEmojisBuilder_ = null; - } - - return this; - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - public com.google.protobuf.BoolValue.Builder getEnableSpokenEmojisBuilder() { - - onChanged(); - return getEnableSpokenEmojisFieldBuilder().getBuilder(); - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - public com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder() { - if (enableSpokenEmojisBuilder_ != null) { - return enableSpokenEmojisBuilder_.getMessageOrBuilder(); - } else { - return enableSpokenEmojis_ == null ? - com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenEmojis_; - } - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> - getEnableSpokenEmojisFieldBuilder() { - if (enableSpokenEmojisBuilder_ == null) { - enableSpokenEmojisBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder>( - getEnableSpokenEmojis(), - getParentForChildren(), - isClean()); - enableSpokenEmojis_ = null; - } - return enableSpokenEmojisBuilder_; - } - - private com.google.cloud.speech.v1.SpeakerDiarizationConfig diarizationConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.SpeakerDiarizationConfig, com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder, com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder> diarizationConfigBuilder_; - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - * @return Whether the diarizationConfig field is set. - */ - public boolean hasDiarizationConfig() { - return diarizationConfigBuilder_ != null || diarizationConfig_ != null; - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - * @return The diarizationConfig. - */ - public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDiarizationConfig() { - if (diarizationConfigBuilder_ == null) { - return diarizationConfig_ == null ? com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance() : diarizationConfig_; - } else { - return diarizationConfigBuilder_.getMessage(); - } - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder setDiarizationConfig(com.google.cloud.speech.v1.SpeakerDiarizationConfig value) { - if (diarizationConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - diarizationConfig_ = value; - onChanged(); - } else { - diarizationConfigBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder setDiarizationConfig( - com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder builderForValue) { - if (diarizationConfigBuilder_ == null) { - diarizationConfig_ = builderForValue.build(); - onChanged(); - } else { - diarizationConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder mergeDiarizationConfig(com.google.cloud.speech.v1.SpeakerDiarizationConfig value) { - if (diarizationConfigBuilder_ == null) { - if (diarizationConfig_ != null) { - diarizationConfig_ = - com.google.cloud.speech.v1.SpeakerDiarizationConfig.newBuilder(diarizationConfig_).mergeFrom(value).buildPartial(); - } else { - diarizationConfig_ = value; - } - onChanged(); - } else { - diarizationConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder clearDiarizationConfig() { - if (diarizationConfigBuilder_ == null) { - diarizationConfig_ = null; - onChanged(); - } else { - diarizationConfig_ = null; - diarizationConfigBuilder_ = null; - } - - return this; - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - public com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder getDiarizationConfigBuilder() { - - onChanged(); - return getDiarizationConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - public com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder() { - if (diarizationConfigBuilder_ != null) { - return diarizationConfigBuilder_.getMessageOrBuilder(); - } else { - return diarizationConfig_ == null ? - com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance() : diarizationConfig_; - } - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.SpeakerDiarizationConfig, com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder, com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder> - getDiarizationConfigFieldBuilder() { - if (diarizationConfigBuilder_ == null) { - diarizationConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.SpeakerDiarizationConfig, com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder, com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder>( - getDiarizationConfig(), - getParentForChildren(), - isClean()); - diarizationConfig_ = null; - } - return diarizationConfigBuilder_; - } - - private com.google.cloud.speech.v1.RecognitionMetadata metadata_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionMetadata, com.google.cloud.speech.v1.RecognitionMetadata.Builder, com.google.cloud.speech.v1.RecognitionMetadataOrBuilder> metadataBuilder_; - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - * @return Whether the metadata field is set. - */ - public boolean hasMetadata() { - return metadataBuilder_ != null || metadata_ != null; - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - * @return The metadata. - */ - public com.google.cloud.speech.v1.RecognitionMetadata getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null ? com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance() : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - public Builder setMetadata(com.google.cloud.speech.v1.RecognitionMetadata value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - public Builder setMetadata( - com.google.cloud.speech.v1.RecognitionMetadata.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - public Builder mergeMetadata(com.google.cloud.speech.v1.RecognitionMetadata value) { - if (metadataBuilder_ == null) { - if (metadata_ != null) { - metadata_ = - com.google.cloud.speech.v1.RecognitionMetadata.newBuilder(metadata_).mergeFrom(value).buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadata_ = null; - metadataBuilder_ = null; - } - - return this; - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - public com.google.cloud.speech.v1.RecognitionMetadata.Builder getMetadataBuilder() { - - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - public com.google.cloud.speech.v1.RecognitionMetadataOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null ? - com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance() : metadata_; - } - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionMetadata, com.google.cloud.speech.v1.RecognitionMetadata.Builder, com.google.cloud.speech.v1.RecognitionMetadataOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionMetadata, com.google.cloud.speech.v1.RecognitionMetadata.Builder, com.google.cloud.speech.v1.RecognitionMetadataOrBuilder>( - getMetadata(), - getParentForChildren(), - isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private java.lang.Object model_ = ""; - /** - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_long</code></td>
-     *     <td>Best for long form content like media or conversation.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_short</code></td>
-     *     <td>Best for short form content like commands or single shot directed
-     *     speech.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_conversation</code></td>
-     *     <td>Best for audio that originated from a conversation between a
-     *         medical provider and patient.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_dictation</code></td>
-     *     <td>Best for audio that originated from dictation notes by a medical
-     *         provider.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * @return The model. - */ - public java.lang.String getModel() { - java.lang.Object ref = model_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - model_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_long</code></td>
-     *     <td>Best for long form content like media or conversation.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_short</code></td>
-     *     <td>Best for short form content like commands or single shot directed
-     *     speech.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_conversation</code></td>
-     *     <td>Best for audio that originated from a conversation between a
-     *         medical provider and patient.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_dictation</code></td>
-     *     <td>Best for audio that originated from dictation notes by a medical
-     *         provider.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * @return The bytes for model. - */ - public com.google.protobuf.ByteString - getModelBytes() { - java.lang.Object ref = model_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - model_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_long</code></td>
-     *     <td>Best for long form content like media or conversation.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_short</code></td>
-     *     <td>Best for short form content like commands or single shot directed
-     *     speech.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_conversation</code></td>
-     *     <td>Best for audio that originated from a conversation between a
-     *         medical provider and patient.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_dictation</code></td>
-     *     <td>Best for audio that originated from dictation notes by a medical
-     *         provider.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * @param value The model to set. - * @return This builder for chaining. - */ - public Builder setModel( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - model_ = value; - onChanged(); - return this; - } - /** - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_long</code></td>
-     *     <td>Best for long form content like media or conversation.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_short</code></td>
-     *     <td>Best for short form content like commands or single shot directed
-     *     speech.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_conversation</code></td>
-     *     <td>Best for audio that originated from a conversation between a
-     *         medical provider and patient.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_dictation</code></td>
-     *     <td>Best for audio that originated from dictation notes by a medical
-     *         provider.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * @return This builder for chaining. - */ - public Builder clearModel() { - - model_ = getDefaultInstance().getModel(); - onChanged(); - return this; - } - /** - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_long</code></td>
-     *     <td>Best for long form content like media or conversation.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_short</code></td>
-     *     <td>Best for short form content like commands or single shot directed
-     *     speech.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_conversation</code></td>
-     *     <td>Best for audio that originated from a conversation between a
-     *         medical provider and patient.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_dictation</code></td>
-     *     <td>Best for audio that originated from dictation notes by a medical
-     *         provider.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * @param value The bytes for model to set. - * @return This builder for chaining. - */ - public Builder setModelBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - model_ = value; - onChanged(); - return this; - } - - private boolean useEnhanced_ ; - /** - *
-     * Set to true to use an enhanced model for speech recognition.
-     * If `use_enhanced` is set to true and the `model` field is not set, then
-     * an appropriate enhanced model is chosen if an enhanced model exists for
-     * the audio.
-     * If `use_enhanced` is true and an enhanced version of the specified model
-     * does not exist, then the speech is recognized using the standard version
-     * of the specified model.
-     * 
- * - * bool use_enhanced = 14; - * @return The useEnhanced. - */ - @java.lang.Override - public boolean getUseEnhanced() { - return useEnhanced_; - } - /** - *
-     * Set to true to use an enhanced model for speech recognition.
-     * If `use_enhanced` is set to true and the `model` field is not set, then
-     * an appropriate enhanced model is chosen if an enhanced model exists for
-     * the audio.
-     * If `use_enhanced` is true and an enhanced version of the specified model
-     * does not exist, then the speech is recognized using the standard version
-     * of the specified model.
-     * 
- * - * bool use_enhanced = 14; - * @param value The useEnhanced to set. - * @return This builder for chaining. - */ - public Builder setUseEnhanced(boolean value) { - - useEnhanced_ = value; - onChanged(); - return this; - } - /** - *
-     * Set to true to use an enhanced model for speech recognition.
-     * If `use_enhanced` is set to true and the `model` field is not set, then
-     * an appropriate enhanced model is chosen if an enhanced model exists for
-     * the audio.
-     * If `use_enhanced` is true and an enhanced version of the specified model
-     * does not exist, then the speech is recognized using the standard version
-     * of the specified model.
-     * 
- * - * bool use_enhanced = 14; - * @return This builder for chaining. - */ - public Builder clearUseEnhanced() { - - useEnhanced_ = false; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.RecognitionConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionConfig) - private static final com.google.cloud.speech.v1.RecognitionConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognitionConfig(); - } - - public static com.google.cloud.speech.v1.RecognitionConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognitionConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java deleted file mode 100644 index a07304d06265..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionConfigOrBuilder.java +++ /dev/null @@ -1,660 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface RecognitionConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognitionConfig) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * @return The enum numeric value on the wire for encoding. - */ - int getEncodingValue(); - /** - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig.AudioEncoding encoding = 1; - * @return The encoding. - */ - com.google.cloud.speech.v1.RecognitionConfig.AudioEncoding getEncoding(); - - /** - *
-   * Sample rate in Hertz of the audio data sent in all
-   * `RecognitionAudio` messages. Valid values are: 8000-48000.
-   * 16000 is optimal. For best results, set the sampling rate of the audio
-   * source to 16000 Hz. If that's not possible, use the native sample rate of
-   * the audio source (instead of re-sampling).
-   * This field is optional for FLAC and WAV audio files, but is
-   * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding].
-   * 
- * - * int32 sample_rate_hertz = 2; - * @return The sampleRateHertz. - */ - int getSampleRateHertz(); - - /** - *
-   * The number of channels in the input audio data.
-   * ONLY set this for MULTI-CHANNEL recognition.
-   * Valid values for LINEAR16 and FLAC are `1`-`8`.
-   * Valid values for OGG_OPUS are '1'-'254'.
-   * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
-   * If `0` or omitted, defaults to one channel (mono).
-   * Note: We only recognize the first channel by default.
-   * To perform independent recognition on each channel set
-   * `enable_separate_recognition_per_channel` to 'true'.
-   * 
- * - * int32 audio_channel_count = 7; - * @return The audioChannelCount. - */ - int getAudioChannelCount(); - - /** - *
-   * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-   * to get each channel recognized separately. The recognition result will
-   * contain a `channel_tag` field to state which channel that result belongs
-   * to. If this is not true, we will only recognize the first channel. The
-   * request is billed cumulatively for all channels recognized:
-   * `audio_channel_count` multiplied by the length of the audio.
-   * 
- * - * bool enable_separate_recognition_per_channel = 12; - * @return The enableSeparateRecognitionPerChannel. - */ - boolean getEnableSeparateRecognitionPerChannel(); - - /** - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The languageCode. - */ - java.lang.String getLanguageCode(); - /** - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for languageCode. - */ - com.google.protobuf.ByteString - getLanguageCodeBytes(); - - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @return A list containing the alternativeLanguageCodes. - */ - java.util.List - getAlternativeLanguageCodesList(); - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @return The count of alternativeLanguageCodes. - */ - int getAlternativeLanguageCodesCount(); - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index of the element to return. - * @return The alternativeLanguageCodes at the given index. - */ - java.lang.String getAlternativeLanguageCodes(int index); - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index of the value to return. - * @return The bytes of the alternativeLanguageCodes at the given index. - */ - com.google.protobuf.ByteString - getAlternativeLanguageCodesBytes(int index); - - /** - *
-   * Maximum number of recognition hypotheses to be returned.
-   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-   * within each `SpeechRecognitionResult`.
-   * The server may return fewer than `max_alternatives`.
-   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-   * one. If omitted, will return a maximum of one.
-   * 
- * - * int32 max_alternatives = 4; - * @return The maxAlternatives. - */ - int getMaxAlternatives(); - - /** - *
-   * If set to `true`, the server will attempt to filter out
-   * profanities, replacing all but the initial character in each filtered word
-   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-   * won't be filtered out.
-   * 
- * - * bool profanity_filter = 5; - * @return The profanityFilter. - */ - boolean getProfanityFilter(); - - /** - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-   * documentation.
-   * When speech adaptation is set it supersedes the `speech_contexts` field.
-   * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - * @return Whether the adaptation field is set. - */ - boolean hasAdaptation(); - /** - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-   * documentation.
-   * When speech adaptation is set it supersedes the `speech_contexts` field.
-   * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - * @return The adaptation. - */ - com.google.cloud.speech.v1.SpeechAdaptation getAdaptation(); - /** - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-   * documentation.
-   * When speech adaptation is set it supersedes the `speech_contexts` field.
-   * 
- * - * .google.cloud.speech.v1.SpeechAdaptation adaptation = 20; - */ - com.google.cloud.speech.v1.SpeechAdaptationOrBuilder getAdaptationOrBuilder(); - - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - java.util.List - getSpeechContextsList(); - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - com.google.cloud.speech.v1.SpeechContext getSpeechContexts(int index); - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - int getSpeechContextsCount(); - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - java.util.List - getSpeechContextsOrBuilderList(); - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechContext speech_contexts = 6; - */ - com.google.cloud.speech.v1.SpeechContextOrBuilder getSpeechContextsOrBuilder( - int index); - - /** - *
-   * If `true`, the top result includes a list of words and
-   * the start and end time offsets (timestamps) for those words. If
-   * `false`, no word-level time offset information is returned. The default is
-   * `false`.
-   * 
- * - * bool enable_word_time_offsets = 8; - * @return The enableWordTimeOffsets. - */ - boolean getEnableWordTimeOffsets(); - - /** - *
-   * If `true`, the top result includes a list of words and the
-   * confidence for those words. If `false`, no word-level confidence
-   * information is returned. The default is `false`.
-   * 
- * - * bool enable_word_confidence = 15; - * @return The enableWordConfidence. - */ - boolean getEnableWordConfidence(); - - /** - *
-   * If 'true', adds punctuation to recognition result hypotheses.
-   * This feature is only available in select languages. Setting this for
-   * requests in other languages has no effect at all.
-   * The default 'false' value does not add punctuation to result hypotheses.
-   * 
- * - * bool enable_automatic_punctuation = 11; - * @return The enableAutomaticPunctuation. - */ - boolean getEnableAutomaticPunctuation(); - - /** - *
-   * The spoken punctuation behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * e.g. command_and_search will enable spoken punctuation by default
-   * If 'true', replaces spoken punctuation with the corresponding symbols in
-   * the request. For example, "how are you question mark" becomes "how are
-   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-   * for support. If 'false', spoken punctuation is not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - * @return Whether the enableSpokenPunctuation field is set. - */ - boolean hasEnableSpokenPunctuation(); - /** - *
-   * The spoken punctuation behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * e.g. command_and_search will enable spoken punctuation by default
-   * If 'true', replaces spoken punctuation with the corresponding symbols in
-   * the request. For example, "how are you question mark" becomes "how are
-   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-   * for support. If 'false', spoken punctuation is not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - * @return The enableSpokenPunctuation. - */ - com.google.protobuf.BoolValue getEnableSpokenPunctuation(); - /** - *
-   * The spoken punctuation behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * e.g. command_and_search will enable spoken punctuation by default
-   * If 'true', replaces spoken punctuation with the corresponding symbols in
-   * the request. For example, "how are you question mark" becomes "how are
-   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-   * for support. If 'false', spoken punctuation is not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilder(); - - /** - *
-   * The spoken emoji behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * If 'true', adds spoken emoji formatting for the request. This will replace
-   * spoken emojis with the corresponding Unicode symbols in the final
-   * transcript. If 'false', spoken emojis are not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - * @return Whether the enableSpokenEmojis field is set. - */ - boolean hasEnableSpokenEmojis(); - /** - *
-   * The spoken emoji behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * If 'true', adds spoken emoji formatting for the request. This will replace
-   * spoken emojis with the corresponding Unicode symbols in the final
-   * transcript. If 'false', spoken emojis are not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - * @return The enableSpokenEmojis. - */ - com.google.protobuf.BoolValue getEnableSpokenEmojis(); - /** - *
-   * The spoken emoji behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * If 'true', adds spoken emoji formatting for the request. This will replace
-   * spoken emojis with the corresponding Unicode symbols in the final
-   * transcript. If 'false', spoken emojis are not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder(); - - /** - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - * @return Whether the diarizationConfig field is set. - */ - boolean hasDiarizationConfig(); - /** - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - * @return The diarizationConfig. - */ - com.google.cloud.speech.v1.SpeakerDiarizationConfig getDiarizationConfig(); - /** - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1.SpeakerDiarizationConfig diarization_config = 19; - */ - com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder(); - - /** - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - * @return Whether the metadata field is set. - */ - boolean hasMetadata(); - /** - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - * @return The metadata. - */ - com.google.cloud.speech.v1.RecognitionMetadata getMetadata(); - /** - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata metadata = 9; - */ - com.google.cloud.speech.v1.RecognitionMetadataOrBuilder getMetadataOrBuilder(); - - /** - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_long</code></td>
-   *     <td>Best for long form content like media or conversation.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_short</code></td>
-   *     <td>Best for short form content like commands or single shot directed
-   *     speech.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_conversation</code></td>
-   *     <td>Best for audio that originated from a conversation between a
-   *         medical provider and patient.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_dictation</code></td>
-   *     <td>Best for audio that originated from dictation notes by a medical
-   *         provider.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * @return The model. - */ - java.lang.String getModel(); - /** - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_long</code></td>
-   *     <td>Best for long form content like media or conversation.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_short</code></td>
-   *     <td>Best for short form content like commands or single shot directed
-   *     speech.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_conversation</code></td>
-   *     <td>Best for audio that originated from a conversation between a
-   *         medical provider and patient.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_dictation</code></td>
-   *     <td>Best for audio that originated from dictation notes by a medical
-   *         provider.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * @return The bytes for model. - */ - com.google.protobuf.ByteString - getModelBytes(); - - /** - *
-   * Set to true to use an enhanced model for speech recognition.
-   * If `use_enhanced` is set to true and the `model` field is not set, then
-   * an appropriate enhanced model is chosen if an enhanced model exists for
-   * the audio.
-   * If `use_enhanced` is true and an enhanced version of the specified model
-   * does not exist, then the speech is recognized using the standard version
-   * of the specified model.
-   * 
- * - * bool use_enhanced = 14; - * @return The useEnhanced. - */ - boolean getUseEnhanced(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadata.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadata.java deleted file mode 100644 index 5e39e8ad8a53..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadata.java +++ /dev/null @@ -1,2343 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Description of audio data to be recognized.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognitionMetadata} - */ -@java.lang.Deprecated public final class RecognitionMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognitionMetadata) - RecognitionMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use RecognitionMetadata.newBuilder() to construct. - private RecognitionMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RecognitionMetadata() { - interactionType_ = 0; - microphoneDistance_ = 0; - originalMediaType_ = 0; - recordingDeviceType_ = 0; - recordingDeviceName_ = ""; - originalMimeType_ = ""; - audioTopic_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RecognitionMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RecognitionMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - int rawValue = input.readEnum(); - - interactionType_ = rawValue; - break; - } - case 24: { - - industryNaicsCodeOfAudio_ = input.readUInt32(); - break; - } - case 32: { - int rawValue = input.readEnum(); - - microphoneDistance_ = rawValue; - break; - } - case 40: { - int rawValue = input.readEnum(); - - originalMediaType_ = rawValue; - break; - } - case 48: { - int rawValue = input.readEnum(); - - recordingDeviceType_ = rawValue; - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - recordingDeviceName_ = s; - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - originalMimeType_ = s; - break; - } - case 82: { - java.lang.String s = input.readStringRequireUtf8(); - - audioTopic_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognitionMetadata.class, com.google.cloud.speech.v1.RecognitionMetadata.Builder.class); - } - - /** - *
-   * Use case categories that the audio recognition request can be described
-   * by.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1.RecognitionMetadata.InteractionType} - */ - public enum InteractionType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * Use case is either unknown or is something other than one of the other
-     * values below.
-     * 
- * - * INTERACTION_TYPE_UNSPECIFIED = 0; - */ - INTERACTION_TYPE_UNSPECIFIED(0), - /** - *
-     * Multiple people in a conversation or discussion. For example in a
-     * meeting with two or more people actively participating. Typically
-     * all the primary people speaking would be in the same room (if not,
-     * see PHONE_CALL)
-     * 
- * - * DISCUSSION = 1; - */ - DISCUSSION(1), - /** - *
-     * One or more persons lecturing or presenting to others, mostly
-     * uninterrupted.
-     * 
- * - * PRESENTATION = 2; - */ - PRESENTATION(2), - /** - *
-     * A phone-call or video-conference in which two or more people, who are
-     * not in the same room, are actively participating.
-     * 
- * - * PHONE_CALL = 3; - */ - PHONE_CALL(3), - /** - *
-     * A recorded message intended for another person to listen to.
-     * 
- * - * VOICEMAIL = 4; - */ - VOICEMAIL(4), - /** - *
-     * Professionally produced audio (eg. TV Show, Podcast).
-     * 
- * - * PROFESSIONALLY_PRODUCED = 5; - */ - PROFESSIONALLY_PRODUCED(5), - /** - *
-     * Transcribe spoken questions and queries into text.
-     * 
- * - * VOICE_SEARCH = 6; - */ - VOICE_SEARCH(6), - /** - *
-     * Transcribe voice commands, such as for controlling a device.
-     * 
- * - * VOICE_COMMAND = 7; - */ - VOICE_COMMAND(7), - /** - *
-     * Transcribe speech to text to create a written document, such as a
-     * text-message, email or report.
-     * 
- * - * DICTATION = 8; - */ - DICTATION(8), - UNRECOGNIZED(-1), - ; - - /** - *
-     * Use case is either unknown or is something other than one of the other
-     * values below.
-     * 
- * - * INTERACTION_TYPE_UNSPECIFIED = 0; - */ - public static final int INTERACTION_TYPE_UNSPECIFIED_VALUE = 0; - /** - *
-     * Multiple people in a conversation or discussion. For example in a
-     * meeting with two or more people actively participating. Typically
-     * all the primary people speaking would be in the same room (if not,
-     * see PHONE_CALL)
-     * 
- * - * DISCUSSION = 1; - */ - public static final int DISCUSSION_VALUE = 1; - /** - *
-     * One or more persons lecturing or presenting to others, mostly
-     * uninterrupted.
-     * 
- * - * PRESENTATION = 2; - */ - public static final int PRESENTATION_VALUE = 2; - /** - *
-     * A phone-call or video-conference in which two or more people, who are
-     * not in the same room, are actively participating.
-     * 
- * - * PHONE_CALL = 3; - */ - public static final int PHONE_CALL_VALUE = 3; - /** - *
-     * A recorded message intended for another person to listen to.
-     * 
- * - * VOICEMAIL = 4; - */ - public static final int VOICEMAIL_VALUE = 4; - /** - *
-     * Professionally produced audio (eg. TV Show, Podcast).
-     * 
- * - * PROFESSIONALLY_PRODUCED = 5; - */ - public static final int PROFESSIONALLY_PRODUCED_VALUE = 5; - /** - *
-     * Transcribe spoken questions and queries into text.
-     * 
- * - * VOICE_SEARCH = 6; - */ - public static final int VOICE_SEARCH_VALUE = 6; - /** - *
-     * Transcribe voice commands, such as for controlling a device.
-     * 
- * - * VOICE_COMMAND = 7; - */ - public static final int VOICE_COMMAND_VALUE = 7; - /** - *
-     * Transcribe speech to text to create a written document, such as a
-     * text-message, email or report.
-     * 
- * - * DICTATION = 8; - */ - public static final int DICTATION_VALUE = 8; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static InteractionType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static InteractionType forNumber(int value) { - switch (value) { - case 0: return INTERACTION_TYPE_UNSPECIFIED; - case 1: return DISCUSSION; - case 2: return PRESENTATION; - case 3: return PHONE_CALL; - case 4: return VOICEMAIL; - case 5: return PROFESSIONALLY_PRODUCED; - case 6: return VOICE_SEARCH; - case 7: return VOICE_COMMAND; - case 8: return DICTATION; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - InteractionType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public InteractionType findValueByNumber(int number) { - return InteractionType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.cloud.speech.v1.RecognitionMetadata.getDescriptor().getEnumTypes().get(0); - } - - private static final InteractionType[] VALUES = values(); - - public static InteractionType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private InteractionType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionMetadata.InteractionType) - } - - /** - *
-   * Enumerates the types of capture settings describing an audio file.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance} - */ - public enum MicrophoneDistance - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * Audio type is not known.
-     * 
- * - * MICROPHONE_DISTANCE_UNSPECIFIED = 0; - */ - MICROPHONE_DISTANCE_UNSPECIFIED(0), - /** - *
-     * The audio was captured from a closely placed microphone. Eg. phone,
-     * dictaphone, or handheld microphone. Generally if there speaker is within
-     * 1 meter of the microphone.
-     * 
- * - * NEARFIELD = 1; - */ - NEARFIELD(1), - /** - *
-     * The speaker if within 3 meters of the microphone.
-     * 
- * - * MIDFIELD = 2; - */ - MIDFIELD(2), - /** - *
-     * The speaker is more than 3 meters away from the microphone.
-     * 
- * - * FARFIELD = 3; - */ - FARFIELD(3), - UNRECOGNIZED(-1), - ; - - /** - *
-     * Audio type is not known.
-     * 
- * - * MICROPHONE_DISTANCE_UNSPECIFIED = 0; - */ - public static final int MICROPHONE_DISTANCE_UNSPECIFIED_VALUE = 0; - /** - *
-     * The audio was captured from a closely placed microphone. Eg. phone,
-     * dictaphone, or handheld microphone. Generally if there speaker is within
-     * 1 meter of the microphone.
-     * 
- * - * NEARFIELD = 1; - */ - public static final int NEARFIELD_VALUE = 1; - /** - *
-     * The speaker if within 3 meters of the microphone.
-     * 
- * - * MIDFIELD = 2; - */ - public static final int MIDFIELD_VALUE = 2; - /** - *
-     * The speaker is more than 3 meters away from the microphone.
-     * 
- * - * FARFIELD = 3; - */ - public static final int FARFIELD_VALUE = 3; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static MicrophoneDistance valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static MicrophoneDistance forNumber(int value) { - switch (value) { - case 0: return MICROPHONE_DISTANCE_UNSPECIFIED; - case 1: return NEARFIELD; - case 2: return MIDFIELD; - case 3: return FARFIELD; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - MicrophoneDistance> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public MicrophoneDistance findValueByNumber(int number) { - return MicrophoneDistance.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.cloud.speech.v1.RecognitionMetadata.getDescriptor().getEnumTypes().get(1); - } - - private static final MicrophoneDistance[] VALUES = values(); - - public static MicrophoneDistance valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private MicrophoneDistance(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance) - } - - /** - *
-   * The original media the speech was recorded on.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType} - */ - public enum OriginalMediaType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * Unknown original media type.
-     * 
- * - * ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - */ - ORIGINAL_MEDIA_TYPE_UNSPECIFIED(0), - /** - *
-     * The speech data is an audio recording.
-     * 
- * - * AUDIO = 1; - */ - AUDIO(1), - /** - *
-     * The speech data originally recorded on a video.
-     * 
- * - * VIDEO = 2; - */ - VIDEO(2), - UNRECOGNIZED(-1), - ; - - /** - *
-     * Unknown original media type.
-     * 
- * - * ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - */ - public static final int ORIGINAL_MEDIA_TYPE_UNSPECIFIED_VALUE = 0; - /** - *
-     * The speech data is an audio recording.
-     * 
- * - * AUDIO = 1; - */ - public static final int AUDIO_VALUE = 1; - /** - *
-     * The speech data originally recorded on a video.
-     * 
- * - * VIDEO = 2; - */ - public static final int VIDEO_VALUE = 2; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OriginalMediaType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static OriginalMediaType forNumber(int value) { - switch (value) { - case 0: return ORIGINAL_MEDIA_TYPE_UNSPECIFIED; - case 1: return AUDIO; - case 2: return VIDEO; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - OriginalMediaType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public OriginalMediaType findValueByNumber(int number) { - return OriginalMediaType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.cloud.speech.v1.RecognitionMetadata.getDescriptor().getEnumTypes().get(2); - } - - private static final OriginalMediaType[] VALUES = values(); - - public static OriginalMediaType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private OriginalMediaType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType) - } - - /** - *
-   * The type of device the speech was recorded with.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType} - */ - public enum RecordingDeviceType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * The recording device is unknown.
-     * 
- * - * RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - */ - RECORDING_DEVICE_TYPE_UNSPECIFIED(0), - /** - *
-     * Speech was recorded on a smartphone.
-     * 
- * - * SMARTPHONE = 1; - */ - SMARTPHONE(1), - /** - *
-     * Speech was recorded using a personal computer or tablet.
-     * 
- * - * PC = 2; - */ - PC(2), - /** - *
-     * Speech was recorded over a phone line.
-     * 
- * - * PHONE_LINE = 3; - */ - PHONE_LINE(3), - /** - *
-     * Speech was recorded in a vehicle.
-     * 
- * - * VEHICLE = 4; - */ - VEHICLE(4), - /** - *
-     * Speech was recorded outdoors.
-     * 
- * - * OTHER_OUTDOOR_DEVICE = 5; - */ - OTHER_OUTDOOR_DEVICE(5), - /** - *
-     * Speech was recorded indoors.
-     * 
- * - * OTHER_INDOOR_DEVICE = 6; - */ - OTHER_INDOOR_DEVICE(6), - UNRECOGNIZED(-1), - ; - - /** - *
-     * The recording device is unknown.
-     * 
- * - * RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - */ - public static final int RECORDING_DEVICE_TYPE_UNSPECIFIED_VALUE = 0; - /** - *
-     * Speech was recorded on a smartphone.
-     * 
- * - * SMARTPHONE = 1; - */ - public static final int SMARTPHONE_VALUE = 1; - /** - *
-     * Speech was recorded using a personal computer or tablet.
-     * 
- * - * PC = 2; - */ - public static final int PC_VALUE = 2; - /** - *
-     * Speech was recorded over a phone line.
-     * 
- * - * PHONE_LINE = 3; - */ - public static final int PHONE_LINE_VALUE = 3; - /** - *
-     * Speech was recorded in a vehicle.
-     * 
- * - * VEHICLE = 4; - */ - public static final int VEHICLE_VALUE = 4; - /** - *
-     * Speech was recorded outdoors.
-     * 
- * - * OTHER_OUTDOOR_DEVICE = 5; - */ - public static final int OTHER_OUTDOOR_DEVICE_VALUE = 5; - /** - *
-     * Speech was recorded indoors.
-     * 
- * - * OTHER_INDOOR_DEVICE = 6; - */ - public static final int OTHER_INDOOR_DEVICE_VALUE = 6; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static RecordingDeviceType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static RecordingDeviceType forNumber(int value) { - switch (value) { - case 0: return RECORDING_DEVICE_TYPE_UNSPECIFIED; - case 1: return SMARTPHONE; - case 2: return PC; - case 3: return PHONE_LINE; - case 4: return VEHICLE; - case 5: return OTHER_OUTDOOR_DEVICE; - case 6: return OTHER_INDOOR_DEVICE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - RecordingDeviceType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public RecordingDeviceType findValueByNumber(int number) { - return RecordingDeviceType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.cloud.speech.v1.RecognitionMetadata.getDescriptor().getEnumTypes().get(3); - } - - private static final RecordingDeviceType[] VALUES = values(); - - public static RecordingDeviceType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private RecordingDeviceType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType) - } - - public static final int INTERACTION_TYPE_FIELD_NUMBER = 1; - private int interactionType_; - /** - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return The enum numeric value on the wire for interactionType. - */ - @java.lang.Override public int getInteractionTypeValue() { - return interactionType_; - } - /** - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return The interactionType. - */ - @java.lang.Override public com.google.cloud.speech.v1.RecognitionMetadata.InteractionType getInteractionType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.InteractionType result = com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.valueOf(interactionType_); - return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.UNRECOGNIZED : result; - } - - public static final int INDUSTRY_NAICS_CODE_OF_AUDIO_FIELD_NUMBER = 3; - private int industryNaicsCodeOfAudio_; - /** - *
-   * The industry vertical to which this speech recognition request most
-   * closely applies. This is most indicative of the topics contained
-   * in the audio.  Use the 6-digit NAICS code to identify the industry
-   * vertical - see https://www.naics.com/search/.
-   * 
- * - * uint32 industry_naics_code_of_audio = 3; - * @return The industryNaicsCodeOfAudio. - */ - @java.lang.Override - public int getIndustryNaicsCodeOfAudio() { - return industryNaicsCodeOfAudio_; - } - - public static final int MICROPHONE_DISTANCE_FIELD_NUMBER = 4; - private int microphoneDistance_; - /** - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return The enum numeric value on the wire for microphoneDistance. - */ - @java.lang.Override public int getMicrophoneDistanceValue() { - return microphoneDistance_; - } - /** - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return The microphoneDistance. - */ - @java.lang.Override public com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance result = com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.valueOf(microphoneDistance_); - return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.UNRECOGNIZED : result; - } - - public static final int ORIGINAL_MEDIA_TYPE_FIELD_NUMBER = 5; - private int originalMediaType_; - /** - *
-   * The original media the speech was recorded on.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return The enum numeric value on the wire for originalMediaType. - */ - @java.lang.Override public int getOriginalMediaTypeValue() { - return originalMediaType_; - } - /** - *
-   * The original media the speech was recorded on.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return The originalMediaType. - */ - @java.lang.Override public com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType getOriginalMediaType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType result = com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.valueOf(originalMediaType_); - return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.UNRECOGNIZED : result; - } - - public static final int RECORDING_DEVICE_TYPE_FIELD_NUMBER = 6; - private int recordingDeviceType_; - /** - *
-   * The type of device the speech was recorded with.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return The enum numeric value on the wire for recordingDeviceType. - */ - @java.lang.Override public int getRecordingDeviceTypeValue() { - return recordingDeviceType_; - } - /** - *
-   * The type of device the speech was recorded with.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return The recordingDeviceType. - */ - @java.lang.Override public com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType result = com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.valueOf(recordingDeviceType_); - return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.UNRECOGNIZED : result; - } - - public static final int RECORDING_DEVICE_NAME_FIELD_NUMBER = 7; - private volatile java.lang.Object recordingDeviceName_; - /** - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * @return The recordingDeviceName. - */ - @java.lang.Override - public java.lang.String getRecordingDeviceName() { - java.lang.Object ref = recordingDeviceName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - recordingDeviceName_ = s; - return s; - } - } - /** - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * @return The bytes for recordingDeviceName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getRecordingDeviceNameBytes() { - java.lang.Object ref = recordingDeviceName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - recordingDeviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORIGINAL_MIME_TYPE_FIELD_NUMBER = 8; - private volatile java.lang.Object originalMimeType_; - /** - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * @return The originalMimeType. - */ - @java.lang.Override - public java.lang.String getOriginalMimeType() { - java.lang.Object ref = originalMimeType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - originalMimeType_ = s; - return s; - } - } - /** - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * @return The bytes for originalMimeType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOriginalMimeTypeBytes() { - java.lang.Object ref = originalMimeType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - originalMimeType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int AUDIO_TOPIC_FIELD_NUMBER = 10; - private volatile java.lang.Object audioTopic_; - /** - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * @return The audioTopic. - */ - @java.lang.Override - public java.lang.String getAudioTopic() { - java.lang.Object ref = audioTopic_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - audioTopic_ = s; - return s; - } - } - /** - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * @return The bytes for audioTopic. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAudioTopicBytes() { - java.lang.Object ref = audioTopic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - audioTopic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (interactionType_ != com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.INTERACTION_TYPE_UNSPECIFIED.getNumber()) { - output.writeEnum(1, interactionType_); - } - if (industryNaicsCodeOfAudio_ != 0) { - output.writeUInt32(3, industryNaicsCodeOfAudio_); - } - if (microphoneDistance_ != com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.MICROPHONE_DISTANCE_UNSPECIFIED.getNumber()) { - output.writeEnum(4, microphoneDistance_); - } - if (originalMediaType_ != com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.ORIGINAL_MEDIA_TYPE_UNSPECIFIED.getNumber()) { - output.writeEnum(5, originalMediaType_); - } - if (recordingDeviceType_ != com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.RECORDING_DEVICE_TYPE_UNSPECIFIED.getNumber()) { - output.writeEnum(6, recordingDeviceType_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordingDeviceName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, recordingDeviceName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalMimeType_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, originalMimeType_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audioTopic_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, audioTopic_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (interactionType_ != com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.INTERACTION_TYPE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, interactionType_); - } - if (industryNaicsCodeOfAudio_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(3, industryNaicsCodeOfAudio_); - } - if (microphoneDistance_ != com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.MICROPHONE_DISTANCE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, microphoneDistance_); - } - if (originalMediaType_ != com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.ORIGINAL_MEDIA_TYPE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(5, originalMediaType_); - } - if (recordingDeviceType_ != com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.RECORDING_DEVICE_TYPE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(6, recordingDeviceType_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordingDeviceName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, recordingDeviceName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalMimeType_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, originalMimeType_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audioTopic_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, audioTopic_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.RecognitionMetadata)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.RecognitionMetadata other = (com.google.cloud.speech.v1.RecognitionMetadata) obj; - - if (interactionType_ != other.interactionType_) return false; - if (getIndustryNaicsCodeOfAudio() - != other.getIndustryNaicsCodeOfAudio()) return false; - if (microphoneDistance_ != other.microphoneDistance_) return false; - if (originalMediaType_ != other.originalMediaType_) return false; - if (recordingDeviceType_ != other.recordingDeviceType_) return false; - if (!getRecordingDeviceName() - .equals(other.getRecordingDeviceName())) return false; - if (!getOriginalMimeType() - .equals(other.getOriginalMimeType())) return false; - if (!getAudioTopic() - .equals(other.getAudioTopic())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + INTERACTION_TYPE_FIELD_NUMBER; - hash = (53 * hash) + interactionType_; - hash = (37 * hash) + INDUSTRY_NAICS_CODE_OF_AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getIndustryNaicsCodeOfAudio(); - hash = (37 * hash) + MICROPHONE_DISTANCE_FIELD_NUMBER; - hash = (53 * hash) + microphoneDistance_; - hash = (37 * hash) + ORIGINAL_MEDIA_TYPE_FIELD_NUMBER; - hash = (53 * hash) + originalMediaType_; - hash = (37 * hash) + RECORDING_DEVICE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + recordingDeviceType_; - hash = (37 * hash) + RECORDING_DEVICE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getRecordingDeviceName().hashCode(); - hash = (37 * hash) + ORIGINAL_MIME_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getOriginalMimeType().hashCode(); - hash = (37 * hash) + AUDIO_TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getAudioTopic().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognitionMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognitionMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.RecognitionMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Description of audio data to be recognized.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognitionMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognitionMetadata) - com.google.cloud.speech.v1.RecognitionMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognitionMetadata.class, com.google.cloud.speech.v1.RecognitionMetadata.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.RecognitionMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - interactionType_ = 0; - - industryNaicsCodeOfAudio_ = 0; - - microphoneDistance_ = 0; - - originalMediaType_ = 0; - - recordingDeviceType_ = 0; - - recordingDeviceName_ = ""; - - originalMimeType_ = ""; - - audioTopic_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognitionMetadata_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata getDefaultInstanceForType() { - return com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata build() { - com.google.cloud.speech.v1.RecognitionMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata buildPartial() { - com.google.cloud.speech.v1.RecognitionMetadata result = new com.google.cloud.speech.v1.RecognitionMetadata(this); - result.interactionType_ = interactionType_; - result.industryNaicsCodeOfAudio_ = industryNaicsCodeOfAudio_; - result.microphoneDistance_ = microphoneDistance_; - result.originalMediaType_ = originalMediaType_; - result.recordingDeviceType_ = recordingDeviceType_; - result.recordingDeviceName_ = recordingDeviceName_; - result.originalMimeType_ = originalMimeType_; - result.audioTopic_ = audioTopic_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.RecognitionMetadata) { - return mergeFrom((com.google.cloud.speech.v1.RecognitionMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.RecognitionMetadata other) { - if (other == com.google.cloud.speech.v1.RecognitionMetadata.getDefaultInstance()) return this; - if (other.interactionType_ != 0) { - setInteractionTypeValue(other.getInteractionTypeValue()); - } - if (other.getIndustryNaicsCodeOfAudio() != 0) { - setIndustryNaicsCodeOfAudio(other.getIndustryNaicsCodeOfAudio()); - } - if (other.microphoneDistance_ != 0) { - setMicrophoneDistanceValue(other.getMicrophoneDistanceValue()); - } - if (other.originalMediaType_ != 0) { - setOriginalMediaTypeValue(other.getOriginalMediaTypeValue()); - } - if (other.recordingDeviceType_ != 0) { - setRecordingDeviceTypeValue(other.getRecordingDeviceTypeValue()); - } - if (!other.getRecordingDeviceName().isEmpty()) { - recordingDeviceName_ = other.recordingDeviceName_; - onChanged(); - } - if (!other.getOriginalMimeType().isEmpty()) { - originalMimeType_ = other.originalMimeType_; - onChanged(); - } - if (!other.getAudioTopic().isEmpty()) { - audioTopic_ = other.audioTopic_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.RecognitionMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.RecognitionMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int interactionType_ = 0; - /** - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return The enum numeric value on the wire for interactionType. - */ - @java.lang.Override public int getInteractionTypeValue() { - return interactionType_; - } - /** - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * @param value The enum numeric value on the wire for interactionType to set. - * @return This builder for chaining. - */ - public Builder setInteractionTypeValue(int value) { - - interactionType_ = value; - onChanged(); - return this; - } - /** - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return The interactionType. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata.InteractionType getInteractionType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.InteractionType result = com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.valueOf(interactionType_); - return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.InteractionType.UNRECOGNIZED : result; - } - /** - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * @param value The interactionType to set. - * @return This builder for chaining. - */ - public Builder setInteractionType(com.google.cloud.speech.v1.RecognitionMetadata.InteractionType value) { - if (value == null) { - throw new NullPointerException(); - } - - interactionType_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return This builder for chaining. - */ - public Builder clearInteractionType() { - - interactionType_ = 0; - onChanged(); - return this; - } - - private int industryNaicsCodeOfAudio_ ; - /** - *
-     * The industry vertical to which this speech recognition request most
-     * closely applies. This is most indicative of the topics contained
-     * in the audio.  Use the 6-digit NAICS code to identify the industry
-     * vertical - see https://www.naics.com/search/.
-     * 
- * - * uint32 industry_naics_code_of_audio = 3; - * @return The industryNaicsCodeOfAudio. - */ - @java.lang.Override - public int getIndustryNaicsCodeOfAudio() { - return industryNaicsCodeOfAudio_; - } - /** - *
-     * The industry vertical to which this speech recognition request most
-     * closely applies. This is most indicative of the topics contained
-     * in the audio.  Use the 6-digit NAICS code to identify the industry
-     * vertical - see https://www.naics.com/search/.
-     * 
- * - * uint32 industry_naics_code_of_audio = 3; - * @param value The industryNaicsCodeOfAudio to set. - * @return This builder for chaining. - */ - public Builder setIndustryNaicsCodeOfAudio(int value) { - - industryNaicsCodeOfAudio_ = value; - onChanged(); - return this; - } - /** - *
-     * The industry vertical to which this speech recognition request most
-     * closely applies. This is most indicative of the topics contained
-     * in the audio.  Use the 6-digit NAICS code to identify the industry
-     * vertical - see https://www.naics.com/search/.
-     * 
- * - * uint32 industry_naics_code_of_audio = 3; - * @return This builder for chaining. - */ - public Builder clearIndustryNaicsCodeOfAudio() { - - industryNaicsCodeOfAudio_ = 0; - onChanged(); - return this; - } - - private int microphoneDistance_ = 0; - /** - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return The enum numeric value on the wire for microphoneDistance. - */ - @java.lang.Override public int getMicrophoneDistanceValue() { - return microphoneDistance_; - } - /** - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @param value The enum numeric value on the wire for microphoneDistance to set. - * @return This builder for chaining. - */ - public Builder setMicrophoneDistanceValue(int value) { - - microphoneDistance_ = value; - onChanged(); - return this; - } - /** - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return The microphoneDistance. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance result = com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.valueOf(microphoneDistance_); - return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance.UNRECOGNIZED : result; - } - /** - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @param value The microphoneDistance to set. - * @return This builder for chaining. - */ - public Builder setMicrophoneDistance(com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance value) { - if (value == null) { - throw new NullPointerException(); - } - - microphoneDistance_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return This builder for chaining. - */ - public Builder clearMicrophoneDistance() { - - microphoneDistance_ = 0; - onChanged(); - return this; - } - - private int originalMediaType_ = 0; - /** - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return The enum numeric value on the wire for originalMediaType. - */ - @java.lang.Override public int getOriginalMediaTypeValue() { - return originalMediaType_; - } - /** - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @param value The enum numeric value on the wire for originalMediaType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMediaTypeValue(int value) { - - originalMediaType_ = value; - onChanged(); - return this; - } - /** - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return The originalMediaType. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType getOriginalMediaType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType result = com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.valueOf(originalMediaType_); - return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType.UNRECOGNIZED : result; - } - /** - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @param value The originalMediaType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMediaType(com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType value) { - if (value == null) { - throw new NullPointerException(); - } - - originalMediaType_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return This builder for chaining. - */ - public Builder clearOriginalMediaType() { - - originalMediaType_ = 0; - onChanged(); - return this; - } - - private int recordingDeviceType_ = 0; - /** - *
-     * The type of device the speech was recorded with.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return The enum numeric value on the wire for recordingDeviceType. - */ - @java.lang.Override public int getRecordingDeviceTypeValue() { - return recordingDeviceType_; - } - /** - *
-     * The type of device the speech was recorded with.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @param value The enum numeric value on the wire for recordingDeviceType to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceTypeValue(int value) { - - recordingDeviceType_ = value; - onChanged(); - return this; - } - /** - *
-     * The type of device the speech was recorded with.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return The recordingDeviceType. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType result = com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.valueOf(recordingDeviceType_); - return result == null ? com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType.UNRECOGNIZED : result; - } - /** - *
-     * The type of device the speech was recorded with.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @param value The recordingDeviceType to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceType(com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType value) { - if (value == null) { - throw new NullPointerException(); - } - - recordingDeviceType_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-     * The type of device the speech was recorded with.
-     * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return This builder for chaining. - */ - public Builder clearRecordingDeviceType() { - - recordingDeviceType_ = 0; - onChanged(); - return this; - } - - private java.lang.Object recordingDeviceName_ = ""; - /** - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * @return The recordingDeviceName. - */ - public java.lang.String getRecordingDeviceName() { - java.lang.Object ref = recordingDeviceName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - recordingDeviceName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * @return The bytes for recordingDeviceName. - */ - public com.google.protobuf.ByteString - getRecordingDeviceNameBytes() { - java.lang.Object ref = recordingDeviceName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - recordingDeviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * @param value The recordingDeviceName to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - recordingDeviceName_ = value; - onChanged(); - return this; - } - /** - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * @return This builder for chaining. - */ - public Builder clearRecordingDeviceName() { - - recordingDeviceName_ = getDefaultInstance().getRecordingDeviceName(); - onChanged(); - return this; - } - /** - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * @param value The bytes for recordingDeviceName to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - recordingDeviceName_ = value; - onChanged(); - return this; - } - - private java.lang.Object originalMimeType_ = ""; - /** - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * @return The originalMimeType. - */ - public java.lang.String getOriginalMimeType() { - java.lang.Object ref = originalMimeType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - originalMimeType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * @return The bytes for originalMimeType. - */ - public com.google.protobuf.ByteString - getOriginalMimeTypeBytes() { - java.lang.Object ref = originalMimeType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - originalMimeType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * @param value The originalMimeType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMimeType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - originalMimeType_ = value; - onChanged(); - return this; - } - /** - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * @return This builder for chaining. - */ - public Builder clearOriginalMimeType() { - - originalMimeType_ = getDefaultInstance().getOriginalMimeType(); - onChanged(); - return this; - } - /** - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * @param value The bytes for originalMimeType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMimeTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - originalMimeType_ = value; - onChanged(); - return this; - } - - private java.lang.Object audioTopic_ = ""; - /** - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * @return The audioTopic. - */ - public java.lang.String getAudioTopic() { - java.lang.Object ref = audioTopic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - audioTopic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * @return The bytes for audioTopic. - */ - public com.google.protobuf.ByteString - getAudioTopicBytes() { - java.lang.Object ref = audioTopic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - audioTopic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * @param value The audioTopic to set. - * @return This builder for chaining. - */ - public Builder setAudioTopic( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - audioTopic_ = value; - onChanged(); - return this; - } - /** - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * @return This builder for chaining. - */ - public Builder clearAudioTopic() { - - audioTopic_ = getDefaultInstance().getAudioTopic(); - onChanged(); - return this; - } - /** - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * @param value The bytes for audioTopic to set. - * @return This builder for chaining. - */ - public Builder setAudioTopicBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - audioTopic_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.RecognitionMetadata) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionMetadata) - private static final com.google.cloud.speech.v1.RecognitionMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognitionMetadata(); - } - - public static com.google.cloud.speech.v1.RecognitionMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognitionMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionMetadata(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadataOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadataOrBuilder.java deleted file mode 100644 index 5b3a0073fc09..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognitionMetadataOrBuilder.java +++ /dev/null @@ -1,170 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -@java.lang.Deprecated public interface RecognitionMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognitionMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return The enum numeric value on the wire for interactionType. - */ - int getInteractionTypeValue(); - /** - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return The interactionType. - */ - com.google.cloud.speech.v1.RecognitionMetadata.InteractionType getInteractionType(); - - /** - *
-   * The industry vertical to which this speech recognition request most
-   * closely applies. This is most indicative of the topics contained
-   * in the audio.  Use the 6-digit NAICS code to identify the industry
-   * vertical - see https://www.naics.com/search/.
-   * 
- * - * uint32 industry_naics_code_of_audio = 3; - * @return The industryNaicsCodeOfAudio. - */ - int getIndustryNaicsCodeOfAudio(); - - /** - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return The enum numeric value on the wire for microphoneDistance. - */ - int getMicrophoneDistanceValue(); - /** - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return The microphoneDistance. - */ - com.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance(); - - /** - *
-   * The original media the speech was recorded on.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return The enum numeric value on the wire for originalMediaType. - */ - int getOriginalMediaTypeValue(); - /** - *
-   * The original media the speech was recorded on.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return The originalMediaType. - */ - com.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType getOriginalMediaType(); - - /** - *
-   * The type of device the speech was recorded with.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return The enum numeric value on the wire for recordingDeviceType. - */ - int getRecordingDeviceTypeValue(); - /** - *
-   * The type of device the speech was recorded with.
-   * 
- * - * .google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return The recordingDeviceType. - */ - com.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType(); - - /** - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * @return The recordingDeviceName. - */ - java.lang.String getRecordingDeviceName(); - /** - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * @return The bytes for recordingDeviceName. - */ - com.google.protobuf.ByteString - getRecordingDeviceNameBytes(); - - /** - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * @return The originalMimeType. - */ - java.lang.String getOriginalMimeType(); - /** - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * @return The bytes for originalMimeType. - */ - com.google.protobuf.ByteString - getOriginalMimeTypeBytes(); - - /** - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * @return The audioTopic. - */ - java.lang.String getAudioTopic(); - /** - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * @return The bytes for audioTopic. - */ - com.google.protobuf.ByteString - getAudioTopicBytes(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequest.java deleted file mode 100644 index 8940768dafab..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequest.java +++ /dev/null @@ -1,913 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * The top-level message sent by the client for the `Recognize` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognizeRequest} - */ -public final class RecognizeRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognizeRequest) - RecognizeRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use RecognizeRequest.newBuilder() to construct. - private RecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RecognizeRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RecognizeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.cloud.speech.v1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = input.readMessage(com.google.cloud.speech.v1.RecognitionConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.cloud.speech.v1.RecognitionAudio.Builder subBuilder = null; - if (audio_ != null) { - subBuilder = audio_.toBuilder(); - } - audio_ = input.readMessage(com.google.cloud.speech.v1.RecognitionAudio.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(audio_); - audio_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognizeRequest.class, com.google.cloud.speech.v1.RecognizeRequest.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1.RecognitionConfig config_; - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig getConfig() { - return config_ == null ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; - } - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int AUDIO_FIELD_NUMBER = 2; - private com.google.cloud.speech.v1.RecognitionAudio audio_; - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the audio field is set. - */ - @java.lang.Override - public boolean hasAudio() { - return audio_ != null; - } - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The audio. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudio getAudio() { - return audio_ == null ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() : audio_; - } - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder() { - return getAudio(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (audio_ != null) { - output.writeMessage(2, getAudio()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getConfig()); - } - if (audio_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getAudio()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.RecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.RecognizeRequest other = (com.google.cloud.speech.v1.RecognizeRequest) obj; - - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig() - .equals(other.getConfig())) return false; - } - if (hasAudio() != other.hasAudio()) return false; - if (hasAudio()) { - if (!getAudio() - .equals(other.getAudio())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - if (hasAudio()) { - hash = (37 * hash) + AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getAudio().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognizeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognizeRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognizeRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.RecognizeRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * The top-level message sent by the client for the `Recognize` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognizeRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognizeRequest) - com.google.cloud.speech.v1.RecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognizeRequest.class, com.google.cloud.speech.v1.RecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.RecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - if (audioBuilder_ == null) { - audio_ = null; - } else { - audio_ = null; - audioBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.RecognizeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeRequest build() { - com.google.cloud.speech.v1.RecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeRequest buildPartial() { - com.google.cloud.speech.v1.RecognizeRequest result = new com.google.cloud.speech.v1.RecognizeRequest(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - if (audioBuilder_ == null) { - result.audio_ = audio_; - } else { - result.audio_ = audioBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.RecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1.RecognizeRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.RecognizeRequest other) { - if (other == com.google.cloud.speech.v1.RecognizeRequest.getDefaultInstance()) return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.hasAudio()) { - mergeAudio(other.getAudio()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.RecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.RecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1.RecognitionConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder> configBuilder_; - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - public com.google.cloud.speech.v1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setConfig(com.google.cloud.speech.v1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setConfig( - com.google.cloud.speech.v1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeConfig(com.google.cloud.speech.v1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1.RecognitionConfig.newBuilder(config_).mergeFrom(value).buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null ? - com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; - } - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder>( - getConfig(), - getParentForChildren(), - isClean()); - config_ = null; - } - return configBuilder_; - } - - private com.google.cloud.speech.v1.RecognitionAudio audio_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionAudio, com.google.cloud.speech.v1.RecognitionAudio.Builder, com.google.cloud.speech.v1.RecognitionAudioOrBuilder> audioBuilder_; - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the audio field is set. - */ - public boolean hasAudio() { - return audioBuilder_ != null || audio_ != null; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The audio. - */ - public com.google.cloud.speech.v1.RecognitionAudio getAudio() { - if (audioBuilder_ == null) { - return audio_ == null ? com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() : audio_; - } else { - return audioBuilder_.getMessage(); - } - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setAudio(com.google.cloud.speech.v1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - audio_ = value; - onChanged(); - } else { - audioBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setAudio( - com.google.cloud.speech.v1.RecognitionAudio.Builder builderForValue) { - if (audioBuilder_ == null) { - audio_ = builderForValue.build(); - onChanged(); - } else { - audioBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeAudio(com.google.cloud.speech.v1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (audio_ != null) { - audio_ = - com.google.cloud.speech.v1.RecognitionAudio.newBuilder(audio_).mergeFrom(value).buildPartial(); - } else { - audio_ = value; - } - onChanged(); - } else { - audioBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearAudio() { - if (audioBuilder_ == null) { - audio_ = null; - onChanged(); - } else { - audio_ = null; - audioBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.RecognitionAudio.Builder getAudioBuilder() { - - onChanged(); - return getAudioFieldBuilder().getBuilder(); - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder() { - if (audioBuilder_ != null) { - return audioBuilder_.getMessageOrBuilder(); - } else { - return audio_ == null ? - com.google.cloud.speech.v1.RecognitionAudio.getDefaultInstance() : audio_; - } - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionAudio, com.google.cloud.speech.v1.RecognitionAudio.Builder, com.google.cloud.speech.v1.RecognitionAudioOrBuilder> - getAudioFieldBuilder() { - if (audioBuilder_ == null) { - audioBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionAudio, com.google.cloud.speech.v1.RecognitionAudio.Builder, com.google.cloud.speech.v1.RecognitionAudioOrBuilder>( - getAudio(), - getParentForChildren(), - isClean()); - audio_ = null; - } - return audioBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.RecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognizeRequest) - private static final com.google.cloud.speech.v1.RecognizeRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognizeRequest(); - } - - public static com.google.cloud.speech.v1.RecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognizeRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequestOrBuilder.java deleted file mode 100644 index 5811af70356e..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeRequestOrBuilder.java +++ /dev/null @@ -1,66 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface RecognizeRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - com.google.cloud.speech.v1.RecognitionConfig getConfig(); - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the audio field is set. - */ - boolean hasAudio(); - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The audio. - */ - com.google.cloud.speech.v1.RecognitionAudio getAudio(); - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java deleted file mode 100644 index 42ddf12c6f61..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponse.java +++ /dev/null @@ -1,1135 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * The only message returned to the client by the `Recognize` method. It
- * contains the result as zero or more sequential `SpeechRecognitionResult`
- * messages.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognizeResponse} - */ -public final class RecognizeResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognizeResponse) - RecognizeResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use RecognizeResponse.newBuilder() to construct. - private RecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RecognizeResponse() { - results_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RecognizeResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage(com.google.cloud.speech.v1.SpeechRecognitionResult.parser(), extensionRegistry)); - break; - } - case 26: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (totalBilledTime_ != null) { - subBuilder = totalBilledTime_.toBuilder(); - } - totalBilledTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(totalBilledTime_); - totalBilledTime_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognizeResponse.class, com.google.cloud.speech.v1.RecognizeResponse.Builder.class); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List getResultsList() { - return results_; - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List - getResultsOrBuilderList() { - return results_; - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public int getResultsCount() { - return results_.size(); - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - public static final int TOTAL_BILLED_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Duration totalBilledTime_; - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return Whether the totalBilledTime field is set. - */ - @java.lang.Override - public boolean hasTotalBilledTime() { - return totalBilledTime_ != null; - } - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return The totalBilledTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getTotalBilledTime() { - return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { - return getTotalBilledTime(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - if (totalBilledTime_ != null) { - output.writeMessage(3, getTotalBilledTime()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, results_.get(i)); - } - if (totalBilledTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getTotalBilledTime()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.RecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.RecognizeResponse other = (com.google.cloud.speech.v1.RecognizeResponse) obj; - - if (!getResultsList() - .equals(other.getResultsList())) return false; - if (hasTotalBilledTime() != other.hasTotalBilledTime()) return false; - if (hasTotalBilledTime()) { - if (!getTotalBilledTime() - .equals(other.getTotalBilledTime())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - if (hasTotalBilledTime()) { - hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; - hash = (53 * hash) + getTotalBilledTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognizeResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognizeResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognizeResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.RecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.RecognizeResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * The only message returned to the client by the `Recognize` method. It
-   * contains the result as zero or more sequential `SpeechRecognitionResult`
-   * messages.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.RecognizeResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.RecognizeResponse) - com.google.cloud.speech.v1.RecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.RecognizeResponse.class, com.google.cloud.speech.v1.RecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.RecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = null; - } else { - totalBilledTime_ = null; - totalBilledTimeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_RecognizeResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1.RecognizeResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeResponse build() { - com.google.cloud.speech.v1.RecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeResponse buildPartial() { - com.google.cloud.speech.v1.RecognizeResponse result = new com.google.cloud.speech.v1.RecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - if (totalBilledTimeBuilder_ == null) { - result.totalBilledTime_ = totalBilledTime_; - } else { - result.totalBilledTime_ = totalBilledTimeBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.RecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1.RecognizeResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.RecognizeResponse other) { - if (other == com.google.cloud.speech.v1.RecognizeResponse.getDefaultInstance()) return this; - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResultsFieldBuilder() : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - if (other.hasTotalBilledTime()) { - mergeTotalBilledTime(other.getTotalBilledTime()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.RecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.RecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List results_ = - java.util.Collections.emptyList(); - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = new java.util.ArrayList(results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionResult, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder> resultsBuilder_; - - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public java.util.List getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder().addBuilder( - com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.SpeechRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionResult, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionResult, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder>( - results_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - results_ = null; - } - return resultsBuilder_; - } - - private com.google.protobuf.Duration totalBilledTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalBilledTimeBuilder_; - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return Whether the totalBilledTime field is set. - */ - public boolean hasTotalBilledTime() { - return totalBilledTimeBuilder_ != null || totalBilledTime_ != null; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return The totalBilledTime. - */ - public com.google.protobuf.Duration getTotalBilledTime() { - if (totalBilledTimeBuilder_ == null) { - return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } else { - return totalBilledTimeBuilder_.getMessage(); - } - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder setTotalBilledTime(com.google.protobuf.Duration value) { - if (totalBilledTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - totalBilledTime_ = value; - onChanged(); - } else { - totalBilledTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder setTotalBilledTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = builderForValue.build(); - onChanged(); - } else { - totalBilledTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder mergeTotalBilledTime(com.google.protobuf.Duration value) { - if (totalBilledTimeBuilder_ == null) { - if (totalBilledTime_ != null) { - totalBilledTime_ = - com.google.protobuf.Duration.newBuilder(totalBilledTime_).mergeFrom(value).buildPartial(); - } else { - totalBilledTime_ = value; - } - onChanged(); - } else { - totalBilledTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder clearTotalBilledTime() { - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = null; - onChanged(); - } else { - totalBilledTime_ = null; - totalBilledTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public com.google.protobuf.Duration.Builder getTotalBilledTimeBuilder() { - - onChanged(); - return getTotalBilledTimeFieldBuilder().getBuilder(); - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { - if (totalBilledTimeBuilder_ != null) { - return totalBilledTimeBuilder_.getMessageOrBuilder(); - } else { - return totalBilledTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getTotalBilledTimeFieldBuilder() { - if (totalBilledTimeBuilder_ == null) { - totalBilledTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getTotalBilledTime(), - getParentForChildren(), - isClean()); - totalBilledTime_ = null; - } - return totalBilledTimeBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.RecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognizeResponse) - private static final com.google.cloud.speech.v1.RecognizeResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.RecognizeResponse(); - } - - public static com.google.cloud.speech.v1.RecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognizeResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.RecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java deleted file mode 100644 index d2b282a71005..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/RecognizeResponseOrBuilder.java +++ /dev/null @@ -1,85 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface RecognizeResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.RecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsList(); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1.SpeechRecognitionResult getResults(int index); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - int getResultsCount(); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index); - - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return Whether the totalBilledTime field is set. - */ - boolean hasTotalBilledTime(); - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return The totalBilledTime. - */ - com.google.protobuf.Duration getTotalBilledTime(); - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java deleted file mode 100644 index 72dfa283a0b5..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfig.java +++ /dev/null @@ -1,782 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Config to enable speaker diarization.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeakerDiarizationConfig} - */ -public final class SpeakerDiarizationConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeakerDiarizationConfig) - SpeakerDiarizationConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use SpeakerDiarizationConfig.newBuilder() to construct. - private SpeakerDiarizationConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SpeakerDiarizationConfig() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SpeakerDiarizationConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SpeakerDiarizationConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - enableSpeakerDiarization_ = input.readBool(); - break; - } - case 16: { - - minSpeakerCount_ = input.readInt32(); - break; - } - case 24: { - - maxSpeakerCount_ = input.readInt32(); - break; - } - case 40: { - - speakerTag_ = input.readInt32(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeakerDiarizationConfig.class, com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder.class); - } - - public static final int ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER = 1; - private boolean enableSpeakerDiarization_; - /** - *
-   * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
-   * 
- * - * bool enable_speaker_diarization = 1; - * @return The enableSpeakerDiarization. - */ - @java.lang.Override - public boolean getEnableSpeakerDiarization() { - return enableSpeakerDiarization_; - } - - public static final int MIN_SPEAKER_COUNT_FIELD_NUMBER = 2; - private int minSpeakerCount_; - /** - *
-   * Minimum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 2.
-   * 
- * - * int32 min_speaker_count = 2; - * @return The minSpeakerCount. - */ - @java.lang.Override - public int getMinSpeakerCount() { - return minSpeakerCount_; - } - - public static final int MAX_SPEAKER_COUNT_FIELD_NUMBER = 3; - private int maxSpeakerCount_; - /** - *
-   * Maximum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 6.
-   * 
- * - * int32 max_speaker_count = 3; - * @return The maxSpeakerCount. - */ - @java.lang.Override - public int getMaxSpeakerCount() { - return maxSpeakerCount_; - } - - public static final int SPEAKER_TAG_FIELD_NUMBER = 5; - private int speakerTag_; - /** - *
-   * Output only. Unused.
-   * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1/cloud_speech.proto;l=457 - * @return The speakerTag. - */ - @java.lang.Override - @java.lang.Deprecated public int getSpeakerTag() { - return speakerTag_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (enableSpeakerDiarization_ != false) { - output.writeBool(1, enableSpeakerDiarization_); - } - if (minSpeakerCount_ != 0) { - output.writeInt32(2, minSpeakerCount_); - } - if (maxSpeakerCount_ != 0) { - output.writeInt32(3, maxSpeakerCount_); - } - if (speakerTag_ != 0) { - output.writeInt32(5, speakerTag_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enableSpeakerDiarization_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, enableSpeakerDiarization_); - } - if (minSpeakerCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, minSpeakerCount_); - } - if (maxSpeakerCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, maxSpeakerCount_); - } - if (speakerTag_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, speakerTag_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.SpeakerDiarizationConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.SpeakerDiarizationConfig other = (com.google.cloud.speech.v1.SpeakerDiarizationConfig) obj; - - if (getEnableSpeakerDiarization() - != other.getEnableSpeakerDiarization()) return false; - if (getMinSpeakerCount() - != other.getMinSpeakerCount()) return false; - if (getMaxSpeakerCount() - != other.getMaxSpeakerCount()) return false; - if (getSpeakerTag() - != other.getSpeakerTag()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableSpeakerDiarization()); - hash = (37 * hash) + MIN_SPEAKER_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getMinSpeakerCount(); - hash = (37 * hash) + MAX_SPEAKER_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getMaxSpeakerCount(); - hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; - hash = (53 * hash) + getSpeakerTag(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.SpeakerDiarizationConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Config to enable speaker diarization.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeakerDiarizationConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeakerDiarizationConfig) - com.google.cloud.speech.v1.SpeakerDiarizationConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeakerDiarizationConfig.class, com.google.cloud.speech.v1.SpeakerDiarizationConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.SpeakerDiarizationConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - enableSpeakerDiarization_ = false; - - minSpeakerCount_ = 0; - - maxSpeakerCount_ = 0; - - speakerTag_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeakerDiarizationConfig build() { - com.google.cloud.speech.v1.SpeakerDiarizationConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeakerDiarizationConfig buildPartial() { - com.google.cloud.speech.v1.SpeakerDiarizationConfig result = new com.google.cloud.speech.v1.SpeakerDiarizationConfig(this); - result.enableSpeakerDiarization_ = enableSpeakerDiarization_; - result.minSpeakerCount_ = minSpeakerCount_; - result.maxSpeakerCount_ = maxSpeakerCount_; - result.speakerTag_ = speakerTag_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.SpeakerDiarizationConfig) { - return mergeFrom((com.google.cloud.speech.v1.SpeakerDiarizationConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.SpeakerDiarizationConfig other) { - if (other == com.google.cloud.speech.v1.SpeakerDiarizationConfig.getDefaultInstance()) return this; - if (other.getEnableSpeakerDiarization() != false) { - setEnableSpeakerDiarization(other.getEnableSpeakerDiarization()); - } - if (other.getMinSpeakerCount() != 0) { - setMinSpeakerCount(other.getMinSpeakerCount()); - } - if (other.getMaxSpeakerCount() != 0) { - setMaxSpeakerCount(other.getMaxSpeakerCount()); - } - if (other.getSpeakerTag() != 0) { - setSpeakerTag(other.getSpeakerTag()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.SpeakerDiarizationConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.SpeakerDiarizationConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enableSpeakerDiarization_ ; - /** - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * 
- * - * bool enable_speaker_diarization = 1; - * @return The enableSpeakerDiarization. - */ - @java.lang.Override - public boolean getEnableSpeakerDiarization() { - return enableSpeakerDiarization_; - } - /** - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * 
- * - * bool enable_speaker_diarization = 1; - * @param value The enableSpeakerDiarization to set. - * @return This builder for chaining. - */ - public Builder setEnableSpeakerDiarization(boolean value) { - - enableSpeakerDiarization_ = value; - onChanged(); - return this; - } - /** - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * 
- * - * bool enable_speaker_diarization = 1; - * @return This builder for chaining. - */ - public Builder clearEnableSpeakerDiarization() { - - enableSpeakerDiarization_ = false; - onChanged(); - return this; - } - - private int minSpeakerCount_ ; - /** - *
-     * Minimum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 2.
-     * 
- * - * int32 min_speaker_count = 2; - * @return The minSpeakerCount. - */ - @java.lang.Override - public int getMinSpeakerCount() { - return minSpeakerCount_; - } - /** - *
-     * Minimum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 2.
-     * 
- * - * int32 min_speaker_count = 2; - * @param value The minSpeakerCount to set. - * @return This builder for chaining. - */ - public Builder setMinSpeakerCount(int value) { - - minSpeakerCount_ = value; - onChanged(); - return this; - } - /** - *
-     * Minimum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 2.
-     * 
- * - * int32 min_speaker_count = 2; - * @return This builder for chaining. - */ - public Builder clearMinSpeakerCount() { - - minSpeakerCount_ = 0; - onChanged(); - return this; - } - - private int maxSpeakerCount_ ; - /** - *
-     * Maximum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 6.
-     * 
- * - * int32 max_speaker_count = 3; - * @return The maxSpeakerCount. - */ - @java.lang.Override - public int getMaxSpeakerCount() { - return maxSpeakerCount_; - } - /** - *
-     * Maximum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 6.
-     * 
- * - * int32 max_speaker_count = 3; - * @param value The maxSpeakerCount to set. - * @return This builder for chaining. - */ - public Builder setMaxSpeakerCount(int value) { - - maxSpeakerCount_ = value; - onChanged(); - return this; - } - /** - *
-     * Maximum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 6.
-     * 
- * - * int32 max_speaker_count = 3; - * @return This builder for chaining. - */ - public Builder clearMaxSpeakerCount() { - - maxSpeakerCount_ = 0; - onChanged(); - return this; - } - - private int speakerTag_ ; - /** - *
-     * Output only. Unused.
-     * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1/cloud_speech.proto;l=457 - * @return The speakerTag. - */ - @java.lang.Override - @java.lang.Deprecated public int getSpeakerTag() { - return speakerTag_; - } - /** - *
-     * Output only. Unused.
-     * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1/cloud_speech.proto;l=457 - * @param value The speakerTag to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated public Builder setSpeakerTag(int value) { - - speakerTag_ = value; - onChanged(); - return this; - } - /** - *
-     * Output only. Unused.
-     * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1/cloud_speech.proto;l=457 - * @return This builder for chaining. - */ - @java.lang.Deprecated public Builder clearSpeakerTag() { - - speakerTag_ = 0; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeakerDiarizationConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeakerDiarizationConfig) - private static final com.google.cloud.speech.v1.SpeakerDiarizationConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeakerDiarizationConfig(); - } - - public static com.google.cloud.speech.v1.SpeakerDiarizationConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeakerDiarizationConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeakerDiarizationConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeakerDiarizationConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java deleted file mode 100644 index cb178fda1320..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeakerDiarizationConfigOrBuilder.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface SpeakerDiarizationConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeakerDiarizationConfig) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
-   * 
- * - * bool enable_speaker_diarization = 1; - * @return The enableSpeakerDiarization. - */ - boolean getEnableSpeakerDiarization(); - - /** - *
-   * Minimum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 2.
-   * 
- * - * int32 min_speaker_count = 2; - * @return The minSpeakerCount. - */ - int getMinSpeakerCount(); - - /** - *
-   * Maximum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 6.
-   * 
- * - * int32 max_speaker_count = 3; - * @return The maxSpeakerCount. - */ - int getMaxSpeakerCount(); - - /** - *
-   * Output only. Unused.
-   * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @deprecated google.cloud.speech.v1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1/cloud_speech.proto;l=457 - * @return The speakerTag. - */ - @java.lang.Deprecated int getSpeakerTag(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptation.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptation.java deleted file mode 100644 index 1ba9f5acf756..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptation.java +++ /dev/null @@ -1,1671 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/resource.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Speech adaptation configuration.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeechAdaptation} - */ -public final class SpeechAdaptation extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechAdaptation) - SpeechAdaptationOrBuilder { -private static final long serialVersionUID = 0L; - // Use SpeechAdaptation.newBuilder() to construct. - private SpeechAdaptation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SpeechAdaptation() { - phraseSets_ = java.util.Collections.emptyList(); - phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; - customClasses_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SpeechAdaptation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SpeechAdaptation( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - phraseSets_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phraseSets_.add( - input.readMessage(com.google.cloud.speech.v1.PhraseSet.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - phraseSetReferences_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - phraseSetReferences_.add(s); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - customClasses_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - customClasses_.add( - input.readMessage(com.google.cloud.speech.v1.CustomClass.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - phraseSetReferences_ = phraseSetReferences_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - customClasses_ = java.util.Collections.unmodifiableList(customClasses_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_SpeechAdaptation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_SpeechAdaptation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechAdaptation.class, com.google.cloud.speech.v1.SpeechAdaptation.Builder.class); - } - - public static final int PHRASE_SETS_FIELD_NUMBER = 1; - private java.util.List phraseSets_; - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public java.util.List getPhraseSetsList() { - return phraseSets_; - } - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public java.util.List - getPhraseSetsOrBuilderList() { - return phraseSets_; - } - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public int getPhraseSetsCount() { - return phraseSets_.size(); - } - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet getPhraseSets(int index) { - return phraseSets_.get(index); - } - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetsOrBuilder( - int index) { - return phraseSets_.get(index); - } - - public static final int PHRASE_SET_REFERENCES_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList phraseSetReferences_; - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return A list containing the phraseSetReferences. - */ - public com.google.protobuf.ProtocolStringList - getPhraseSetReferencesList() { - return phraseSetReferences_; - } - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return The count of phraseSetReferences. - */ - public int getPhraseSetReferencesCount() { - return phraseSetReferences_.size(); - } - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index of the element to return. - * @return The phraseSetReferences at the given index. - */ - public java.lang.String getPhraseSetReferences(int index) { - return phraseSetReferences_.get(index); - } - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index of the value to return. - * @return The bytes of the phraseSetReferences at the given index. - */ - public com.google.protobuf.ByteString - getPhraseSetReferencesBytes(int index) { - return phraseSetReferences_.getByteString(index); - } - - public static final int CUSTOM_CLASSES_FIELD_NUMBER = 3; - private java.util.List customClasses_; - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - @java.lang.Override - public java.util.List getCustomClassesList() { - return customClasses_; - } - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - @java.lang.Override - public java.util.List - getCustomClassesOrBuilderList() { - return customClasses_; - } - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - @java.lang.Override - public int getCustomClassesCount() { - return customClasses_.size(); - } - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass getCustomClasses(int index) { - return customClasses_.get(index); - } - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index) { - return customClasses_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < phraseSets_.size(); i++) { - output.writeMessage(1, phraseSets_.get(i)); - } - for (int i = 0; i < phraseSetReferences_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, phraseSetReferences_.getRaw(i)); - } - for (int i = 0; i < customClasses_.size(); i++) { - output.writeMessage(3, customClasses_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < phraseSets_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, phraseSets_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < phraseSetReferences_.size(); i++) { - dataSize += computeStringSizeNoTag(phraseSetReferences_.getRaw(i)); - } - size += dataSize; - size += 1 * getPhraseSetReferencesList().size(); - } - for (int i = 0; i < customClasses_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, customClasses_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.SpeechAdaptation)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.SpeechAdaptation other = (com.google.cloud.speech.v1.SpeechAdaptation) obj; - - if (!getPhraseSetsList() - .equals(other.getPhraseSetsList())) return false; - if (!getPhraseSetReferencesList() - .equals(other.getPhraseSetReferencesList())) return false; - if (!getCustomClassesList() - .equals(other.getCustomClassesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPhraseSetsCount() > 0) { - hash = (37 * hash) + PHRASE_SETS_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSetsList().hashCode(); - } - if (getPhraseSetReferencesCount() > 0) { - hash = (37 * hash) + PHRASE_SET_REFERENCES_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSetReferencesList().hashCode(); - } - if (getCustomClassesCount() > 0) { - hash = (37 * hash) + CUSTOM_CLASSES_FIELD_NUMBER; - hash = (53 * hash) + getCustomClassesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechAdaptation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeechAdaptation parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeechAdaptation parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.SpeechAdaptation prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Speech adaptation configuration.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeechAdaptation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechAdaptation) - com.google.cloud.speech.v1.SpeechAdaptationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_SpeechAdaptation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_SpeechAdaptation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechAdaptation.class, com.google.cloud.speech.v1.SpeechAdaptation.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.SpeechAdaptation.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getPhraseSetsFieldBuilder(); - getCustomClassesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (phraseSetsBuilder_ == null) { - phraseSets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - phraseSetsBuilder_.clear(); - } - phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - if (customClassesBuilder_ == null) { - customClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - customClassesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechResourceProto.internal_static_google_cloud_speech_v1_SpeechAdaptation_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechAdaptation getDefaultInstanceForType() { - return com.google.cloud.speech.v1.SpeechAdaptation.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechAdaptation build() { - com.google.cloud.speech.v1.SpeechAdaptation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechAdaptation buildPartial() { - com.google.cloud.speech.v1.SpeechAdaptation result = new com.google.cloud.speech.v1.SpeechAdaptation(this); - int from_bitField0_ = bitField0_; - if (phraseSetsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phraseSets_ = phraseSets_; - } else { - result.phraseSets_ = phraseSetsBuilder_.build(); - } - if (((bitField0_ & 0x00000002) != 0)) { - phraseSetReferences_ = phraseSetReferences_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.phraseSetReferences_ = phraseSetReferences_; - if (customClassesBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - customClasses_ = java.util.Collections.unmodifiableList(customClasses_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.customClasses_ = customClasses_; - } else { - result.customClasses_ = customClassesBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.SpeechAdaptation) { - return mergeFrom((com.google.cloud.speech.v1.SpeechAdaptation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.SpeechAdaptation other) { - if (other == com.google.cloud.speech.v1.SpeechAdaptation.getDefaultInstance()) return this; - if (phraseSetsBuilder_ == null) { - if (!other.phraseSets_.isEmpty()) { - if (phraseSets_.isEmpty()) { - phraseSets_ = other.phraseSets_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhraseSetsIsMutable(); - phraseSets_.addAll(other.phraseSets_); - } - onChanged(); - } - } else { - if (!other.phraseSets_.isEmpty()) { - if (phraseSetsBuilder_.isEmpty()) { - phraseSetsBuilder_.dispose(); - phraseSetsBuilder_ = null; - phraseSets_ = other.phraseSets_; - bitField0_ = (bitField0_ & ~0x00000001); - phraseSetsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPhraseSetsFieldBuilder() : null; - } else { - phraseSetsBuilder_.addAllMessages(other.phraseSets_); - } - } - } - if (!other.phraseSetReferences_.isEmpty()) { - if (phraseSetReferences_.isEmpty()) { - phraseSetReferences_ = other.phraseSetReferences_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensurePhraseSetReferencesIsMutable(); - phraseSetReferences_.addAll(other.phraseSetReferences_); - } - onChanged(); - } - if (customClassesBuilder_ == null) { - if (!other.customClasses_.isEmpty()) { - if (customClasses_.isEmpty()) { - customClasses_ = other.customClasses_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureCustomClassesIsMutable(); - customClasses_.addAll(other.customClasses_); - } - onChanged(); - } - } else { - if (!other.customClasses_.isEmpty()) { - if (customClassesBuilder_.isEmpty()) { - customClassesBuilder_.dispose(); - customClassesBuilder_ = null; - customClasses_ = other.customClasses_; - bitField0_ = (bitField0_ & ~0x00000004); - customClassesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getCustomClassesFieldBuilder() : null; - } else { - customClassesBuilder_.addAllMessages(other.customClasses_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.SpeechAdaptation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.SpeechAdaptation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List phraseSets_ = - java.util.Collections.emptyList(); - private void ensurePhraseSetsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - phraseSets_ = new java.util.ArrayList(phraseSets_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> phraseSetsBuilder_; - - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public java.util.List getPhraseSetsList() { - if (phraseSetsBuilder_ == null) { - return java.util.Collections.unmodifiableList(phraseSets_); - } else { - return phraseSetsBuilder_.getMessageList(); - } - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public int getPhraseSetsCount() { - if (phraseSetsBuilder_ == null) { - return phraseSets_.size(); - } else { - return phraseSetsBuilder_.getCount(); - } - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1.PhraseSet getPhraseSets(int index) { - if (phraseSetsBuilder_ == null) { - return phraseSets_.get(index); - } else { - return phraseSetsBuilder_.getMessage(index); - } - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder setPhraseSets( - int index, com.google.cloud.speech.v1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.set(index, value); - onChanged(); - } else { - phraseSetsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder setPhraseSets( - int index, com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.set(index, builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets(com.google.cloud.speech.v1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.add(value); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - int index, com.google.cloud.speech.v1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.add(index, value); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.add(builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - int index, com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.add(index, builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder addAllPhraseSets( - java.lang.Iterable values) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, phraseSets_); - onChanged(); - } else { - phraseSetsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder clearPhraseSets() { - if (phraseSetsBuilder_ == null) { - phraseSets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - phraseSetsBuilder_.clear(); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public Builder removePhraseSets(int index) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.remove(index); - onChanged(); - } else { - phraseSetsBuilder_.remove(index); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1.PhraseSet.Builder getPhraseSetsBuilder( - int index) { - return getPhraseSetsFieldBuilder().getBuilder(index); - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetsOrBuilder( - int index) { - if (phraseSetsBuilder_ == null) { - return phraseSets_.get(index); } else { - return phraseSetsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public java.util.List - getPhraseSetsOrBuilderList() { - if (phraseSetsBuilder_ != null) { - return phraseSetsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(phraseSets_); - } - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1.PhraseSet.Builder addPhraseSetsBuilder() { - return getPhraseSetsFieldBuilder().addBuilder( - com.google.cloud.speech.v1.PhraseSet.getDefaultInstance()); - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1.PhraseSet.Builder addPhraseSetsBuilder( - int index) { - return getPhraseSetsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.PhraseSet.getDefaultInstance()); - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - public java.util.List - getPhraseSetsBuilderList() { - return getPhraseSetsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> - getPhraseSetsFieldBuilder() { - if (phraseSetsBuilder_ == null) { - phraseSetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder>( - phraseSets_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - phraseSets_ = null; - } - return phraseSetsBuilder_; - } - - private com.google.protobuf.LazyStringList phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensurePhraseSetReferencesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - phraseSetReferences_ = new com.google.protobuf.LazyStringArrayList(phraseSetReferences_); - bitField0_ |= 0x00000002; - } - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return A list containing the phraseSetReferences. - */ - public com.google.protobuf.ProtocolStringList - getPhraseSetReferencesList() { - return phraseSetReferences_.getUnmodifiableView(); - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return The count of phraseSetReferences. - */ - public int getPhraseSetReferencesCount() { - return phraseSetReferences_.size(); - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index of the element to return. - * @return The phraseSetReferences at the given index. - */ - public java.lang.String getPhraseSetReferences(int index) { - return phraseSetReferences_.get(index); - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index of the value to return. - * @return The bytes of the phraseSetReferences at the given index. - */ - public com.google.protobuf.ByteString - getPhraseSetReferencesBytes(int index) { - return phraseSetReferences_.getByteString(index); - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index to set the value at. - * @param value The phraseSetReferences to set. - * @return This builder for chaining. - */ - public Builder setPhraseSetReferences( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetReferencesIsMutable(); - phraseSetReferences_.set(index, value); - onChanged(); - return this; - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param value The phraseSetReferences to add. - * @return This builder for chaining. - */ - public Builder addPhraseSetReferences( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetReferencesIsMutable(); - phraseSetReferences_.add(value); - onChanged(); - return this; - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param values The phraseSetReferences to add. - * @return This builder for chaining. - */ - public Builder addAllPhraseSetReferences( - java.lang.Iterable values) { - ensurePhraseSetReferencesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, phraseSetReferences_); - onChanged(); - return this; - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearPhraseSetReferences() { - phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param value The bytes of the phraseSetReferences to add. - * @return This builder for chaining. - */ - public Builder addPhraseSetReferencesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensurePhraseSetReferencesIsMutable(); - phraseSetReferences_.add(value); - onChanged(); - return this; - } - - private java.util.List customClasses_ = - java.util.Collections.emptyList(); - private void ensureCustomClassesIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - customClasses_ = new java.util.ArrayList(customClasses_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> customClassesBuilder_; - - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public java.util.List getCustomClassesList() { - if (customClassesBuilder_ == null) { - return java.util.Collections.unmodifiableList(customClasses_); - } else { - return customClassesBuilder_.getMessageList(); - } - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public int getCustomClassesCount() { - if (customClassesBuilder_ == null) { - return customClasses_.size(); - } else { - return customClassesBuilder_.getCount(); - } - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public com.google.cloud.speech.v1.CustomClass getCustomClasses(int index) { - if (customClassesBuilder_ == null) { - return customClasses_.get(index); - } else { - return customClassesBuilder_.getMessage(index); - } - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public Builder setCustomClasses( - int index, com.google.cloud.speech.v1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.set(index, value); - onChanged(); - } else { - customClassesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public Builder setCustomClasses( - int index, com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.set(index, builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public Builder addCustomClasses(com.google.cloud.speech.v1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.add(value); - onChanged(); - } else { - customClassesBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public Builder addCustomClasses( - int index, com.google.cloud.speech.v1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.add(index, value); - onChanged(); - } else { - customClassesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public Builder addCustomClasses( - com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.add(builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public Builder addCustomClasses( - int index, com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.add(index, builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public Builder addAllCustomClasses( - java.lang.Iterable values) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, customClasses_); - onChanged(); - } else { - customClassesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public Builder clearCustomClasses() { - if (customClassesBuilder_ == null) { - customClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - customClassesBuilder_.clear(); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public Builder removeCustomClasses(int index) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.remove(index); - onChanged(); - } else { - customClassesBuilder_.remove(index); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public com.google.cloud.speech.v1.CustomClass.Builder getCustomClassesBuilder( - int index) { - return getCustomClassesFieldBuilder().getBuilder(index); - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index) { - if (customClassesBuilder_ == null) { - return customClasses_.get(index); } else { - return customClassesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public java.util.List - getCustomClassesOrBuilderList() { - if (customClassesBuilder_ != null) { - return customClassesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(customClasses_); - } - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public com.google.cloud.speech.v1.CustomClass.Builder addCustomClassesBuilder() { - return getCustomClassesFieldBuilder().addBuilder( - com.google.cloud.speech.v1.CustomClass.getDefaultInstance()); - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public com.google.cloud.speech.v1.CustomClass.Builder addCustomClassesBuilder( - int index) { - return getCustomClassesFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.CustomClass.getDefaultInstance()); - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - public java.util.List - getCustomClassesBuilderList() { - return getCustomClassesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> - getCustomClassesFieldBuilder() { - if (customClassesBuilder_ == null) { - customClassesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder>( - customClasses_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - customClasses_ = null; - } - return customClassesBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeechAdaptation) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechAdaptation) - private static final com.google.cloud.speech.v1.SpeechAdaptation DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechAdaptation(); - } - - public static com.google.cloud.speech.v1.SpeechAdaptation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechAdaptation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechAdaptation(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechAdaptation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationOrBuilder.java deleted file mode 100644 index b40c4c5a0477..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationOrBuilder.java +++ /dev/null @@ -1,163 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/resource.proto - -package com.google.cloud.speech.v1; - -public interface SpeechAdaptationOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeechAdaptation) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - java.util.List - getPhraseSetsList(); - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - com.google.cloud.speech.v1.PhraseSet getPhraseSets(int index); - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - int getPhraseSetsCount(); - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - java.util.List - getPhraseSetsOrBuilderList(); - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1.PhraseSet phrase_sets = 1; - */ - com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetsOrBuilder( - int index); - - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return A list containing the phraseSetReferences. - */ - java.util.List - getPhraseSetReferencesList(); - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return The count of phraseSetReferences. - */ - int getPhraseSetReferencesCount(); - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index of the element to return. - * @return The phraseSetReferences at the given index. - */ - java.lang.String getPhraseSetReferences(int index); - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index of the value to return. - * @return The bytes of the phraseSetReferences at the given index. - */ - com.google.protobuf.ByteString - getPhraseSetReferencesBytes(int index); - - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - java.util.List - getCustomClassesList(); - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - com.google.cloud.speech.v1.CustomClass getCustomClasses(int index); - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - int getCustomClassesCount(); - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - java.util.List - getCustomClassesOrBuilderList(); - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1.CustomClass custom_classes = 3; - */ - com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationProto.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationProto.java deleted file mode 100644 index 314543722847..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechAdaptationProto.java +++ /dev/null @@ -1,285 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public final class SpeechAdaptationProto { - private SpeechAdaptationProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_CreatePhraseSetRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_GetPhraseSetRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_GetPhraseSetRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_ListPhraseSetRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_ListPhraseSetRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_ListPhraseSetResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_ListPhraseSetResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_DeletePhraseSetRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_CreateCustomClassRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_CreateCustomClassRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_GetCustomClassRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_GetCustomClassRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_ListCustomClassesRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_ListCustomClassesRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_ListCustomClassesResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_ListCustomClassesResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_DeleteCustomClassRequest_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n4google/cloud/speech/v1/cloud_speech_ad" + - "aptation.proto\022\026google.cloud.speech.v1\032\034" + - "google/api/annotations.proto\032\027google/api" + - "/client.proto\032\037google/api/field_behavior" + - ".proto\032\031google/api/resource.proto\032%googl" + - "e/cloud/speech/v1/resource.proto\032\033google" + - "/protobuf/empty.proto\032 google/protobuf/f" + - "ield_mask.proto\"\251\001\n\026CreatePhraseSetReque" + - "st\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037speech.googl" + - "eapis.com/PhraseSet\022\032\n\rphrase_set_id\030\002 \001" + - "(\tB\003\340A\002\022:\n\nphrase_set\030\003 \001(\0132!.google.clo" + - "ud.speech.v1.PhraseSetB\003\340A\002\"\205\001\n\026UpdatePh" + - "raseSetRequest\022:\n\nphrase_set\030\001 \001(\0132!.goo" + - "gle.cloud.speech.v1.PhraseSetB\003\340A\002\022/\n\013up" + - "date_mask\030\002 \001(\0132\032.google.protobuf.FieldM" + - "ask\"L\n\023GetPhraseSetRequest\0225\n\004name\030\001 \001(\t" + - "B\'\340A\002\372A!\n\037speech.googleapis.com/PhraseSe" + - "t\"v\n\024ListPhraseSetRequest\0227\n\006parent\030\001 \001(" + - "\tB\'\340A\002\372A!\022\037speech.googleapis.com/PhraseS" + - "et\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(" + - "\t\"h\n\025ListPhraseSetResponse\0226\n\013phrase_set" + - "s\030\001 \003(\0132!.google.cloud.speech.v1.PhraseS" + - "et\022\027\n\017next_page_token\030\002 \001(\t\"O\n\026DeletePhr" + - "aseSetRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037spe" + - "ech.googleapis.com/PhraseSet\"\263\001\n\030CreateC" + - "ustomClassRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A" + - "#\022!speech.googleapis.com/CustomClass\022\034\n\017" + - "custom_class_id\030\002 \001(\tB\003\340A\002\022>\n\014custom_cla" + - "ss\030\003 \001(\0132#.google.cloud.speech.v1.Custom" + - "ClassB\003\340A\002\"\213\001\n\030UpdateCustomClassRequest\022" + - ">\n\014custom_class\030\001 \001(\0132#.google.cloud.spe" + - "ech.v1.CustomClassB\003\340A\002\022/\n\013update_mask\030\002" + - " \001(\0132\032.google.protobuf.FieldMask\"P\n\025GetC" + - "ustomClassRequest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n" + - "!speech.googleapis.com/CustomClass\"|\n\030Li" + - "stCustomClassesRequest\0229\n\006parent\030\001 \001(\tB)" + - "\340A\002\372A#\022!speech.googleapis.com/CustomClas" + - "s\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t" + - "\"q\n\031ListCustomClassesResponse\022;\n\016custom_" + - "classes\030\001 \003(\0132#.google.cloud.speech.v1.C" + - "ustomClass\022\027\n\017next_page_token\030\002 \001(\t\"S\n\030D" + - "eleteCustomClassRequest\0227\n\004name\030\001 \001(\tB)\340" + - "A\002\372A#\n!speech.googleapis.com/CustomClass" + - "2\216\017\n\nAdaptation\022\301\001\n\017CreatePhraseSet\022..go" + - "ogle.cloud.speech.v1.CreatePhraseSetRequ" + - "est\032!.google.cloud.speech.v1.PhraseSet\"[" + - "\202\323\344\223\0023\"./v1/{parent=projects/*/locations" + - "/*}/phraseSets:\001*\332A\037parent,phrase_set,ph" + - "rase_set_id\022\235\001\n\014GetPhraseSet\022+.google.cl" + - "oud.speech.v1.GetPhraseSetRequest\032!.goog" + - "le.cloud.speech.v1.PhraseSet\"=\202\323\344\223\0020\022./v" + - "1/{name=projects/*/locations/*/phraseSet" + - "s/*}\332A\004name\022\255\001\n\rListPhraseSet\022,.google.c" + - "loud.speech.v1.ListPhraseSetRequest\032-.go" + - "ogle.cloud.speech.v1.ListPhraseSetRespon" + - "se\"?\202\323\344\223\0020\022./v1/{parent=projects/*/locat" + - "ions/*}/phraseSets\332A\006parent\022\314\001\n\017UpdatePh" + - "raseSet\022..google.cloud.speech.v1.UpdateP" + - "hraseSetRequest\032!.google.cloud.speech.v1" + - ".PhraseSet\"f\202\323\344\223\002G29/v1/{phrase_set.name" + - "=projects/*/locations/*/phraseSets/*}:\np" + - "hrase_set\332A\026phrase_set,update_mask\022\230\001\n\017D" + - "eletePhraseSet\022..google.cloud.speech.v1." + - "DeletePhraseSetRequest\032\026.google.protobuf" + - ".Empty\"=\202\323\344\223\0020*./v1/{name=projects/*/loc" + - "ations/*/phraseSets/*}\332A\004name\022\316\001\n\021Create" + - "CustomClass\0220.google.cloud.speech.v1.Cre" + - "ateCustomClassRequest\032#.google.cloud.spe" + - "ech.v1.CustomClass\"b\202\323\344\223\0026\"1/v1/{parent=" + - "projects/*/locations/*}/customClasses:\001*" + - "\332A#parent,custom_class,custom_class_id\022\246" + - "\001\n\016GetCustomClass\022-.google.cloud.speech." + - "v1.GetCustomClassRequest\032#.google.cloud." + - "speech.v1.CustomClass\"@\202\323\344\223\0023\0221/v1/{name" + - "=projects/*/locations/*/customClasses/*}" + - "\332A\004name\022\274\001\n\021ListCustomClasses\0220.google.c" + - "loud.speech.v1.ListCustomClassesRequest\032" + - "1.google.cloud.speech.v1.ListCustomClass" + - "esResponse\"B\202\323\344\223\0023\0221/v1/{parent=projects" + - "/*/locations/*}/customClasses\332A\006parent\022\333" + - "\001\n\021UpdateCustomClass\0220.google.cloud.spee" + - "ch.v1.UpdateCustomClassRequest\032#.google." + - "cloud.speech.v1.CustomClass\"o\202\323\344\223\002N2>/v1" + - "/{custom_class.name=projects/*/locations" + - "/*/customClasses/*}:\014custom_class\332A\030cust" + - "om_class,update_mask\022\237\001\n\021DeleteCustomCla" + - "ss\0220.google.cloud.speech.v1.DeleteCustom" + - "ClassRequest\032\026.google.protobuf.Empty\"@\202\323" + - "\344\223\0023*1/v1/{name=projects/*/locations/*/c" + - "ustomClasses/*}\332A\004name\032I\312A\025speech.google" + - "apis.com\322A.https://www.googleapis.com/au" + - "th/cloud-platformB|\n\032com.google.cloud.sp" + - "eech.v1B\025SpeechAdaptationProtoP\001Z - * Provides "hints" to the speech recognizer to favor specific words and phrases - * in the results. - * - * - * Protobuf type {@code google.cloud.speech.v1.SpeechContext} - */ -public final class SpeechContext extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechContext) - SpeechContextOrBuilder { -private static final long serialVersionUID = 0L; - // Use SpeechContext.newBuilder() to construct. - private SpeechContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SpeechContext() { - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SpeechContext(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SpeechContext( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phrases_.add(s); - break; - } - case 37: { - - boost_ = input.readFloat(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = phrases_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechContext_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechContext_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechContext.class, com.google.cloud.speech.v1.SpeechContext.Builder.class); - } - - public static final int PHRASES_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList phrases_; - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @return A list containing the phrases. - */ - public com.google.protobuf.ProtocolStringList - getPhrasesList() { - return phrases_; - } - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @return The count of phrases. - */ - public int getPhrasesCount() { - return phrases_.size(); - } - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @param index The index of the element to return. - * @return The phrases at the given index. - */ - public java.lang.String getPhrases(int index) { - return phrases_.get(index); - } - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @param index The index of the value to return. - * @return The bytes of the phrases at the given index. - */ - public com.google.protobuf.ByteString - getPhrasesBytes(int index) { - return phrases_.getByteString(index); - } - - public static final int BOOST_FIELD_NUMBER = 4; - private float boost_; - /** - *
-   * Hint Boost. Positive value will increase the probability that a specific
-   * phrase will be recognized over other similar sounding phrases. The higher
-   * the boost, the higher the chance of false positive recognition as well.
-   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-   * enabled, so negative boost will simply be ignored. Though `boost` can
-   * accept a wide range of positive values, most use cases are best served with
-   * values between 0 and 20. We recommend using a binary search approach to
-   * finding the optimal value for your use case.
-   * 
- * - * float boost = 4; - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < phrases_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, phrases_.getRaw(i)); - } - if (java.lang.Float.floatToRawIntBits(boost_) != 0) { - output.writeFloat(4, boost_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < phrases_.size(); i++) { - dataSize += computeStringSizeNoTag(phrases_.getRaw(i)); - } - size += dataSize; - size += 1 * getPhrasesList().size(); - } - if (java.lang.Float.floatToRawIntBits(boost_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(4, boost_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.SpeechContext)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.SpeechContext other = (com.google.cloud.speech.v1.SpeechContext) obj; - - if (!getPhrasesList() - .equals(other.getPhrasesList())) return false; - if (java.lang.Float.floatToIntBits(getBoost()) - != java.lang.Float.floatToIntBits( - other.getBoost())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPhrasesCount() > 0) { - hash = (37 * hash) + PHRASES_FIELD_NUMBER; - hash = (53 * hash) + getPhrasesList().hashCode(); - } - hash = (37 * hash) + BOOST_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getBoost()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.SpeechContext parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeechContext parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechContext parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeechContext parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechContext parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeechContext parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechContext parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeechContext parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechContext parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeechContext parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechContext parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeechContext parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.SpeechContext prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Provides "hints" to the speech recognizer to favor specific words and phrases
-   * in the results.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeechContext} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechContext) - com.google.cloud.speech.v1.SpeechContextOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechContext_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechContext_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechContext.class, com.google.cloud.speech.v1.SpeechContext.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.SpeechContext.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - boost_ = 0F; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechContext_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechContext getDefaultInstanceForType() { - return com.google.cloud.speech.v1.SpeechContext.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechContext build() { - com.google.cloud.speech.v1.SpeechContext result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechContext buildPartial() { - com.google.cloud.speech.v1.SpeechContext result = new com.google.cloud.speech.v1.SpeechContext(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - phrases_ = phrases_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phrases_ = phrases_; - result.boost_ = boost_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.SpeechContext) { - return mergeFrom((com.google.cloud.speech.v1.SpeechContext)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.SpeechContext other) { - if (other == com.google.cloud.speech.v1.SpeechContext.getDefaultInstance()) return this; - if (!other.phrases_.isEmpty()) { - if (phrases_.isEmpty()) { - phrases_ = other.phrases_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhrasesIsMutable(); - phrases_.addAll(other.phrases_); - } - onChanged(); - } - if (other.getBoost() != 0F) { - setBoost(other.getBoost()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.SpeechContext parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.SpeechContext) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensurePhrasesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - phrases_ = new com.google.protobuf.LazyStringArrayList(phrases_); - bitField0_ |= 0x00000001; - } - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @return A list containing the phrases. - */ - public com.google.protobuf.ProtocolStringList - getPhrasesList() { - return phrases_.getUnmodifiableView(); - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @return The count of phrases. - */ - public int getPhrasesCount() { - return phrases_.size(); - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @param index The index of the element to return. - * @return The phrases at the given index. - */ - public java.lang.String getPhrases(int index) { - return phrases_.get(index); - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @param index The index of the value to return. - * @return The bytes of the phrases at the given index. - */ - public com.google.protobuf.ByteString - getPhrasesBytes(int index) { - return phrases_.getByteString(index); - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @param index The index to set the value at. - * @param value The phrases to set. - * @return This builder for chaining. - */ - public Builder setPhrases( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.set(index, value); - onChanged(); - return this; - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @param value The phrases to add. - * @return This builder for chaining. - */ - public Builder addPhrases( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.add(value); - onChanged(); - return this; - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @param values The phrases to add. - * @return This builder for chaining. - */ - public Builder addAllPhrases( - java.lang.Iterable values) { - ensurePhrasesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, phrases_); - onChanged(); - return this; - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @return This builder for chaining. - */ - public Builder clearPhrases() { - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @param value The bytes of the phrases to add. - * @return This builder for chaining. - */ - public Builder addPhrasesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensurePhrasesIsMutable(); - phrases_.add(value); - onChanged(); - return this; - } - - private float boost_ ; - /** - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 and 20. We recommend using a binary search approach to
-     * finding the optimal value for your use case.
-     * 
- * - * float boost = 4; - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - /** - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 and 20. We recommend using a binary search approach to
-     * finding the optimal value for your use case.
-     * 
- * - * float boost = 4; - * @param value The boost to set. - * @return This builder for chaining. - */ - public Builder setBoost(float value) { - - boost_ = value; - onChanged(); - return this; - } - /** - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 and 20. We recommend using a binary search approach to
-     * finding the optimal value for your use case.
-     * 
- * - * float boost = 4; - * @return This builder for chaining. - */ - public Builder clearBoost() { - - boost_ = 0F; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeechContext) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechContext) - private static final com.google.cloud.speech.v1.SpeechContext DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechContext(); - } - - public static com.google.cloud.speech.v1.SpeechContext getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechContext parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechContext(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechContext getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContextOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContextOrBuilder.java deleted file mode 100644 index 97fbd87c39aa..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechContextOrBuilder.java +++ /dev/null @@ -1,107 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface SpeechContextOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeechContext) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @return A list containing the phrases. - */ - java.util.List - getPhrasesList(); - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @return The count of phrases. - */ - int getPhrasesCount(); - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @param index The index of the element to return. - * @return The phrases at the given index. - */ - java.lang.String getPhrases(int index); - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @param index The index of the value to return. - * @return The bytes of the phrases at the given index. - */ - com.google.protobuf.ByteString - getPhrasesBytes(int index); - - /** - *
-   * Hint Boost. Positive value will increase the probability that a specific
-   * phrase will be recognized over other similar sounding phrases. The higher
-   * the boost, the higher the chance of false positive recognition as well.
-   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-   * enabled, so negative boost will simply be ignored. Though `boost` can
-   * accept a wide range of positive values, most use cases are best served with
-   * values between 0 and 20. We recommend using a binary search approach to
-   * finding the optimal value for your use case.
-   * 
- * - * float boost = 4; - * @return The boost. - */ - float getBoost(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java deleted file mode 100644 index 774dc9363ac9..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechProto.java +++ /dev/null @@ -1,406 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public final class SpeechProto { - private SpeechProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_RecognizeRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_RecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_LongRunningRecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_TranscriptOutputConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_TranscriptOutputConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_RecognitionConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_RecognitionConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_SpeakerDiarizationConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_RecognitionMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_RecognitionMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_SpeechContext_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_SpeechContext_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_RecognitionAudio_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_RecognitionAudio_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_RecognizeResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_RecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_LongRunningRecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_LongRunningRecognizeMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_StreamingRecognitionResult_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_StreamingRecognitionResult_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_SpeechRecognitionResult_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_SpeechRecognitionResult_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_WordInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_WordInfo_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n)google/cloud/speech/v1/cloud_speech.pr" + - "oto\022\026google.cloud.speech.v1\032\034google/api/" + - "annotations.proto\032\027google/api/client.pro" + - "to\032\037google/api/field_behavior.proto\032%goo" + - "gle/cloud/speech/v1/resource.proto\032#goog" + - "le/longrunning/operations.proto\032\036google/" + - "protobuf/duration.proto\032\037google/protobuf" + - "/timestamp.proto\032\036google/protobuf/wrappe" + - "rs.proto\032\027google/rpc/status.proto\"\220\001\n\020Re" + - "cognizeRequest\022>\n\006config\030\001 \001(\0132).google." + - "cloud.speech.v1.RecognitionConfigB\003\340A\002\022<" + - "\n\005audio\030\002 \001(\0132(.google.cloud.speech.v1.R" + - "ecognitionAudioB\003\340A\002\"\347\001\n\033LongRunningReco" + - "gnizeRequest\022>\n\006config\030\001 \001(\0132).google.cl" + - "oud.speech.v1.RecognitionConfigB\003\340A\002\022<\n\005" + - "audio\030\002 \001(\0132(.google.cloud.speech.v1.Rec" + - "ognitionAudioB\003\340A\002\022J\n\routput_config\030\004 \001(" + - "\0132..google.cloud.speech.v1.TranscriptOut" + - "putConfigB\003\340A\001\":\n\026TranscriptOutputConfig" + - "\022\021\n\007gcs_uri\030\001 \001(\tH\000B\r\n\013output_type\"\231\001\n\031S" + - "treamingRecognizeRequest\022N\n\020streaming_co" + - "nfig\030\001 \001(\01322.google.cloud.speech.v1.Stre" + - "amingRecognitionConfigH\000\022\027\n\raudio_conten" + - "t\030\002 \001(\014H\000B\023\n\021streaming_request\"\217\001\n\032Strea" + - "mingRecognitionConfig\022>\n\006config\030\001 \001(\0132)." + - "google.cloud.speech.v1.RecognitionConfig" + - "B\003\340A\002\022\030\n\020single_utterance\030\002 \001(\010\022\027\n\017inter" + - "im_results\030\003 \001(\010\"\351\007\n\021RecognitionConfig\022I" + - "\n\010encoding\030\001 \001(\01627.google.cloud.speech.v" + - "1.RecognitionConfig.AudioEncoding\022\031\n\021sam" + - "ple_rate_hertz\030\002 \001(\005\022\033\n\023audio_channel_co" + - "unt\030\007 \001(\005\022/\n\'enable_separate_recognition" + - "_per_channel\030\014 \001(\010\022\032\n\rlanguage_code\030\003 \001(" + - "\tB\003\340A\002\022\"\n\032alternative_language_codes\030\022 \003" + - "(\t\022\030\n\020max_alternatives\030\004 \001(\005\022\030\n\020profanit" + - "y_filter\030\005 \001(\010\022<\n\nadaptation\030\024 \001(\0132(.goo" + - "gle.cloud.speech.v1.SpeechAdaptation\022>\n\017" + - "speech_contexts\030\006 \003(\0132%.google.cloud.spe" + - "ech.v1.SpeechContext\022 \n\030enable_word_time" + - "_offsets\030\010 \001(\010\022\036\n\026enable_word_confidence" + - "\030\017 \001(\010\022$\n\034enable_automatic_punctuation\030\013" + - " \001(\010\022=\n\031enable_spoken_punctuation\030\026 \001(\0132" + - "\032.google.protobuf.BoolValue\0228\n\024enable_sp" + - "oken_emojis\030\027 \001(\0132\032.google.protobuf.Bool" + - "Value\022L\n\022diarization_config\030\023 \001(\01320.goog" + - "le.cloud.speech.v1.SpeakerDiarizationCon" + - "fig\022=\n\010metadata\030\t \001(\0132+.google.cloud.spe" + - "ech.v1.RecognitionMetadata\022\r\n\005model\030\r \001(" + - "\t\022\024\n\014use_enhanced\030\016 \001(\010\"\232\001\n\rAudioEncodin" + - "g\022\030\n\024ENCODING_UNSPECIFIED\020\000\022\014\n\010LINEAR16\020" + - "\001\022\010\n\004FLAC\020\002\022\t\n\005MULAW\020\003\022\007\n\003AMR\020\004\022\n\n\006AMR_W" + - "B\020\005\022\014\n\010OGG_OPUS\020\006\022\032\n\026SPEEX_WITH_HEADER_B" + - "YTE\020\007\022\r\n\tWEBM_OPUS\020\t\"\220\001\n\030SpeakerDiarizat" + - "ionConfig\022\"\n\032enable_speaker_diarization\030" + - "\001 \001(\010\022\031\n\021min_speaker_count\030\002 \001(\005\022\031\n\021max_" + - "speaker_count\030\003 \001(\005\022\032\n\013speaker_tag\030\005 \001(\005" + - "B\005\030\001\340A\003\"\244\010\n\023RecognitionMetadata\022U\n\020inter" + - "action_type\030\001 \001(\0162;.google.cloud.speech." + - "v1.RecognitionMetadata.InteractionType\022$" + - "\n\034industry_naics_code_of_audio\030\003 \001(\r\022[\n\023" + - "microphone_distance\030\004 \001(\0162>.google.cloud" + - ".speech.v1.RecognitionMetadata.Microphon" + - "eDistance\022Z\n\023original_media_type\030\005 \001(\0162=" + - ".google.cloud.speech.v1.RecognitionMetad" + - "ata.OriginalMediaType\022^\n\025recording_devic" + - "e_type\030\006 \001(\0162?.google.cloud.speech.v1.Re" + - "cognitionMetadata.RecordingDeviceType\022\035\n" + - "\025recording_device_name\030\007 \001(\t\022\032\n\022original" + - "_mime_type\030\010 \001(\t\022\023\n\013audio_topic\030\n \001(\t\"\305\001" + - "\n\017InteractionType\022 \n\034INTERACTION_TYPE_UN" + - "SPECIFIED\020\000\022\016\n\nDISCUSSION\020\001\022\020\n\014PRESENTAT" + - "ION\020\002\022\016\n\nPHONE_CALL\020\003\022\r\n\tVOICEMAIL\020\004\022\033\n\027" + - "PROFESSIONALLY_PRODUCED\020\005\022\020\n\014VOICE_SEARC" + - "H\020\006\022\021\n\rVOICE_COMMAND\020\007\022\r\n\tDICTATION\020\010\"d\n" + - "\022MicrophoneDistance\022#\n\037MICROPHONE_DISTAN" + - "CE_UNSPECIFIED\020\000\022\r\n\tNEARFIELD\020\001\022\014\n\010MIDFI" + - "ELD\020\002\022\014\n\010FARFIELD\020\003\"N\n\021OriginalMediaType" + - "\022#\n\037ORIGINAL_MEDIA_TYPE_UNSPECIFIED\020\000\022\t\n" + - "\005AUDIO\020\001\022\t\n\005VIDEO\020\002\"\244\001\n\023RecordingDeviceT" + - "ype\022%\n!RECORDING_DEVICE_TYPE_UNSPECIFIED" + - "\020\000\022\016\n\nSMARTPHONE\020\001\022\006\n\002PC\020\002\022\016\n\nPHONE_LINE" + - "\020\003\022\013\n\007VEHICLE\020\004\022\030\n\024OTHER_OUTDOOR_DEVICE\020" + - "\005\022\027\n\023OTHER_INDOOR_DEVICE\020\006:\002\030\001\"/\n\rSpeech" + - "Context\022\017\n\007phrases\030\001 \003(\t\022\r\n\005boost\030\004 \001(\002\"" + - "D\n\020RecognitionAudio\022\021\n\007content\030\001 \001(\014H\000\022\r" + - "\n\003uri\030\002 \001(\tH\000B\016\n\014audio_source\"\213\001\n\021Recogn" + - "izeResponse\022@\n\007results\030\002 \003(\0132/.google.cl" + - "oud.speech.v1.SpeechRecognitionResult\0224\n" + - "\021total_billed_time\030\003 \001(\0132\031.google.protob" + - "uf.Duration\"\207\002\n\034LongRunningRecognizeResp" + - "onse\022@\n\007results\030\002 \003(\0132/.google.cloud.spe" + - "ech.v1.SpeechRecognitionResult\0224\n\021total_" + - "billed_time\030\003 \001(\0132\031.google.protobuf.Dura" + - "tion\022E\n\routput_config\030\006 \001(\0132..google.clo" + - "ud.speech.v1.TranscriptOutputConfig\022(\n\014o" + - "utput_error\030\007 \001(\0132\022.google.rpc.Status\"\260\001" + - "\n\034LongRunningRecognizeMetadata\022\030\n\020progre" + - "ss_percent\030\001 \001(\005\022.\n\nstart_time\030\002 \001(\0132\032.g" + - "oogle.protobuf.Timestamp\0224\n\020last_update_" + - "time\030\003 \001(\0132\032.google.protobuf.Timestamp\022\020" + - "\n\003uri\030\004 \001(\tB\003\340A\003\"\347\002\n\032StreamingRecognizeR" + - "esponse\022!\n\005error\030\001 \001(\0132\022.google.rpc.Stat" + - "us\022C\n\007results\030\002 \003(\01322.google.cloud.speec" + - "h.v1.StreamingRecognitionResult\022]\n\021speec" + - "h_event_type\030\004 \001(\0162B.google.cloud.speech" + - ".v1.StreamingRecognizeResponse.SpeechEve" + - "ntType\0224\n\021total_billed_time\030\005 \001(\0132\031.goog" + - "le.protobuf.Duration\"L\n\017SpeechEventType\022" + - "\034\n\030SPEECH_EVENT_UNSPECIFIED\020\000\022\033\n\027END_OF_" + - "SINGLE_UTTERANCE\020\001\"\362\001\n\032StreamingRecognit" + - "ionResult\022J\n\014alternatives\030\001 \003(\01324.google" + - ".cloud.speech.v1.SpeechRecognitionAltern" + - "ative\022\020\n\010is_final\030\002 \001(\010\022\021\n\tstability\030\003 \001" + - "(\002\0222\n\017result_end_time\030\004 \001(\0132\031.google.pro" + - "tobuf.Duration\022\023\n\013channel_tag\030\005 \001(\005\022\032\n\rl" + - "anguage_code\030\006 \001(\tB\003\340A\003\"\312\001\n\027SpeechRecogn" + - "itionResult\022J\n\014alternatives\030\001 \003(\01324.goog" + - "le.cloud.speech.v1.SpeechRecognitionAlte" + - "rnative\022\023\n\013channel_tag\030\002 \001(\005\0222\n\017result_e" + - "nd_time\030\004 \001(\0132\031.google.protobuf.Duration" + - "\022\032\n\rlanguage_code\030\005 \001(\tB\003\340A\003\"w\n\034SpeechRe" + - "cognitionAlternative\022\022\n\ntranscript\030\001 \001(\t" + - "\022\022\n\nconfidence\030\002 \001(\002\022/\n\005words\030\003 \003(\0132 .go" + - "ogle.cloud.speech.v1.WordInfo\"\242\001\n\010WordIn" + - "fo\022-\n\nstart_time\030\001 \001(\0132\031.google.protobuf" + - ".Duration\022+\n\010end_time\030\002 \001(\0132\031.google.pro" + - "tobuf.Duration\022\014\n\004word\030\003 \001(\t\022\022\n\nconfiden" + - "ce\030\004 \001(\002\022\030\n\013speaker_tag\030\005 \001(\005B\003\340A\0032\321\004\n\006S" + - "peech\022\220\001\n\tRecognize\022(.google.cloud.speec" + - "h.v1.RecognizeRequest\032).google.cloud.spe" + - "ech.v1.RecognizeResponse\".\202\323\344\223\002\031\"\024/v1/sp" + - "eech:recognize:\001*\332A\014config,audio\022\344\001\n\024Lon" + - "gRunningRecognize\0223.google.cloud.speech." + - "v1.LongRunningRecognizeRequest\032\035.google." + - "longrunning.Operation\"x\202\323\344\223\002$\"\037/v1/speec" + - "h:longrunningrecognize:\001*\332A\014config,audio" + - "\312A<\n\034LongRunningRecognizeResponse\022\034LongR" + - "unningRecognizeMetadata\022\201\001\n\022StreamingRec" + - "ognize\0221.google.cloud.speech.v1.Streamin" + - "gRecognizeRequest\0322.google.cloud.speech." + - "v1.StreamingRecognizeResponse\"\000(\0010\001\032I\312A\025" + - "speech.googleapis.com\322A.https://www.goog" + - "leapis.com/auth/cloud-platformBr\n\032com.go" + - "ogle.cloud.speech.v1B\013SpeechProtoP\001Z - * Alternative hypotheses (a.k.a. n-best list). - * - * - * Protobuf type {@code google.cloud.speech.v1.SpeechRecognitionAlternative} - */ -public final class SpeechRecognitionAlternative extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechRecognitionAlternative) - SpeechRecognitionAlternativeOrBuilder { -private static final long serialVersionUID = 0L; - // Use SpeechRecognitionAlternative.newBuilder() to construct. - private SpeechRecognitionAlternative(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SpeechRecognitionAlternative() { - transcript_ = ""; - words_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SpeechRecognitionAlternative(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SpeechRecognitionAlternative( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - transcript_ = s; - break; - } - case 21: { - - confidence_ = input.readFloat(); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - words_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - words_.add( - input.readMessage(com.google.cloud.speech.v1.WordInfo.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - words_ = java.util.Collections.unmodifiableList(words_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechRecognitionAlternative.class, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder.class); - } - - public static final int TRANSCRIPT_FIELD_NUMBER = 1; - private volatile java.lang.Object transcript_; - /** - *
-   * Transcript text representing the words that the user spoke.
-   * In languages that use spaces to separate words, the transcript might have a
-   * leading space if it isn't the first result. You can concatenate each result
-   * to obtain the full transcript without using a separator.
-   * 
- * - * string transcript = 1; - * @return The transcript. - */ - @java.lang.Override - public java.lang.String getTranscript() { - java.lang.Object ref = transcript_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - transcript_ = s; - return s; - } - } - /** - *
-   * Transcript text representing the words that the user spoke.
-   * In languages that use spaces to separate words, the transcript might have a
-   * leading space if it isn't the first result. You can concatenate each result
-   * to obtain the full transcript without using a separator.
-   * 
- * - * string transcript = 1; - * @return The bytes for transcript. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTranscriptBytes() { - java.lang.Object ref = transcript_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - transcript_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONFIDENCE_FIELD_NUMBER = 2; - private float confidence_; - /** - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 2; - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - - public static final int WORDS_FIELD_NUMBER = 3; - private java.util.List words_; - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - @java.lang.Override - public java.util.List getWordsList() { - return words_; - } - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - @java.lang.Override - public java.util.List - getWordsOrBuilderList() { - return words_; - } - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - @java.lang.Override - public int getWordsCount() { - return words_.size(); - } - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1.WordInfo getWords(int index) { - return words_.get(index); - } - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1.WordInfoOrBuilder getWordsOrBuilder( - int index) { - return words_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(transcript_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, transcript_); - } - if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { - output.writeFloat(2, confidence_); - } - for (int i = 0; i < words_.size(); i++) { - output.writeMessage(3, words_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(transcript_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, transcript_); - } - if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(2, confidence_); - } - for (int i = 0; i < words_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, words_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.SpeechRecognitionAlternative)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.SpeechRecognitionAlternative other = (com.google.cloud.speech.v1.SpeechRecognitionAlternative) obj; - - if (!getTranscript() - .equals(other.getTranscript())) return false; - if (java.lang.Float.floatToIntBits(getConfidence()) - != java.lang.Float.floatToIntBits( - other.getConfidence())) return false; - if (!getWordsList() - .equals(other.getWordsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TRANSCRIPT_FIELD_NUMBER; - hash = (53 * hash) + getTranscript().hashCode(); - hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getConfidence()); - if (getWordsCount() > 0) { - hash = (37 * hash) + WORDS_FIELD_NUMBER; - hash = (53 * hash) + getWordsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.SpeechRecognitionAlternative prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Alternative hypotheses (a.k.a. n-best list).
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeechRecognitionAlternative} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechRecognitionAlternative) - com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechRecognitionAlternative.class, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.SpeechRecognitionAlternative.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getWordsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - transcript_ = ""; - - confidence_ = 0F; - - if (wordsBuilder_ == null) { - words_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - wordsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionAlternative_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternative getDefaultInstanceForType() { - return com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternative build() { - com.google.cloud.speech.v1.SpeechRecognitionAlternative result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternative buildPartial() { - com.google.cloud.speech.v1.SpeechRecognitionAlternative result = new com.google.cloud.speech.v1.SpeechRecognitionAlternative(this); - int from_bitField0_ = bitField0_; - result.transcript_ = transcript_; - result.confidence_ = confidence_; - if (wordsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - words_ = java.util.Collections.unmodifiableList(words_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.words_ = words_; - } else { - result.words_ = wordsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.SpeechRecognitionAlternative) { - return mergeFrom((com.google.cloud.speech.v1.SpeechRecognitionAlternative)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.SpeechRecognitionAlternative other) { - if (other == com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()) return this; - if (!other.getTranscript().isEmpty()) { - transcript_ = other.transcript_; - onChanged(); - } - if (other.getConfidence() != 0F) { - setConfidence(other.getConfidence()); - } - if (wordsBuilder_ == null) { - if (!other.words_.isEmpty()) { - if (words_.isEmpty()) { - words_ = other.words_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureWordsIsMutable(); - words_.addAll(other.words_); - } - onChanged(); - } - } else { - if (!other.words_.isEmpty()) { - if (wordsBuilder_.isEmpty()) { - wordsBuilder_.dispose(); - wordsBuilder_ = null; - words_ = other.words_; - bitField0_ = (bitField0_ & ~0x00000001); - wordsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getWordsFieldBuilder() : null; - } else { - wordsBuilder_.addAllMessages(other.words_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.SpeechRecognitionAlternative parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.SpeechRecognitionAlternative) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object transcript_ = ""; - /** - *
-     * Transcript text representing the words that the user spoke.
-     * In languages that use spaces to separate words, the transcript might have a
-     * leading space if it isn't the first result. You can concatenate each result
-     * to obtain the full transcript without using a separator.
-     * 
- * - * string transcript = 1; - * @return The transcript. - */ - public java.lang.String getTranscript() { - java.lang.Object ref = transcript_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - transcript_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Transcript text representing the words that the user spoke.
-     * In languages that use spaces to separate words, the transcript might have a
-     * leading space if it isn't the first result. You can concatenate each result
-     * to obtain the full transcript without using a separator.
-     * 
- * - * string transcript = 1; - * @return The bytes for transcript. - */ - public com.google.protobuf.ByteString - getTranscriptBytes() { - java.lang.Object ref = transcript_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - transcript_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Transcript text representing the words that the user spoke.
-     * In languages that use spaces to separate words, the transcript might have a
-     * leading space if it isn't the first result. You can concatenate each result
-     * to obtain the full transcript without using a separator.
-     * 
- * - * string transcript = 1; - * @param value The transcript to set. - * @return This builder for chaining. - */ - public Builder setTranscript( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - transcript_ = value; - onChanged(); - return this; - } - /** - *
-     * Transcript text representing the words that the user spoke.
-     * In languages that use spaces to separate words, the transcript might have a
-     * leading space if it isn't the first result. You can concatenate each result
-     * to obtain the full transcript without using a separator.
-     * 
- * - * string transcript = 1; - * @return This builder for chaining. - */ - public Builder clearTranscript() { - - transcript_ = getDefaultInstance().getTranscript(); - onChanged(); - return this; - } - /** - *
-     * Transcript text representing the words that the user spoke.
-     * In languages that use spaces to separate words, the transcript might have a
-     * leading space if it isn't the first result. You can concatenate each result
-     * to obtain the full transcript without using a separator.
-     * 
- * - * string transcript = 1; - * @param value The bytes for transcript to set. - * @return This builder for chaining. - */ - public Builder setTranscriptBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - transcript_ = value; - onChanged(); - return this; - } - - private float confidence_ ; - /** - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - /** - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - * @param value The confidence to set. - * @return This builder for chaining. - */ - public Builder setConfidence(float value) { - - confidence_ = value; - onChanged(); - return this; - } - /** - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - * @return This builder for chaining. - */ - public Builder clearConfidence() { - - confidence_ = 0F; - onChanged(); - return this; - } - - private java.util.List words_ = - java.util.Collections.emptyList(); - private void ensureWordsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - words_ = new java.util.ArrayList(words_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.WordInfo, com.google.cloud.speech.v1.WordInfo.Builder, com.google.cloud.speech.v1.WordInfoOrBuilder> wordsBuilder_; - - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public java.util.List getWordsList() { - if (wordsBuilder_ == null) { - return java.util.Collections.unmodifiableList(words_); - } else { - return wordsBuilder_.getMessageList(); - } - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public int getWordsCount() { - if (wordsBuilder_ == null) { - return words_.size(); - } else { - return wordsBuilder_.getCount(); - } - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1.WordInfo getWords(int index) { - if (wordsBuilder_ == null) { - return words_.get(index); - } else { - return wordsBuilder_.getMessage(index); - } - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder setWords( - int index, com.google.cloud.speech.v1.WordInfo value) { - if (wordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.set(index, value); - onChanged(); - } else { - wordsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder setWords( - int index, com.google.cloud.speech.v1.WordInfo.Builder builderForValue) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.set(index, builderForValue.build()); - onChanged(); - } else { - wordsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder addWords(com.google.cloud.speech.v1.WordInfo value) { - if (wordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.add(value); - onChanged(); - } else { - wordsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder addWords( - int index, com.google.cloud.speech.v1.WordInfo value) { - if (wordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.add(index, value); - onChanged(); - } else { - wordsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder addWords( - com.google.cloud.speech.v1.WordInfo.Builder builderForValue) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.add(builderForValue.build()); - onChanged(); - } else { - wordsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder addWords( - int index, com.google.cloud.speech.v1.WordInfo.Builder builderForValue) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.add(index, builderForValue.build()); - onChanged(); - } else { - wordsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder addAllWords( - java.lang.Iterable values) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, words_); - onChanged(); - } else { - wordsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder clearWords() { - if (wordsBuilder_ == null) { - words_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - wordsBuilder_.clear(); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public Builder removeWords(int index) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.remove(index); - onChanged(); - } else { - wordsBuilder_.remove(index); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1.WordInfo.Builder getWordsBuilder( - int index) { - return getWordsFieldBuilder().getBuilder(index); - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1.WordInfoOrBuilder getWordsOrBuilder( - int index) { - if (wordsBuilder_ == null) { - return words_.get(index); } else { - return wordsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public java.util.List - getWordsOrBuilderList() { - if (wordsBuilder_ != null) { - return wordsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(words_); - } - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1.WordInfo.Builder addWordsBuilder() { - return getWordsFieldBuilder().addBuilder( - com.google.cloud.speech.v1.WordInfo.getDefaultInstance()); - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1.WordInfo.Builder addWordsBuilder( - int index) { - return getWordsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.WordInfo.getDefaultInstance()); - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - public java.util.List - getWordsBuilderList() { - return getWordsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.WordInfo, com.google.cloud.speech.v1.WordInfo.Builder, com.google.cloud.speech.v1.WordInfoOrBuilder> - getWordsFieldBuilder() { - if (wordsBuilder_ == null) { - wordsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.WordInfo, com.google.cloud.speech.v1.WordInfo.Builder, com.google.cloud.speech.v1.WordInfoOrBuilder>( - words_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - words_ = null; - } - return wordsBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeechRecognitionAlternative) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechRecognitionAlternative) - private static final com.google.cloud.speech.v1.SpeechRecognitionAlternative DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechRecognitionAlternative(); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionAlternative getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechRecognitionAlternative parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechRecognitionAlternative(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternative getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternativeOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternativeOrBuilder.java deleted file mode 100644 index 90fecb6d97c4..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionAlternativeOrBuilder.java +++ /dev/null @@ -1,105 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface SpeechRecognitionAlternativeOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeechRecognitionAlternative) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Transcript text representing the words that the user spoke.
-   * In languages that use spaces to separate words, the transcript might have a
-   * leading space if it isn't the first result. You can concatenate each result
-   * to obtain the full transcript without using a separator.
-   * 
- * - * string transcript = 1; - * @return The transcript. - */ - java.lang.String getTranscript(); - /** - *
-   * Transcript text representing the words that the user spoke.
-   * In languages that use spaces to separate words, the transcript might have a
-   * leading space if it isn't the first result. You can concatenate each result
-   * to obtain the full transcript without using a separator.
-   * 
- * - * string transcript = 1; - * @return The bytes for transcript. - */ - com.google.protobuf.ByteString - getTranscriptBytes(); - - /** - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 2; - * @return The confidence. - */ - float getConfidence(); - - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - java.util.List - getWordsList(); - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - com.google.cloud.speech.v1.WordInfo getWords(int index); - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - int getWordsCount(); - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - java.util.List - getWordsOrBuilderList(); - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1.WordInfo words = 3; - */ - com.google.cloud.speech.v1.WordInfoOrBuilder getWordsOrBuilder( - int index); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResult.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResult.java deleted file mode 100644 index 5ae5d7147cc3..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResult.java +++ /dev/null @@ -1,1457 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * A speech recognition result corresponding to a portion of the audio.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeechRecognitionResult} - */ -public final class SpeechRecognitionResult extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.SpeechRecognitionResult) - SpeechRecognitionResultOrBuilder { -private static final long serialVersionUID = 0L; - // Use SpeechRecognitionResult.newBuilder() to construct. - private SpeechRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SpeechRecognitionResult() { - alternatives_ = java.util.Collections.emptyList(); - languageCode_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SpeechRecognitionResult(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SpeechRecognitionResult( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - alternatives_.add( - input.readMessage(com.google.cloud.speech.v1.SpeechRecognitionAlternative.parser(), extensionRegistry)); - break; - } - case 16: { - - channelTag_ = input.readInt32(); - break; - } - case 34: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (resultEndTime_ != null) { - subBuilder = resultEndTime_.toBuilder(); - } - resultEndTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(resultEndTime_); - resultEndTime_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - languageCode_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechRecognitionResult.class, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder.class); - } - - public static final int ALTERNATIVES_FIELD_NUMBER = 1; - private java.util.List alternatives_; - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public java.util.List getAlternativesList() { - return alternatives_; - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public java.util.List - getAlternativesOrBuilderList() { - return alternatives_; - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public int getAlternativesCount() { - return alternatives_.size(); - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index) { - return alternatives_.get(index); - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index) { - return alternatives_.get(index); - } - - public static final int CHANNEL_TAG_FIELD_NUMBER = 2; - private int channelTag_; - /** - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 2; - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - - public static final int RESULT_END_TIME_FIELD_NUMBER = 4; - private com.google.protobuf.Duration resultEndTime_; - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return Whether the resultEndTime field is set. - */ - @java.lang.Override - public boolean hasResultEndTime() { - return resultEndTime_ != null; - } - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return The resultEndTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getResultEndTime() { - return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; - } - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { - return getResultEndTime(); - } - - public static final int LANGUAGE_CODE_FIELD_NUMBER = 5; - private volatile java.lang.Object languageCode_; - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The languageCode. - */ - @java.lang.Override - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } - } - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for languageCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < alternatives_.size(); i++) { - output.writeMessage(1, alternatives_.get(i)); - } - if (channelTag_ != 0) { - output.writeInt32(2, channelTag_); - } - if (resultEndTime_ != null) { - output.writeMessage(4, getResultEndTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, languageCode_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < alternatives_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, alternatives_.get(i)); - } - if (channelTag_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, channelTag_); - } - if (resultEndTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getResultEndTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, languageCode_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.SpeechRecognitionResult)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.SpeechRecognitionResult other = (com.google.cloud.speech.v1.SpeechRecognitionResult) obj; - - if (!getAlternativesList() - .equals(other.getAlternativesList())) return false; - if (getChannelTag() - != other.getChannelTag()) return false; - if (hasResultEndTime() != other.hasResultEndTime()) return false; - if (hasResultEndTime()) { - if (!getResultEndTime() - .equals(other.getResultEndTime())) return false; - } - if (!getLanguageCode() - .equals(other.getLanguageCode())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAlternativesCount() > 0) { - hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativesList().hashCode(); - } - hash = (37 * hash) + CHANNEL_TAG_FIELD_NUMBER; - hash = (53 * hash) + getChannelTag(); - if (hasResultEndTime()) { - hash = (37 * hash) + RESULT_END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getResultEndTime().hashCode(); - } - hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getLanguageCode().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.SpeechRecognitionResult parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.SpeechRecognitionResult prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * A speech recognition result corresponding to a portion of the audio.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.SpeechRecognitionResult} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.SpeechRecognitionResult) - com.google.cloud.speech.v1.SpeechRecognitionResultOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.SpeechRecognitionResult.class, com.google.cloud.speech.v1.SpeechRecognitionResult.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.SpeechRecognitionResult.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getAlternativesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - alternativesBuilder_.clear(); - } - channelTag_ = 0; - - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = null; - } else { - resultEndTime_ = null; - resultEndTimeBuilder_ = null; - } - languageCode_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_SpeechRecognitionResult_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResult getDefaultInstanceForType() { - return com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResult build() { - com.google.cloud.speech.v1.SpeechRecognitionResult result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResult buildPartial() { - com.google.cloud.speech.v1.SpeechRecognitionResult result = new com.google.cloud.speech.v1.SpeechRecognitionResult(this); - int from_bitField0_ = bitField0_; - if (alternativesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternatives_ = alternatives_; - } else { - result.alternatives_ = alternativesBuilder_.build(); - } - result.channelTag_ = channelTag_; - if (resultEndTimeBuilder_ == null) { - result.resultEndTime_ = resultEndTime_; - } else { - result.resultEndTime_ = resultEndTimeBuilder_.build(); - } - result.languageCode_ = languageCode_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.SpeechRecognitionResult) { - return mergeFrom((com.google.cloud.speech.v1.SpeechRecognitionResult)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.SpeechRecognitionResult other) { - if (other == com.google.cloud.speech.v1.SpeechRecognitionResult.getDefaultInstance()) return this; - if (alternativesBuilder_ == null) { - if (!other.alternatives_.isEmpty()) { - if (alternatives_.isEmpty()) { - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativesIsMutable(); - alternatives_.addAll(other.alternatives_); - } - onChanged(); - } - } else { - if (!other.alternatives_.isEmpty()) { - if (alternativesBuilder_.isEmpty()) { - alternativesBuilder_.dispose(); - alternativesBuilder_ = null; - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - alternativesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAlternativesFieldBuilder() : null; - } else { - alternativesBuilder_.addAllMessages(other.alternatives_); - } - } - } - if (other.getChannelTag() != 0) { - setChannelTag(other.getChannelTag()); - } - if (other.hasResultEndTime()) { - mergeResultEndTime(other.getResultEndTime()); - } - if (!other.getLanguageCode().isEmpty()) { - languageCode_ = other.languageCode_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.SpeechRecognitionResult parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.SpeechRecognitionResult) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List alternatives_ = - java.util.Collections.emptyList(); - private void ensureAlternativesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - alternatives_ = new java.util.ArrayList(alternatives_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionAlternative, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> alternativesBuilder_; - - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List getAlternativesList() { - if (alternativesBuilder_ == null) { - return java.util.Collections.unmodifiableList(alternatives_); - } else { - return alternativesBuilder_.getMessageList(); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public int getAlternativesCount() { - if (alternativesBuilder_ == null) { - return alternatives_.size(); - } else { - return alternativesBuilder_.getCount(); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessage(index); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.set(index, value); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.set(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives(com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(value); - onChanged(); - } else { - alternativesBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(index, value); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAllAlternatives( - java.lang.Iterable values) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, alternatives_); - onChanged(); - } else { - alternativesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder clearAlternatives() { - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - alternativesBuilder_.clear(); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder removeAlternatives(int index) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.remove(index); - onChanged(); - } else { - alternativesBuilder_.remove(index); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder getAlternativesBuilder( - int index) { - return getAlternativesFieldBuilder().getBuilder(index); - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); } else { - return alternativesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List - getAlternativesOrBuilderList() { - if (alternativesBuilder_ != null) { - return alternativesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(alternatives_); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder addAlternativesBuilder() { - return getAlternativesFieldBuilder().addBuilder( - com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder addAlternativesBuilder( - int index) { - return getAlternativesFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List - getAlternativesBuilderList() { - return getAlternativesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionAlternative, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesFieldBuilder() { - if (alternativesBuilder_ == null) { - alternativesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionAlternative, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder>( - alternatives_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - alternatives_ = null; - } - return alternativesBuilder_; - } - - private int channelTag_ ; - /** - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 2; - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - /** - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 2; - * @param value The channelTag to set. - * @return This builder for chaining. - */ - public Builder setChannelTag(int value) { - - channelTag_ = value; - onChanged(); - return this; - } - /** - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 2; - * @return This builder for chaining. - */ - public Builder clearChannelTag() { - - channelTag_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Duration resultEndTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> resultEndTimeBuilder_; - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return Whether the resultEndTime field is set. - */ - public boolean hasResultEndTime() { - return resultEndTimeBuilder_ != null || resultEndTime_ != null; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return The resultEndTime. - */ - public com.google.protobuf.Duration getResultEndTime() { - if (resultEndTimeBuilder_ == null) { - return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; - } else { - return resultEndTimeBuilder_.getMessage(); - } - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder setResultEndTime(com.google.protobuf.Duration value) { - if (resultEndTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - resultEndTime_ = value; - onChanged(); - } else { - resultEndTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder setResultEndTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = builderForValue.build(); - onChanged(); - } else { - resultEndTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder mergeResultEndTime(com.google.protobuf.Duration value) { - if (resultEndTimeBuilder_ == null) { - if (resultEndTime_ != null) { - resultEndTime_ = - com.google.protobuf.Duration.newBuilder(resultEndTime_).mergeFrom(value).buildPartial(); - } else { - resultEndTime_ = value; - } - onChanged(); - } else { - resultEndTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder clearResultEndTime() { - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = null; - onChanged(); - } else { - resultEndTime_ = null; - resultEndTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public com.google.protobuf.Duration.Builder getResultEndTimeBuilder() { - - onChanged(); - return getResultEndTimeFieldBuilder().getBuilder(); - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { - if (resultEndTimeBuilder_ != null) { - return resultEndTimeBuilder_.getMessageOrBuilder(); - } else { - return resultEndTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; - } - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getResultEndTimeFieldBuilder() { - if (resultEndTimeBuilder_ == null) { - resultEndTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getResultEndTime(), - getParentForChildren(), - isClean()); - resultEndTime_ = null; - } - return resultEndTimeBuilder_; - } - - private java.lang.Object languageCode_ = ""; - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The languageCode. - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for languageCode. - */ - public com.google.protobuf.ByteString - getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCode( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - languageCode_ = value; - onChanged(); - return this; - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return This builder for chaining. - */ - public Builder clearLanguageCode() { - - languageCode_ = getDefaultInstance().getLanguageCode(); - onChanged(); - return this; - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The bytes for languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCodeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - languageCode_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.SpeechRecognitionResult) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechRecognitionResult) - private static final com.google.cloud.speech.v1.SpeechRecognitionResult DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.SpeechRecognitionResult(); - } - - public static com.google.cloud.speech.v1.SpeechRecognitionResult getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechRecognitionResult parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechRecognitionResult(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionResult getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResultOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResultOrBuilder.java deleted file mode 100644 index aa2bef7b69e6..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechRecognitionResultOrBuilder.java +++ /dev/null @@ -1,134 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface SpeechRecognitionResultOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.SpeechRecognitionResult) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - java.util.List - getAlternativesList(); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - int getAlternativesCount(); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - java.util.List - getAlternativesOrBuilderList(); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index); - - /** - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 2; - * @return The channelTag. - */ - int getChannelTag(); - - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return Whether the resultEndTime field is set. - */ - boolean hasResultEndTime(); - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return The resultEndTime. - */ - com.google.protobuf.Duration getResultEndTime(); - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder(); - - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The languageCode. - */ - java.lang.String getLanguageCode(); - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for languageCode. - */ - com.google.protobuf.ByteString - getLanguageCodeBytes(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechResourceProto.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechResourceProto.java deleted file mode 100644 index c8d1551f7230..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/SpeechResourceProto.java +++ /dev/null @@ -1,121 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/resource.proto - -package com.google.cloud.speech.v1; - -public final class SpeechResourceProto { - private SpeechResourceProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_CustomClass_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_CustomClass_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_CustomClass_ClassItem_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_CustomClass_ClassItem_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_PhraseSet_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_PhraseSet_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_PhraseSet_Phrase_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_PhraseSet_Phrase_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1_SpeechAdaptation_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1_SpeechAdaptation_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n%google/cloud/speech/v1/resource.proto\022" + - "\026google.cloud.speech.v1\032\031google/api/reso" + - "urce.proto\"\374\001\n\013CustomClass\022\014\n\004name\030\001 \001(\t" + - "\022\027\n\017custom_class_id\030\002 \001(\t\022<\n\005items\030\003 \003(\013" + - "2-.google.cloud.speech.v1.CustomClass.Cl" + - "assItem\032\032\n\tClassItem\022\r\n\005value\030\001 \001(\t:l\352Ai" + - "\n!speech.googleapis.com/CustomClass\022Dpro" + - "jects/{project}/locations/{location}/cus" + - "tomClasses/{custom_class}\"\362\001\n\tPhraseSet\022" + - "\014\n\004name\030\001 \001(\t\0229\n\007phrases\030\002 \003(\0132(.google." + - "cloud.speech.v1.PhraseSet.Phrase\022\r\n\005boos" + - "t\030\004 \001(\002\032&\n\006Phrase\022\r\n\005value\030\001 \001(\t\022\r\n\005boos" + - "t\030\002 \001(\002:e\352Ab\n\037speech.googleapis.com/Phra" + - "seSet\022?projects/{project}/locations/{loc" + - "ation}/phraseSets/{phrase_set}\"\314\001\n\020Speec" + - "hAdaptation\0226\n\013phrase_sets\030\001 \003(\0132!.googl" + - "e.cloud.speech.v1.PhraseSet\022C\n\025phrase_se" + - "t_references\030\002 \003(\tB$\372A!\n\037speech.googleap" + - "is.com/PhraseSet\022;\n\016custom_classes\030\003 \003(\013" + - "2#.google.cloud.speech.v1.CustomClassBz\n" + - "\032com.google.cloud.speech.v1B\023SpeechResou" + - "rceProtoP\001Z - * Provides information to the recognizer that specifies how to process the - * request. - * - * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognitionConfig} - */ -public final class StreamingRecognitionConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.StreamingRecognitionConfig) - StreamingRecognitionConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use StreamingRecognitionConfig.newBuilder() to construct. - private StreamingRecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamingRecognitionConfig() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StreamingRecognitionConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamingRecognitionConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.cloud.speech.v1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = input.readMessage(com.google.cloud.speech.v1.RecognitionConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 16: { - - singleUtterance_ = input.readBool(); - break; - } - case 24: { - - interimResults_ = input.readBool(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognitionConfig.class, com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1.RecognitionConfig config_; - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfig getConfig() { - return config_ == null ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; - } - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int SINGLE_UTTERANCE_FIELD_NUMBER = 2; - private boolean singleUtterance_; - /** - *
-   * If `false` or omitted, the recognizer will perform continuous
-   * recognition (continuing to wait for and process audio even if the user
-   * pauses speaking) until the client closes the input stream (gRPC API) or
-   * until the maximum time limit has been reached. May return multiple
-   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-   * If `true`, the recognizer will detect a single spoken utterance. When it
-   * detects that the user has paused or stopped speaking, it will return an
-   * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-   * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-   * `true`.
-   * The `single_utterance` field can only be used with specified models,
-   * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
-   * must be set to:
-   * * `command_and_search`
-   * * `phone_call` AND additional field `useEnhanced`=`true`
-   * * The `model` field is left undefined. In this case the API auto-selects
-   *   a model based on any other parameters that you set in
-   *   `RecognitionConfig`.
-   * 
- * - * bool single_utterance = 2; - * @return The singleUtterance. - */ - @java.lang.Override - public boolean getSingleUtterance() { - return singleUtterance_; - } - - public static final int INTERIM_RESULTS_FIELD_NUMBER = 3; - private boolean interimResults_; - /** - *
-   * If `true`, interim results (tentative hypotheses) may be
-   * returned as they become available (these interim results are indicated with
-   * the `is_final=false` flag).
-   * If `false` or omitted, only `is_final=true` result(s) are returned.
-   * 
- * - * bool interim_results = 3; - * @return The interimResults. - */ - @java.lang.Override - public boolean getInterimResults() { - return interimResults_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (singleUtterance_ != false) { - output.writeBool(2, singleUtterance_); - } - if (interimResults_ != false) { - output.writeBool(3, interimResults_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getConfig()); - } - if (singleUtterance_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, singleUtterance_); - } - if (interimResults_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, interimResults_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.StreamingRecognitionConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.StreamingRecognitionConfig other = (com.google.cloud.speech.v1.StreamingRecognitionConfig) obj; - - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig() - .equals(other.getConfig())) return false; - } - if (getSingleUtterance() - != other.getSingleUtterance()) return false; - if (getInterimResults() - != other.getInterimResults()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - hash = (37 * hash) + SINGLE_UTTERANCE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSingleUtterance()); - hash = (37 * hash) + INTERIM_RESULTS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getInterimResults()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.StreamingRecognitionConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.StreamingRecognitionConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognitionConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.StreamingRecognitionConfig) - com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognitionConfig.class, com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.StreamingRecognitionConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - singleUtterance_ = false; - - interimResults_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfig build() { - com.google.cloud.speech.v1.StreamingRecognitionConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfig buildPartial() { - com.google.cloud.speech.v1.StreamingRecognitionConfig result = new com.google.cloud.speech.v1.StreamingRecognitionConfig(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - result.singleUtterance_ = singleUtterance_; - result.interimResults_ = interimResults_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.StreamingRecognitionConfig) { - return mergeFrom((com.google.cloud.speech.v1.StreamingRecognitionConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognitionConfig other) { - if (other == com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance()) return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.getSingleUtterance() != false) { - setSingleUtterance(other.getSingleUtterance()); - } - if (other.getInterimResults() != false) { - setInterimResults(other.getInterimResults()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.StreamingRecognitionConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.StreamingRecognitionConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1.RecognitionConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder> configBuilder_; - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - public com.google.cloud.speech.v1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null ? com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setConfig(com.google.cloud.speech.v1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setConfig( - com.google.cloud.speech.v1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeConfig(com.google.cloud.speech.v1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1.RecognitionConfig.newBuilder(config_).mergeFrom(value).buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null ? - com.google.cloud.speech.v1.RecognitionConfig.getDefaultInstance() : config_; - } - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.RecognitionConfig, com.google.cloud.speech.v1.RecognitionConfig.Builder, com.google.cloud.speech.v1.RecognitionConfigOrBuilder>( - getConfig(), - getParentForChildren(), - isClean()); - config_ = null; - } - return configBuilder_; - } - - private boolean singleUtterance_ ; - /** - *
-     * If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-     * `true`.
-     * The `single_utterance` field can only be used with specified models,
-     * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
-     * must be set to:
-     * * `command_and_search`
-     * * `phone_call` AND additional field `useEnhanced`=`true`
-     * * The `model` field is left undefined. In this case the API auto-selects
-     *   a model based on any other parameters that you set in
-     *   `RecognitionConfig`.
-     * 
- * - * bool single_utterance = 2; - * @return The singleUtterance. - */ - @java.lang.Override - public boolean getSingleUtterance() { - return singleUtterance_; - } - /** - *
-     * If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-     * `true`.
-     * The `single_utterance` field can only be used with specified models,
-     * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
-     * must be set to:
-     * * `command_and_search`
-     * * `phone_call` AND additional field `useEnhanced`=`true`
-     * * The `model` field is left undefined. In this case the API auto-selects
-     *   a model based on any other parameters that you set in
-     *   `RecognitionConfig`.
-     * 
- * - * bool single_utterance = 2; - * @param value The singleUtterance to set. - * @return This builder for chaining. - */ - public Builder setSingleUtterance(boolean value) { - - singleUtterance_ = value; - onChanged(); - return this; - } - /** - *
-     * If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-     * `true`.
-     * The `single_utterance` field can only be used with specified models,
-     * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
-     * must be set to:
-     * * `command_and_search`
-     * * `phone_call` AND additional field `useEnhanced`=`true`
-     * * The `model` field is left undefined. In this case the API auto-selects
-     *   a model based on any other parameters that you set in
-     *   `RecognitionConfig`.
-     * 
- * - * bool single_utterance = 2; - * @return This builder for chaining. - */ - public Builder clearSingleUtterance() { - - singleUtterance_ = false; - onChanged(); - return this; - } - - private boolean interimResults_ ; - /** - *
-     * If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - * @return The interimResults. - */ - @java.lang.Override - public boolean getInterimResults() { - return interimResults_; - } - /** - *
-     * If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - * @param value The interimResults to set. - * @return This builder for chaining. - */ - public Builder setInterimResults(boolean value) { - - interimResults_ = value; - onChanged(); - return this; - } - /** - *
-     * If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - * @return This builder for chaining. - */ - public Builder clearInterimResults() { - - interimResults_ = false; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.StreamingRecognitionConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognitionConfig) - private static final com.google.cloud.speech.v1.StreamingRecognitionConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.StreamingRecognitionConfig(); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognitionConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognitionConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfigOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfigOrBuilder.java deleted file mode 100644 index 8c5cfecdc1c5..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionConfigOrBuilder.java +++ /dev/null @@ -1,79 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface StreamingRecognitionConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.StreamingRecognitionConfig) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - com.google.cloud.speech.v1.RecognitionConfig getConfig(); - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - *
-   * If `false` or omitted, the recognizer will perform continuous
-   * recognition (continuing to wait for and process audio even if the user
-   * pauses speaking) until the client closes the input stream (gRPC API) or
-   * until the maximum time limit has been reached. May return multiple
-   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-   * If `true`, the recognizer will detect a single spoken utterance. When it
-   * detects that the user has paused or stopped speaking, it will return an
-   * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-   * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-   * `true`.
-   * The `single_utterance` field can only be used with specified models,
-   * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
-   * must be set to:
-   * * `command_and_search`
-   * * `phone_call` AND additional field `useEnhanced`=`true`
-   * * The `model` field is left undefined. In this case the API auto-selects
-   *   a model based on any other parameters that you set in
-   *   `RecognitionConfig`.
-   * 
- * - * bool single_utterance = 2; - * @return The singleUtterance. - */ - boolean getSingleUtterance(); - - /** - *
-   * If `true`, interim results (tentative hypotheses) may be
-   * returned as they become available (these interim results are indicated with
-   * the `is_final=false` flag).
-   * If `false` or omitted, only `is_final=true` result(s) are returned.
-   * 
- * - * bool interim_results = 3; - * @return The interimResults. - */ - boolean getInterimResults(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResult.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResult.java deleted file mode 100644 index 91bf80323ea6..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResult.java +++ /dev/null @@ -1,1654 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * A streaming speech recognition result corresponding to a portion of the audio
- * that is currently being processed.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognitionResult} - */ -public final class StreamingRecognitionResult extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.StreamingRecognitionResult) - StreamingRecognitionResultOrBuilder { -private static final long serialVersionUID = 0L; - // Use StreamingRecognitionResult.newBuilder() to construct. - private StreamingRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamingRecognitionResult() { - alternatives_ = java.util.Collections.emptyList(); - languageCode_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StreamingRecognitionResult(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamingRecognitionResult( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - alternatives_.add( - input.readMessage(com.google.cloud.speech.v1.SpeechRecognitionAlternative.parser(), extensionRegistry)); - break; - } - case 16: { - - isFinal_ = input.readBool(); - break; - } - case 29: { - - stability_ = input.readFloat(); - break; - } - case 34: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (resultEndTime_ != null) { - subBuilder = resultEndTime_.toBuilder(); - } - resultEndTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(resultEndTime_); - resultEndTime_ = subBuilder.buildPartial(); - } - - break; - } - case 40: { - - channelTag_ = input.readInt32(); - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - languageCode_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognitionResult.class, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder.class); - } - - public static final int ALTERNATIVES_FIELD_NUMBER = 1; - private java.util.List alternatives_; - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public java.util.List getAlternativesList() { - return alternatives_; - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public java.util.List - getAlternativesOrBuilderList() { - return alternatives_; - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public int getAlternativesCount() { - return alternatives_.size(); - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index) { - return alternatives_.get(index); - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index) { - return alternatives_.get(index); - } - - public static final int IS_FINAL_FIELD_NUMBER = 2; - private boolean isFinal_; - /** - *
-   * If `false`, this `StreamingRecognitionResult` represents an
-   * interim result that may change. If `true`, this is the final time the
-   * speech service will return this particular `StreamingRecognitionResult`,
-   * the recognizer will not return any further hypotheses for this portion of
-   * the transcript and corresponding audio.
-   * 
- * - * bool is_final = 2; - * @return The isFinal. - */ - @java.lang.Override - public boolean getIsFinal() { - return isFinal_; - } - - public static final int STABILITY_FIELD_NUMBER = 3; - private float stability_; - /** - *
-   * An estimate of the likelihood that the recognizer will not
-   * change its guess about this interim result. Values range from 0.0
-   * (completely unstable) to 1.0 (completely stable).
-   * This field is only provided for interim results (`is_final=false`).
-   * The default of 0.0 is a sentinel value indicating `stability` was not set.
-   * 
- * - * float stability = 3; - * @return The stability. - */ - @java.lang.Override - public float getStability() { - return stability_; - } - - public static final int RESULT_END_TIME_FIELD_NUMBER = 4; - private com.google.protobuf.Duration resultEndTime_; - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return Whether the resultEndTime field is set. - */ - @java.lang.Override - public boolean hasResultEndTime() { - return resultEndTime_ != null; - } - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return The resultEndTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getResultEndTime() { - return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; - } - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { - return getResultEndTime(); - } - - public static final int CHANNEL_TAG_FIELD_NUMBER = 5; - private int channelTag_; - /** - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 5; - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - - public static final int LANGUAGE_CODE_FIELD_NUMBER = 6; - private volatile java.lang.Object languageCode_; - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The languageCode. - */ - @java.lang.Override - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } - } - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for languageCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < alternatives_.size(); i++) { - output.writeMessage(1, alternatives_.get(i)); - } - if (isFinal_ != false) { - output.writeBool(2, isFinal_); - } - if (java.lang.Float.floatToRawIntBits(stability_) != 0) { - output.writeFloat(3, stability_); - } - if (resultEndTime_ != null) { - output.writeMessage(4, getResultEndTime()); - } - if (channelTag_ != 0) { - output.writeInt32(5, channelTag_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, languageCode_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < alternatives_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, alternatives_.get(i)); - } - if (isFinal_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, isFinal_); - } - if (java.lang.Float.floatToRawIntBits(stability_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(3, stability_); - } - if (resultEndTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getResultEndTime()); - } - if (channelTag_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, channelTag_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, languageCode_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.StreamingRecognitionResult)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.StreamingRecognitionResult other = (com.google.cloud.speech.v1.StreamingRecognitionResult) obj; - - if (!getAlternativesList() - .equals(other.getAlternativesList())) return false; - if (getIsFinal() - != other.getIsFinal()) return false; - if (java.lang.Float.floatToIntBits(getStability()) - != java.lang.Float.floatToIntBits( - other.getStability())) return false; - if (hasResultEndTime() != other.hasResultEndTime()) return false; - if (hasResultEndTime()) { - if (!getResultEndTime() - .equals(other.getResultEndTime())) return false; - } - if (getChannelTag() - != other.getChannelTag()) return false; - if (!getLanguageCode() - .equals(other.getLanguageCode())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAlternativesCount() > 0) { - hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativesList().hashCode(); - } - hash = (37 * hash) + IS_FINAL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsFinal()); - hash = (37 * hash) + STABILITY_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getStability()); - if (hasResultEndTime()) { - hash = (37 * hash) + RESULT_END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getResultEndTime().hashCode(); - } - hash = (37 * hash) + CHANNEL_TAG_FIELD_NUMBER; - hash = (53 * hash) + getChannelTag(); - hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getLanguageCode().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.StreamingRecognitionResult parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.StreamingRecognitionResult prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * A streaming speech recognition result corresponding to a portion of the audio
-   * that is currently being processed.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognitionResult} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.StreamingRecognitionResult) - com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognitionResult.class, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.StreamingRecognitionResult.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getAlternativesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - alternativesBuilder_.clear(); - } - isFinal_ = false; - - stability_ = 0F; - - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = null; - } else { - resultEndTime_ = null; - resultEndTimeBuilder_ = null; - } - channelTag_ = 0; - - languageCode_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognitionResult_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionResult getDefaultInstanceForType() { - return com.google.cloud.speech.v1.StreamingRecognitionResult.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionResult build() { - com.google.cloud.speech.v1.StreamingRecognitionResult result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionResult buildPartial() { - com.google.cloud.speech.v1.StreamingRecognitionResult result = new com.google.cloud.speech.v1.StreamingRecognitionResult(this); - int from_bitField0_ = bitField0_; - if (alternativesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternatives_ = alternatives_; - } else { - result.alternatives_ = alternativesBuilder_.build(); - } - result.isFinal_ = isFinal_; - result.stability_ = stability_; - if (resultEndTimeBuilder_ == null) { - result.resultEndTime_ = resultEndTime_; - } else { - result.resultEndTime_ = resultEndTimeBuilder_.build(); - } - result.channelTag_ = channelTag_; - result.languageCode_ = languageCode_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.StreamingRecognitionResult) { - return mergeFrom((com.google.cloud.speech.v1.StreamingRecognitionResult)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognitionResult other) { - if (other == com.google.cloud.speech.v1.StreamingRecognitionResult.getDefaultInstance()) return this; - if (alternativesBuilder_ == null) { - if (!other.alternatives_.isEmpty()) { - if (alternatives_.isEmpty()) { - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativesIsMutable(); - alternatives_.addAll(other.alternatives_); - } - onChanged(); - } - } else { - if (!other.alternatives_.isEmpty()) { - if (alternativesBuilder_.isEmpty()) { - alternativesBuilder_.dispose(); - alternativesBuilder_ = null; - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - alternativesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAlternativesFieldBuilder() : null; - } else { - alternativesBuilder_.addAllMessages(other.alternatives_); - } - } - } - if (other.getIsFinal() != false) { - setIsFinal(other.getIsFinal()); - } - if (other.getStability() != 0F) { - setStability(other.getStability()); - } - if (other.hasResultEndTime()) { - mergeResultEndTime(other.getResultEndTime()); - } - if (other.getChannelTag() != 0) { - setChannelTag(other.getChannelTag()); - } - if (!other.getLanguageCode().isEmpty()) { - languageCode_ = other.languageCode_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.StreamingRecognitionResult parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.StreamingRecognitionResult) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List alternatives_ = - java.util.Collections.emptyList(); - private void ensureAlternativesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - alternatives_ = new java.util.ArrayList(alternatives_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionAlternative, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> alternativesBuilder_; - - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List getAlternativesList() { - if (alternativesBuilder_ == null) { - return java.util.Collections.unmodifiableList(alternatives_); - } else { - return alternativesBuilder_.getMessageList(); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public int getAlternativesCount() { - if (alternativesBuilder_ == null) { - return alternatives_.size(); - } else { - return alternativesBuilder_.getCount(); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessage(index); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.set(index, value); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.set(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives(com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(value); - onChanged(); - } else { - alternativesBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(index, value); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAllAlternatives( - java.lang.Iterable values) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, alternatives_); - onChanged(); - } else { - alternativesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder clearAlternatives() { - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - alternativesBuilder_.clear(); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder removeAlternatives(int index) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.remove(index); - onChanged(); - } else { - alternativesBuilder_.remove(index); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder getAlternativesBuilder( - int index) { - return getAlternativesFieldBuilder().getBuilder(index); - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); } else { - return alternativesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List - getAlternativesOrBuilderList() { - if (alternativesBuilder_ != null) { - return alternativesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(alternatives_); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder addAlternativesBuilder() { - return getAlternativesFieldBuilder().addBuilder( - com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder addAlternativesBuilder( - int index) { - return getAlternativesFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List - getAlternativesBuilderList() { - return getAlternativesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionAlternative, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesFieldBuilder() { - if (alternativesBuilder_ == null) { - alternativesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.SpeechRecognitionAlternative, com.google.cloud.speech.v1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder>( - alternatives_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - alternatives_ = null; - } - return alternativesBuilder_; - } - - private boolean isFinal_ ; - /** - *
-     * If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - * @return The isFinal. - */ - @java.lang.Override - public boolean getIsFinal() { - return isFinal_; - } - /** - *
-     * If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - * @param value The isFinal to set. - * @return This builder for chaining. - */ - public Builder setIsFinal(boolean value) { - - isFinal_ = value; - onChanged(); - return this; - } - /** - *
-     * If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - * @return This builder for chaining. - */ - public Builder clearIsFinal() { - - isFinal_ = false; - onChanged(); - return this; - } - - private float stability_ ; - /** - *
-     * An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - * @return The stability. - */ - @java.lang.Override - public float getStability() { - return stability_; - } - /** - *
-     * An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - * @param value The stability to set. - * @return This builder for chaining. - */ - public Builder setStability(float value) { - - stability_ = value; - onChanged(); - return this; - } - /** - *
-     * An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - * @return This builder for chaining. - */ - public Builder clearStability() { - - stability_ = 0F; - onChanged(); - return this; - } - - private com.google.protobuf.Duration resultEndTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> resultEndTimeBuilder_; - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return Whether the resultEndTime field is set. - */ - public boolean hasResultEndTime() { - return resultEndTimeBuilder_ != null || resultEndTime_ != null; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return The resultEndTime. - */ - public com.google.protobuf.Duration getResultEndTime() { - if (resultEndTimeBuilder_ == null) { - return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; - } else { - return resultEndTimeBuilder_.getMessage(); - } - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder setResultEndTime(com.google.protobuf.Duration value) { - if (resultEndTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - resultEndTime_ = value; - onChanged(); - } else { - resultEndTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder setResultEndTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = builderForValue.build(); - onChanged(); - } else { - resultEndTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder mergeResultEndTime(com.google.protobuf.Duration value) { - if (resultEndTimeBuilder_ == null) { - if (resultEndTime_ != null) { - resultEndTime_ = - com.google.protobuf.Duration.newBuilder(resultEndTime_).mergeFrom(value).buildPartial(); - } else { - resultEndTime_ = value; - } - onChanged(); - } else { - resultEndTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder clearResultEndTime() { - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = null; - onChanged(); - } else { - resultEndTime_ = null; - resultEndTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public com.google.protobuf.Duration.Builder getResultEndTimeBuilder() { - - onChanged(); - return getResultEndTimeFieldBuilder().getBuilder(); - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { - if (resultEndTimeBuilder_ != null) { - return resultEndTimeBuilder_.getMessageOrBuilder(); - } else { - return resultEndTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; - } - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getResultEndTimeFieldBuilder() { - if (resultEndTimeBuilder_ == null) { - resultEndTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getResultEndTime(), - getParentForChildren(), - isClean()); - resultEndTime_ = null; - } - return resultEndTimeBuilder_; - } - - private int channelTag_ ; - /** - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 5; - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - /** - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 5; - * @param value The channelTag to set. - * @return This builder for chaining. - */ - public Builder setChannelTag(int value) { - - channelTag_ = value; - onChanged(); - return this; - } - /** - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 5; - * @return This builder for chaining. - */ - public Builder clearChannelTag() { - - channelTag_ = 0; - onChanged(); - return this; - } - - private java.lang.Object languageCode_ = ""; - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The languageCode. - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for languageCode. - */ - public com.google.protobuf.ByteString - getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCode( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - languageCode_ = value; - onChanged(); - return this; - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return This builder for chaining. - */ - public Builder clearLanguageCode() { - - languageCode_ = getDefaultInstance().getLanguageCode(); - onChanged(); - return this; - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The bytes for languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCodeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - languageCode_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.StreamingRecognitionResult) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognitionResult) - private static final com.google.cloud.speech.v1.StreamingRecognitionResult DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.StreamingRecognitionResult(); - } - - public static com.google.cloud.speech.v1.StreamingRecognitionResult getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognitionResult parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognitionResult(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionResult getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResultOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResultOrBuilder.java deleted file mode 100644 index c44aa1077a0d..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognitionResultOrBuilder.java +++ /dev/null @@ -1,162 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface StreamingRecognitionResultOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.StreamingRecognitionResult) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - java.util.List - getAlternativesList(); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - com.google.cloud.speech.v1.SpeechRecognitionAlternative getAlternatives(int index); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - int getAlternativesCount(); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - java.util.List - getAlternativesOrBuilderList(); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1.SpeechRecognitionAlternative alternatives = 1; - */ - com.google.cloud.speech.v1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index); - - /** - *
-   * If `false`, this `StreamingRecognitionResult` represents an
-   * interim result that may change. If `true`, this is the final time the
-   * speech service will return this particular `StreamingRecognitionResult`,
-   * the recognizer will not return any further hypotheses for this portion of
-   * the transcript and corresponding audio.
-   * 
- * - * bool is_final = 2; - * @return The isFinal. - */ - boolean getIsFinal(); - - /** - *
-   * An estimate of the likelihood that the recognizer will not
-   * change its guess about this interim result. Values range from 0.0
-   * (completely unstable) to 1.0 (completely stable).
-   * This field is only provided for interim results (`is_final=false`).
-   * The default of 0.0 is a sentinel value indicating `stability` was not set.
-   * 
- * - * float stability = 3; - * @return The stability. - */ - float getStability(); - - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return Whether the resultEndTime field is set. - */ - boolean hasResultEndTime(); - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return The resultEndTime. - */ - com.google.protobuf.Duration getResultEndTime(); - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder(); - - /** - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 5; - * @return The channelTag. - */ - int getChannelTag(); - - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The languageCode. - */ - java.lang.String getLanguageCode(); - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for languageCode. - */ - com.google.protobuf.ByteString - getLanguageCodeBytes(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequest.java deleted file mode 100644 index 0632d9754a23..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequest.java +++ /dev/null @@ -1,955 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * The top-level message sent by the client for the `StreamingRecognize` method.
- * Multiple `StreamingRecognizeRequest` messages are sent. The first message
- * must contain a `streaming_config` message and must not contain
- * `audio_content`. All subsequent messages must contain `audio_content` and
- * must not contain a `streaming_config` message.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognizeRequest} - */ -public final class StreamingRecognizeRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.StreamingRecognizeRequest) - StreamingRecognizeRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use StreamingRecognizeRequest.newBuilder() to construct. - private StreamingRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamingRecognizeRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StreamingRecognizeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamingRecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder subBuilder = null; - if (streamingRequestCase_ == 1) { - subBuilder = ((com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_).toBuilder(); - } - streamingRequest_ = - input.readMessage(com.google.cloud.speech.v1.StreamingRecognitionConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_); - streamingRequest_ = subBuilder.buildPartial(); - } - streamingRequestCase_ = 1; - break; - } - case 18: { - streamingRequest_ = input.readBytes(); - streamingRequestCase_ = 2; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognizeRequest.class, com.google.cloud.speech.v1.StreamingRecognizeRequest.Builder.class); - } - - private int streamingRequestCase_ = 0; - private java.lang.Object streamingRequest_; - public enum StreamingRequestCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - STREAMING_CONFIG(1), - AUDIO_CONTENT(2), - STREAMINGREQUEST_NOT_SET(0); - private final int value; - private StreamingRequestCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static StreamingRequestCase valueOf(int value) { - return forNumber(value); - } - - public static StreamingRequestCase forNumber(int value) { - switch (value) { - case 1: return STREAMING_CONFIG; - case 2: return AUDIO_CONTENT; - case 0: return STREAMINGREQUEST_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public StreamingRequestCase - getStreamingRequestCase() { - return StreamingRequestCase.forNumber( - streamingRequestCase_); - } - - public static final int STREAMING_CONFIG_FIELD_NUMBER = 1; - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - * @return Whether the streamingConfig field is set. - */ - @java.lang.Override - public boolean hasStreamingConfig() { - return streamingRequestCase_ == 1; - } - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - * @return The streamingConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfig getStreamingConfig() { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder() { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } - - public static final int AUDIO_CONTENT_FIELD_NUMBER = 2; - /** - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation (not base64). See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * bytes audio_content = 2; - * @return Whether the audioContent field is set. - */ - @java.lang.Override - public boolean hasAudioContent() { - return streamingRequestCase_ == 2; - } - /** - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation (not base64). See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * bytes audio_content = 2; - * @return The audioContent. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAudioContent() { - if (streamingRequestCase_ == 2) { - return (com.google.protobuf.ByteString) streamingRequest_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (streamingRequestCase_ == 1) { - output.writeMessage(1, (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_); - } - if (streamingRequestCase_ == 2) { - output.writeBytes( - 2, (com.google.protobuf.ByteString) streamingRequest_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (streamingRequestCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_); - } - if (streamingRequestCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize( - 2, (com.google.protobuf.ByteString) streamingRequest_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.StreamingRecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.StreamingRecognizeRequest other = (com.google.cloud.speech.v1.StreamingRecognizeRequest) obj; - - if (!getStreamingRequestCase().equals(other.getStreamingRequestCase())) return false; - switch (streamingRequestCase_) { - case 1: - if (!getStreamingConfig() - .equals(other.getStreamingConfig())) return false; - break; - case 2: - if (!getAudioContent() - .equals(other.getAudioContent())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (streamingRequestCase_) { - case 1: - hash = (37 * hash) + STREAMING_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getStreamingConfig().hashCode(); - break; - case 2: - hash = (37 * hash) + AUDIO_CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getAudioContent().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.StreamingRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.StreamingRecognizeRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * The top-level message sent by the client for the `StreamingRecognize` method.
-   * Multiple `StreamingRecognizeRequest` messages are sent. The first message
-   * must contain a `streaming_config` message and must not contain
-   * `audio_content`. All subsequent messages must contain `audio_content` and
-   * must not contain a `streaming_config` message.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognizeRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.StreamingRecognizeRequest) - com.google.cloud.speech.v1.StreamingRecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognizeRequest.class, com.google.cloud.speech.v1.StreamingRecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.StreamingRecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - streamingRequestCase_ = 0; - streamingRequest_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.StreamingRecognizeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeRequest build() { - com.google.cloud.speech.v1.StreamingRecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeRequest buildPartial() { - com.google.cloud.speech.v1.StreamingRecognizeRequest result = new com.google.cloud.speech.v1.StreamingRecognizeRequest(this); - if (streamingRequestCase_ == 1) { - if (streamingConfigBuilder_ == null) { - result.streamingRequest_ = streamingRequest_; - } else { - result.streamingRequest_ = streamingConfigBuilder_.build(); - } - } - if (streamingRequestCase_ == 2) { - result.streamingRequest_ = streamingRequest_; - } - result.streamingRequestCase_ = streamingRequestCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.StreamingRecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1.StreamingRecognizeRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognizeRequest other) { - if (other == com.google.cloud.speech.v1.StreamingRecognizeRequest.getDefaultInstance()) return this; - switch (other.getStreamingRequestCase()) { - case STREAMING_CONFIG: { - mergeStreamingConfig(other.getStreamingConfig()); - break; - } - case AUDIO_CONTENT: { - setAudioContent(other.getAudioContent()); - break; - } - case STREAMINGREQUEST_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.StreamingRecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.StreamingRecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int streamingRequestCase_ = 0; - private java.lang.Object streamingRequest_; - public StreamingRequestCase - getStreamingRequestCase() { - return StreamingRequestCase.forNumber( - streamingRequestCase_); - } - - public Builder clearStreamingRequest() { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - return this; - } - - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.StreamingRecognitionConfig, com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder, com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder> streamingConfigBuilder_; - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - * @return Whether the streamingConfig field is set. - */ - @java.lang.Override - public boolean hasStreamingConfig() { - return streamingRequestCase_ == 1; - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - * @return The streamingConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfig getStreamingConfig() { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } else { - if (streamingRequestCase_ == 1) { - return streamingConfigBuilder_.getMessage(); - } - return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder setStreamingConfig(com.google.cloud.speech.v1.StreamingRecognitionConfig value) { - if (streamingConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - streamingRequest_ = value; - onChanged(); - } else { - streamingConfigBuilder_.setMessage(value); - } - streamingRequestCase_ = 1; - return this; - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder setStreamingConfig( - com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder builderForValue) { - if (streamingConfigBuilder_ == null) { - streamingRequest_ = builderForValue.build(); - onChanged(); - } else { - streamingConfigBuilder_.setMessage(builderForValue.build()); - } - streamingRequestCase_ = 1; - return this; - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder mergeStreamingConfig(com.google.cloud.speech.v1.StreamingRecognitionConfig value) { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1 && - streamingRequest_ != com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance()) { - streamingRequest_ = com.google.cloud.speech.v1.StreamingRecognitionConfig.newBuilder((com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_) - .mergeFrom(value).buildPartial(); - } else { - streamingRequest_ = value; - } - onChanged(); - } else { - if (streamingRequestCase_ == 1) { - streamingConfigBuilder_.mergeFrom(value); - } else { - streamingConfigBuilder_.setMessage(value); - } - } - streamingRequestCase_ = 1; - return this; - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder clearStreamingConfig() { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - } - } else { - if (streamingRequestCase_ == 1) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - } - streamingConfigBuilder_.clear(); - } - return this; - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - public com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder getStreamingConfigBuilder() { - return getStreamingConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder() { - if ((streamingRequestCase_ == 1) && (streamingConfigBuilder_ != null)) { - return streamingConfigBuilder_.getMessageOrBuilder(); - } else { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.StreamingRecognitionConfig, com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder, com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder> - getStreamingConfigFieldBuilder() { - if (streamingConfigBuilder_ == null) { - if (!(streamingRequestCase_ == 1)) { - streamingRequest_ = com.google.cloud.speech.v1.StreamingRecognitionConfig.getDefaultInstance(); - } - streamingConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.StreamingRecognitionConfig, com.google.cloud.speech.v1.StreamingRecognitionConfig.Builder, com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder>( - (com.google.cloud.speech.v1.StreamingRecognitionConfig) streamingRequest_, - getParentForChildren(), - isClean()); - streamingRequest_ = null; - } - streamingRequestCase_ = 1; - onChanged();; - return streamingConfigBuilder_; - } - - /** - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * @return Whether the audioContent field is set. - */ - public boolean hasAudioContent() { - return streamingRequestCase_ == 2; - } - /** - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * @return The audioContent. - */ - public com.google.protobuf.ByteString getAudioContent() { - if (streamingRequestCase_ == 2) { - return (com.google.protobuf.ByteString) streamingRequest_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * @param value The audioContent to set. - * @return This builder for chaining. - */ - public Builder setAudioContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - streamingRequestCase_ = 2; - streamingRequest_ = value; - onChanged(); - return this; - } - /** - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * @return This builder for chaining. - */ - public Builder clearAudioContent() { - if (streamingRequestCase_ == 2) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - } - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.StreamingRecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognizeRequest) - private static final com.google.cloud.speech.v1.StreamingRecognizeRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.StreamingRecognizeRequest(); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognizeRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequestOrBuilder.java deleted file mode 100644 index 28ed92b158ab..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeRequestOrBuilder.java +++ /dev/null @@ -1,77 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface StreamingRecognizeRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.StreamingRecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - * @return Whether the streamingConfig field is set. - */ - boolean hasStreamingConfig(); - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - * @return The streamingConfig. - */ - com.google.cloud.speech.v1.StreamingRecognitionConfig getStreamingConfig(); - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognitionConfig streaming_config = 1; - */ - com.google.cloud.speech.v1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder(); - - /** - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation (not base64). See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * bytes audio_content = 2; - * @return Whether the audioContent field is set. - */ - boolean hasAudioContent(); - /** - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation (not base64). See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * bytes audio_content = 2; - * @return The audioContent. - */ - com.google.protobuf.ByteString getAudioContent(); - - public com.google.cloud.speech.v1.StreamingRecognizeRequest.StreamingRequestCase getStreamingRequestCase(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponse.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponse.java deleted file mode 100644 index a4e49a1325ef..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponse.java +++ /dev/null @@ -1,1771 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * `StreamingRecognizeResponse` is the only message returned to the client by
- * `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
- * messages are streamed back to the client. If there is no recognizable
- * audio, and `single_utterance` is set to false, then no messages are streamed
- * back to the client.
- * Here's an example of a series of `StreamingRecognizeResponse`s that might be
- * returned while processing audio:
- * 1. results { alternatives { transcript: "tube" } stability: 0.01 }
- * 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
- * 3. results { alternatives { transcript: "to be" } stability: 0.9 }
- *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
- * 4. results { alternatives { transcript: "to be or not to be"
- *                             confidence: 0.92 }
- *              alternatives { transcript: "to bee or not to bee" }
- *              is_final: true }
- * 5. results { alternatives { transcript: " that's" } stability: 0.01 }
- * 6. results { alternatives { transcript: " that is" } stability: 0.9 }
- *    results { alternatives { transcript: " the question" } stability: 0.01 }
- * 7. results { alternatives { transcript: " that is the question"
- *                             confidence: 0.98 }
- *              alternatives { transcript: " that was the question" }
- *              is_final: true }
- * Notes:
- * - Only two of the above responses #4 and #7 contain final results; they are
- *   indicated by `is_final: true`. Concatenating these together generates the
- *   full transcript: "to be or not to be that is the question".
- * - The others contain interim `results`. #3 and #6 contain two interim
- *   `results`: the first portion has a high stability and is less likely to
- *   change; the second portion has a low stability and is very likely to
- *   change. A UI designer might choose to show only high stability `results`.
- * - The specific `stability` and `confidence` values shown above are only for
- *   illustrative purposes. Actual values may vary.
- * - In each response, only one of these fields will be set:
- *     `error`,
- *     `speech_event_type`, or
- *     one or more (repeated) `results`.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognizeResponse} - */ -public final class StreamingRecognizeResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.StreamingRecognizeResponse) - StreamingRecognizeResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use StreamingRecognizeResponse.newBuilder() to construct. - private StreamingRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamingRecognizeResponse() { - results_ = java.util.Collections.emptyList(); - speechEventType_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StreamingRecognizeResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamingRecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.rpc.Status.Builder subBuilder = null; - if (error_ != null) { - subBuilder = error_.toBuilder(); - } - error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(error_); - error_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage(com.google.cloud.speech.v1.StreamingRecognitionResult.parser(), extensionRegistry)); - break; - } - case 32: { - int rawValue = input.readEnum(); - - speechEventType_ = rawValue; - break; - } - case 42: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (totalBilledTime_ != null) { - subBuilder = totalBilledTime_.toBuilder(); - } - totalBilledTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(totalBilledTime_); - totalBilledTime_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognizeResponse.class, com.google.cloud.speech.v1.StreamingRecognizeResponse.Builder.class); - } - - /** - *
-   * Indicates the type of speech event.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType} - */ - public enum SpeechEventType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * No speech event specified.
-     * 
- * - * SPEECH_EVENT_UNSPECIFIED = 0; - */ - SPEECH_EVENT_UNSPECIFIED(0), - /** - *
-     * This event indicates that the server has detected the end of the user's
-     * speech utterance and expects no additional speech. Therefore, the server
-     * will not process additional audio (although it may subsequently return
-     * additional results). The client should stop sending additional audio
-     * data, half-close the gRPC connection, and wait for any additional results
-     * until the server closes the gRPC connection. This event is only sent if
-     * `single_utterance` was set to `true`, and is not used otherwise.
-     * 
- * - * END_OF_SINGLE_UTTERANCE = 1; - */ - END_OF_SINGLE_UTTERANCE(1), - UNRECOGNIZED(-1), - ; - - /** - *
-     * No speech event specified.
-     * 
- * - * SPEECH_EVENT_UNSPECIFIED = 0; - */ - public static final int SPEECH_EVENT_UNSPECIFIED_VALUE = 0; - /** - *
-     * This event indicates that the server has detected the end of the user's
-     * speech utterance and expects no additional speech. Therefore, the server
-     * will not process additional audio (although it may subsequently return
-     * additional results). The client should stop sending additional audio
-     * data, half-close the gRPC connection, and wait for any additional results
-     * until the server closes the gRPC connection. This event is only sent if
-     * `single_utterance` was set to `true`, and is not used otherwise.
-     * 
- * - * END_OF_SINGLE_UTTERANCE = 1; - */ - public static final int END_OF_SINGLE_UTTERANCE_VALUE = 1; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static SpeechEventType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static SpeechEventType forNumber(int value) { - switch (value) { - case 0: return SPEECH_EVENT_UNSPECIFIED; - case 1: return END_OF_SINGLE_UTTERANCE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - SpeechEventType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public SpeechEventType findValueByNumber(int number) { - return SpeechEventType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.cloud.speech.v1.StreamingRecognizeResponse.getDescriptor().getEnumTypes().get(0); - } - - private static final SpeechEventType[] VALUES = values(); - - public static SpeechEventType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private SpeechEventType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType) - } - - public static final int ERROR_FIELD_NUMBER = 1; - private com.google.rpc.Status error_; - /** - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * @return Whether the error field is set. - */ - @java.lang.Override - public boolean hasError() { - return error_ != null; - } - /** - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * @return The error. - */ - @java.lang.Override - public com.google.rpc.Status getError() { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } - /** - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - return getError(); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List getResultsList() { - return results_; - } - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List - getResultsOrBuilderList() { - return results_; - } - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public int getResultsCount() { - return results_.size(); - } - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - public static final int SPEECH_EVENT_TYPE_FIELD_NUMBER = 4; - private int speechEventType_; - /** - *
-   * Indicates the type of speech event.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return The enum numeric value on the wire for speechEventType. - */ - @java.lang.Override public int getSpeechEventTypeValue() { - return speechEventType_; - } - /** - *
-   * Indicates the type of speech event.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return The speechEventType. - */ - @java.lang.Override public com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType result = com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.valueOf(speechEventType_); - return result == null ? com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.UNRECOGNIZED : result; - } - - public static final int TOTAL_BILLED_TIME_FIELD_NUMBER = 5; - private com.google.protobuf.Duration totalBilledTime_; - /** - *
-   * When available, billed audio seconds for the stream.
-   * Set only if this is the last response in the stream.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 5; - * @return Whether the totalBilledTime field is set. - */ - @java.lang.Override - public boolean hasTotalBilledTime() { - return totalBilledTime_ != null; - } - /** - *
-   * When available, billed audio seconds for the stream.
-   * Set only if this is the last response in the stream.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 5; - * @return The totalBilledTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getTotalBilledTime() { - return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } - /** - *
-   * When available, billed audio seconds for the stream.
-   * Set only if this is the last response in the stream.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { - return getTotalBilledTime(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (error_ != null) { - output.writeMessage(1, getError()); - } - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - if (speechEventType_ != com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.SPEECH_EVENT_UNSPECIFIED.getNumber()) { - output.writeEnum(4, speechEventType_); - } - if (totalBilledTime_ != null) { - output.writeMessage(5, getTotalBilledTime()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (error_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getError()); - } - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, results_.get(i)); - } - if (speechEventType_ != com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.SPEECH_EVENT_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, speechEventType_); - } - if (totalBilledTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getTotalBilledTime()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.StreamingRecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.StreamingRecognizeResponse other = (com.google.cloud.speech.v1.StreamingRecognizeResponse) obj; - - if (hasError() != other.hasError()) return false; - if (hasError()) { - if (!getError() - .equals(other.getError())) return false; - } - if (!getResultsList() - .equals(other.getResultsList())) return false; - if (speechEventType_ != other.speechEventType_) return false; - if (hasTotalBilledTime() != other.hasTotalBilledTime()) return false; - if (hasTotalBilledTime()) { - if (!getTotalBilledTime() - .equals(other.getTotalBilledTime())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasError()) { - hash = (37 * hash) + ERROR_FIELD_NUMBER; - hash = (53 * hash) + getError().hashCode(); - } - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - hash = (37 * hash) + SPEECH_EVENT_TYPE_FIELD_NUMBER; - hash = (53 * hash) + speechEventType_; - if (hasTotalBilledTime()) { - hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; - hash = (53 * hash) + getTotalBilledTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.StreamingRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.StreamingRecognizeResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * `StreamingRecognizeResponse` is the only message returned to the client by
-   * `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
-   * messages are streamed back to the client. If there is no recognizable
-   * audio, and `single_utterance` is set to false, then no messages are streamed
-   * back to the client.
-   * Here's an example of a series of `StreamingRecognizeResponse`s that might be
-   * returned while processing audio:
-   * 1. results { alternatives { transcript: "tube" } stability: 0.01 }
-   * 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
-   * 3. results { alternatives { transcript: "to be" } stability: 0.9 }
-   *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
-   * 4. results { alternatives { transcript: "to be or not to be"
-   *                             confidence: 0.92 }
-   *              alternatives { transcript: "to bee or not to bee" }
-   *              is_final: true }
-   * 5. results { alternatives { transcript: " that's" } stability: 0.01 }
-   * 6. results { alternatives { transcript: " that is" } stability: 0.9 }
-   *    results { alternatives { transcript: " the question" } stability: 0.01 }
-   * 7. results { alternatives { transcript: " that is the question"
-   *                             confidence: 0.98 }
-   *              alternatives { transcript: " that was the question" }
-   *              is_final: true }
-   * Notes:
-   * - Only two of the above responses #4 and #7 contain final results; they are
-   *   indicated by `is_final: true`. Concatenating these together generates the
-   *   full transcript: "to be or not to be that is the question".
-   * - The others contain interim `results`. #3 and #6 contain two interim
-   *   `results`: the first portion has a high stability and is less likely to
-   *   change; the second portion has a low stability and is very likely to
-   *   change. A UI designer might choose to show only high stability `results`.
-   * - The specific `stability` and `confidence` values shown above are only for
-   *   illustrative purposes. Actual values may vary.
-   * - In each response, only one of these fields will be set:
-   *     `error`,
-   *     `speech_event_type`, or
-   *     one or more (repeated) `results`.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.StreamingRecognizeResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.StreamingRecognizeResponse) - com.google.cloud.speech.v1.StreamingRecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.StreamingRecognizeResponse.class, com.google.cloud.speech.v1.StreamingRecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.StreamingRecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (errorBuilder_ == null) { - error_ = null; - } else { - error_ = null; - errorBuilder_ = null; - } - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - speechEventType_ = 0; - - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = null; - } else { - totalBilledTime_ = null; - totalBilledTimeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_StreamingRecognizeResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1.StreamingRecognizeResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeResponse build() { - com.google.cloud.speech.v1.StreamingRecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeResponse buildPartial() { - com.google.cloud.speech.v1.StreamingRecognizeResponse result = new com.google.cloud.speech.v1.StreamingRecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (errorBuilder_ == null) { - result.error_ = error_; - } else { - result.error_ = errorBuilder_.build(); - } - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - result.speechEventType_ = speechEventType_; - if (totalBilledTimeBuilder_ == null) { - result.totalBilledTime_ = totalBilledTime_; - } else { - result.totalBilledTime_ = totalBilledTimeBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.StreamingRecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1.StreamingRecognizeResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.StreamingRecognizeResponse other) { - if (other == com.google.cloud.speech.v1.StreamingRecognizeResponse.getDefaultInstance()) return this; - if (other.hasError()) { - mergeError(other.getError()); - } - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResultsFieldBuilder() : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - if (other.speechEventType_ != 0) { - setSpeechEventTypeValue(other.getSpeechEventTypeValue()); - } - if (other.hasTotalBilledTime()) { - mergeTotalBilledTime(other.getTotalBilledTime()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.StreamingRecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.StreamingRecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.rpc.Status error_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - * @return Whether the error field is set. - */ - public boolean hasError() { - return errorBuilder_ != null || error_ != null; - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - * @return The error. - */ - public com.google.rpc.Status getError() { - if (errorBuilder_ == null) { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } else { - return errorBuilder_.getMessage(); - } - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder setError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - error_ = value; - onChanged(); - } else { - errorBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder setError( - com.google.rpc.Status.Builder builderForValue) { - if (errorBuilder_ == null) { - error_ = builderForValue.build(); - onChanged(); - } else { - errorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder mergeError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (error_ != null) { - error_ = - com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); - } else { - error_ = value; - } - onChanged(); - } else { - errorBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder clearError() { - if (errorBuilder_ == null) { - error_ = null; - onChanged(); - } else { - error_ = null; - errorBuilder_ = null; - } - - return this; - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.Status.Builder getErrorBuilder() { - - onChanged(); - return getErrorFieldBuilder().getBuilder(); - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - if (errorBuilder_ != null) { - return errorBuilder_.getMessageOrBuilder(); - } else { - return error_ == null ? - com.google.rpc.Status.getDefaultInstance() : error_; - } - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getErrorFieldBuilder() { - if (errorBuilder_ == null) { - errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( - getError(), - getParentForChildren(), - isClean()); - error_ = null; - } - return errorBuilder_; - } - - private java.util.List results_ = - java.util.Collections.emptyList(); - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = new java.util.ArrayList(results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.StreamingRecognitionResult, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder, com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder> resultsBuilder_; - - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public java.util.List getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.StreamingRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.StreamingRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public java.util.List - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.StreamingRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder().addBuilder( - com.google.cloud.speech.v1.StreamingRecognitionResult.getDefaultInstance()); - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1.StreamingRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1.StreamingRecognitionResult.getDefaultInstance()); - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.StreamingRecognitionResult, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder, com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1.StreamingRecognitionResult, com.google.cloud.speech.v1.StreamingRecognitionResult.Builder, com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder>( - results_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - results_ = null; - } - return resultsBuilder_; - } - - private int speechEventType_ = 0; - /** - *
-     * Indicates the type of speech event.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return The enum numeric value on the wire for speechEventType. - */ - @java.lang.Override public int getSpeechEventTypeValue() { - return speechEventType_; - } - /** - *
-     * Indicates the type of speech event.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @param value The enum numeric value on the wire for speechEventType to set. - * @return This builder for chaining. - */ - public Builder setSpeechEventTypeValue(int value) { - - speechEventType_ = value; - onChanged(); - return this; - } - /** - *
-     * Indicates the type of speech event.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return The speechEventType. - */ - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType result = com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.valueOf(speechEventType_); - return result == null ? com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType.UNRECOGNIZED : result; - } - /** - *
-     * Indicates the type of speech event.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @param value The speechEventType to set. - * @return This builder for chaining. - */ - public Builder setSpeechEventType(com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType value) { - if (value == null) { - throw new NullPointerException(); - } - - speechEventType_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-     * Indicates the type of speech event.
-     * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return This builder for chaining. - */ - public Builder clearSpeechEventType() { - - speechEventType_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Duration totalBilledTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalBilledTimeBuilder_; - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - * @return Whether the totalBilledTime field is set. - */ - public boolean hasTotalBilledTime() { - return totalBilledTimeBuilder_ != null || totalBilledTime_ != null; - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - * @return The totalBilledTime. - */ - public com.google.protobuf.Duration getTotalBilledTime() { - if (totalBilledTimeBuilder_ == null) { - return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } else { - return totalBilledTimeBuilder_.getMessage(); - } - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - public Builder setTotalBilledTime(com.google.protobuf.Duration value) { - if (totalBilledTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - totalBilledTime_ = value; - onChanged(); - } else { - totalBilledTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - public Builder setTotalBilledTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = builderForValue.build(); - onChanged(); - } else { - totalBilledTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - public Builder mergeTotalBilledTime(com.google.protobuf.Duration value) { - if (totalBilledTimeBuilder_ == null) { - if (totalBilledTime_ != null) { - totalBilledTime_ = - com.google.protobuf.Duration.newBuilder(totalBilledTime_).mergeFrom(value).buildPartial(); - } else { - totalBilledTime_ = value; - } - onChanged(); - } else { - totalBilledTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - public Builder clearTotalBilledTime() { - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = null; - onChanged(); - } else { - totalBilledTime_ = null; - totalBilledTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - public com.google.protobuf.Duration.Builder getTotalBilledTimeBuilder() { - - onChanged(); - return getTotalBilledTimeFieldBuilder().getBuilder(); - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { - if (totalBilledTimeBuilder_ != null) { - return totalBilledTimeBuilder_.getMessageOrBuilder(); - } else { - return totalBilledTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getTotalBilledTimeFieldBuilder() { - if (totalBilledTimeBuilder_ == null) { - totalBilledTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getTotalBilledTime(), - getParentForChildren(), - isClean()); - totalBilledTime_ = null; - } - return totalBilledTimeBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.StreamingRecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognizeResponse) - private static final com.google.cloud.speech.v1.StreamingRecognizeResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.StreamingRecognizeResponse(); - } - - public static com.google.cloud.speech.v1.StreamingRecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognizeResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.StreamingRecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java deleted file mode 100644 index 1a3c3b062d4b..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/StreamingRecognizeResponseOrBuilder.java +++ /dev/null @@ -1,147 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface StreamingRecognizeResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.StreamingRecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * @return Whether the error field is set. - */ - boolean hasError(); - /** - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * @return The error. - */ - com.google.rpc.Status getError(); - /** - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - com.google.rpc.StatusOrBuilder getErrorOrBuilder(); - - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - java.util.List - getResultsList(); - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - com.google.cloud.speech.v1.StreamingRecognitionResult getResults(int index); - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - int getResultsCount(); - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1.StreamingRecognitionResult results = 2; - */ - com.google.cloud.speech.v1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index); - - /** - *
-   * Indicates the type of speech event.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return The enum numeric value on the wire for speechEventType. - */ - int getSpeechEventTypeValue(); - /** - *
-   * Indicates the type of speech event.
-   * 
- * - * .google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return The speechEventType. - */ - com.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType(); - - /** - *
-   * When available, billed audio seconds for the stream.
-   * Set only if this is the last response in the stream.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 5; - * @return Whether the totalBilledTime field is set. - */ - boolean hasTotalBilledTime(); - /** - *
-   * When available, billed audio seconds for the stream.
-   * Set only if this is the last response in the stream.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 5; - * @return The totalBilledTime. - */ - com.google.protobuf.Duration getTotalBilledTime(); - /** - *
-   * When available, billed audio seconds for the stream.
-   * Set only if this is the last response in the stream.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfig.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfig.java deleted file mode 100644 index aa9696e23886..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfig.java +++ /dev/null @@ -1,732 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Specifies an optional destination for the recognition results.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.TranscriptOutputConfig} - */ -public final class TranscriptOutputConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.TranscriptOutputConfig) - TranscriptOutputConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use TranscriptOutputConfig.newBuilder() to construct. - private TranscriptOutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TranscriptOutputConfig() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TranscriptOutputConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TranscriptOutputConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - outputTypeCase_ = 1; - outputType_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_TranscriptOutputConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_TranscriptOutputConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.TranscriptOutputConfig.class, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder.class); - } - - private int outputTypeCase_ = 0; - private java.lang.Object outputType_; - public enum OutputTypeCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - GCS_URI(1), - OUTPUTTYPE_NOT_SET(0); - private final int value; - private OutputTypeCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OutputTypeCase valueOf(int value) { - return forNumber(value); - } - - public static OutputTypeCase forNumber(int value) { - switch (value) { - case 1: return GCS_URI; - case 0: return OUTPUTTYPE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OutputTypeCase - getOutputTypeCase() { - return OutputTypeCase.forNumber( - outputTypeCase_); - } - - public static final int GCS_URI_FIELD_NUMBER = 1; - /** - *
-   * Specifies a Cloud Storage URI for the recognition results. Must be
-   * specified in the format: `gs://bucket_name/object_name`, and the bucket
-   * must already exist.
-   * 
- * - * string gcs_uri = 1; - * @return Whether the gcsUri field is set. - */ - public boolean hasGcsUri() { - return outputTypeCase_ == 1; - } - /** - *
-   * Specifies a Cloud Storage URI for the recognition results. Must be
-   * specified in the format: `gs://bucket_name/object_name`, and the bucket
-   * must already exist.
-   * 
- * - * string gcs_uri = 1; - * @return The gcsUri. - */ - public java.lang.String getGcsUri() { - java.lang.Object ref = ""; - if (outputTypeCase_ == 1) { - ref = outputType_; - } - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (outputTypeCase_ == 1) { - outputType_ = s; - } - return s; - } - } - /** - *
-   * Specifies a Cloud Storage URI for the recognition results. Must be
-   * specified in the format: `gs://bucket_name/object_name`, and the bucket
-   * must already exist.
-   * 
- * - * string gcs_uri = 1; - * @return The bytes for gcsUri. - */ - public com.google.protobuf.ByteString - getGcsUriBytes() { - java.lang.Object ref = ""; - if (outputTypeCase_ == 1) { - ref = outputType_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (outputTypeCase_ == 1) { - outputType_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (outputTypeCase_ == 1) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputType_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (outputTypeCase_ == 1) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputType_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.TranscriptOutputConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.TranscriptOutputConfig other = (com.google.cloud.speech.v1.TranscriptOutputConfig) obj; - - if (!getOutputTypeCase().equals(other.getOutputTypeCase())) return false; - switch (outputTypeCase_) { - case 1: - if (!getGcsUri() - .equals(other.getGcsUri())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (outputTypeCase_) { - case 1: - hash = (37 * hash) + GCS_URI_FIELD_NUMBER; - hash = (53 * hash) + getGcsUri().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.TranscriptOutputConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.TranscriptOutputConfig parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.TranscriptOutputConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.TranscriptOutputConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Specifies an optional destination for the recognition results.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.TranscriptOutputConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.TranscriptOutputConfig) - com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_TranscriptOutputConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_TranscriptOutputConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.TranscriptOutputConfig.class, com.google.cloud.speech.v1.TranscriptOutputConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.TranscriptOutputConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - outputTypeCase_ = 0; - outputType_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_TranscriptOutputConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.TranscriptOutputConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.TranscriptOutputConfig build() { - com.google.cloud.speech.v1.TranscriptOutputConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.TranscriptOutputConfig buildPartial() { - com.google.cloud.speech.v1.TranscriptOutputConfig result = new com.google.cloud.speech.v1.TranscriptOutputConfig(this); - if (outputTypeCase_ == 1) { - result.outputType_ = outputType_; - } - result.outputTypeCase_ = outputTypeCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.TranscriptOutputConfig) { - return mergeFrom((com.google.cloud.speech.v1.TranscriptOutputConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.TranscriptOutputConfig other) { - if (other == com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance()) return this; - switch (other.getOutputTypeCase()) { - case GCS_URI: { - outputTypeCase_ = 1; - outputType_ = other.outputType_; - onChanged(); - break; - } - case OUTPUTTYPE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.TranscriptOutputConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.TranscriptOutputConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int outputTypeCase_ = 0; - private java.lang.Object outputType_; - public OutputTypeCase - getOutputTypeCase() { - return OutputTypeCase.forNumber( - outputTypeCase_); - } - - public Builder clearOutputType() { - outputTypeCase_ = 0; - outputType_ = null; - onChanged(); - return this; - } - - - /** - *
-     * Specifies a Cloud Storage URI for the recognition results. Must be
-     * specified in the format: `gs://bucket_name/object_name`, and the bucket
-     * must already exist.
-     * 
- * - * string gcs_uri = 1; - * @return Whether the gcsUri field is set. - */ - @java.lang.Override - public boolean hasGcsUri() { - return outputTypeCase_ == 1; - } - /** - *
-     * Specifies a Cloud Storage URI for the recognition results. Must be
-     * specified in the format: `gs://bucket_name/object_name`, and the bucket
-     * must already exist.
-     * 
- * - * string gcs_uri = 1; - * @return The gcsUri. - */ - @java.lang.Override - public java.lang.String getGcsUri() { - java.lang.Object ref = ""; - if (outputTypeCase_ == 1) { - ref = outputType_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (outputTypeCase_ == 1) { - outputType_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Specifies a Cloud Storage URI for the recognition results. Must be
-     * specified in the format: `gs://bucket_name/object_name`, and the bucket
-     * must already exist.
-     * 
- * - * string gcs_uri = 1; - * @return The bytes for gcsUri. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getGcsUriBytes() { - java.lang.Object ref = ""; - if (outputTypeCase_ == 1) { - ref = outputType_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (outputTypeCase_ == 1) { - outputType_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Specifies a Cloud Storage URI for the recognition results. Must be
-     * specified in the format: `gs://bucket_name/object_name`, and the bucket
-     * must already exist.
-     * 
- * - * string gcs_uri = 1; - * @param value The gcsUri to set. - * @return This builder for chaining. - */ - public Builder setGcsUri( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - outputTypeCase_ = 1; - outputType_ = value; - onChanged(); - return this; - } - /** - *
-     * Specifies a Cloud Storage URI for the recognition results. Must be
-     * specified in the format: `gs://bucket_name/object_name`, and the bucket
-     * must already exist.
-     * 
- * - * string gcs_uri = 1; - * @return This builder for chaining. - */ - public Builder clearGcsUri() { - if (outputTypeCase_ == 1) { - outputTypeCase_ = 0; - outputType_ = null; - onChanged(); - } - return this; - } - /** - *
-     * Specifies a Cloud Storage URI for the recognition results. Must be
-     * specified in the format: `gs://bucket_name/object_name`, and the bucket
-     * must already exist.
-     * 
- * - * string gcs_uri = 1; - * @param value The bytes for gcsUri to set. - * @return This builder for chaining. - */ - public Builder setGcsUriBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - outputTypeCase_ = 1; - outputType_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.TranscriptOutputConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.TranscriptOutputConfig) - private static final com.google.cloud.speech.v1.TranscriptOutputConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.TranscriptOutputConfig(); - } - - public static com.google.cloud.speech.v1.TranscriptOutputConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TranscriptOutputConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TranscriptOutputConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.TranscriptOutputConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfigOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfigOrBuilder.java deleted file mode 100644 index 5ce9fd8335aa..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/TranscriptOutputConfigOrBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface TranscriptOutputConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.TranscriptOutputConfig) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Specifies a Cloud Storage URI for the recognition results. Must be
-   * specified in the format: `gs://bucket_name/object_name`, and the bucket
-   * must already exist.
-   * 
- * - * string gcs_uri = 1; - * @return Whether the gcsUri field is set. - */ - boolean hasGcsUri(); - /** - *
-   * Specifies a Cloud Storage URI for the recognition results. Must be
-   * specified in the format: `gs://bucket_name/object_name`, and the bucket
-   * must already exist.
-   * 
- * - * string gcs_uri = 1; - * @return The gcsUri. - */ - java.lang.String getGcsUri(); - /** - *
-   * Specifies a Cloud Storage URI for the recognition results. Must be
-   * specified in the format: `gs://bucket_name/object_name`, and the bucket
-   * must already exist.
-   * 
- * - * string gcs_uri = 1; - * @return The bytes for gcsUri. - */ - com.google.protobuf.ByteString - getGcsUriBytes(); - - public com.google.cloud.speech.v1.TranscriptOutputConfig.OutputTypeCase getOutputTypeCase(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequest.java deleted file mode 100644 index f77de019bb0e..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequest.java +++ /dev/null @@ -1,997 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Message sent by the client for the `UpdateCustomClass` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.UpdateCustomClassRequest} - */ -public final class UpdateCustomClassRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.UpdateCustomClassRequest) - UpdateCustomClassRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use UpdateCustomClassRequest.newBuilder() to construct. - private UpdateCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private UpdateCustomClassRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new UpdateCustomClassRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private UpdateCustomClassRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.cloud.speech.v1.CustomClass.Builder subBuilder = null; - if (customClass_ != null) { - subBuilder = customClass_.toBuilder(); - } - customClass_ = input.readMessage(com.google.cloud.speech.v1.CustomClass.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(customClass_); - customClass_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.UpdateCustomClassRequest.class, com.google.cloud.speech.v1.UpdateCustomClassRequest.Builder.class); - } - - public static final int CUSTOM_CLASS_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1.CustomClass customClass_; - /** - *
-   * Required. The custom class to update.
-   * The custom class's `name` field is used to identify the custom class to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the customClass field is set. - */ - @java.lang.Override - public boolean hasCustomClass() { - return customClass_ != null; - } - /** - *
-   * Required. The custom class to update.
-   * The custom class's `name` field is used to identify the custom class to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClass. - */ - @java.lang.Override - public com.google.cloud.speech.v1.CustomClass getCustomClass() { - return customClass_ == null ? com.google.cloud.speech.v1.CustomClass.getDefaultInstance() : customClass_; - } - /** - *
-   * Required. The custom class to update.
-   * The custom class's `name` field is used to identify the custom class to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassOrBuilder() { - return getCustomClass(); - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 2; - private com.google.protobuf.FieldMask updateMask_; - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (customClass_ != null) { - output.writeMessage(1, getCustomClass()); - } - if (updateMask_ != null) { - output.writeMessage(2, getUpdateMask()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (customClass_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getCustomClass()); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getUpdateMask()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.UpdateCustomClassRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.UpdateCustomClassRequest other = (com.google.cloud.speech.v1.UpdateCustomClassRequest) obj; - - if (hasCustomClass() != other.hasCustomClass()) return false; - if (hasCustomClass()) { - if (!getCustomClass() - .equals(other.getCustomClass())) return false; - } - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask() - .equals(other.getUpdateMask())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasCustomClass()) { - hash = (37 * hash) + CUSTOM_CLASS_FIELD_NUMBER; - hash = (53 * hash) + getCustomClass().hashCode(); - } - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.UpdateCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.UpdateCustomClassRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `UpdateCustomClass` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.UpdateCustomClassRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.UpdateCustomClassRequest) - com.google.cloud.speech.v1.UpdateCustomClassRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.UpdateCustomClassRequest.class, com.google.cloud.speech.v1.UpdateCustomClassRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.UpdateCustomClassRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (customClassBuilder_ == null) { - customClass_ = null; - } else { - customClass_ = null; - customClassBuilder_ = null; - } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdateCustomClassRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.UpdateCustomClassRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.UpdateCustomClassRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.UpdateCustomClassRequest build() { - com.google.cloud.speech.v1.UpdateCustomClassRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.UpdateCustomClassRequest buildPartial() { - com.google.cloud.speech.v1.UpdateCustomClassRequest result = new com.google.cloud.speech.v1.UpdateCustomClassRequest(this); - if (customClassBuilder_ == null) { - result.customClass_ = customClass_; - } else { - result.customClass_ = customClassBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.UpdateCustomClassRequest) { - return mergeFrom((com.google.cloud.speech.v1.UpdateCustomClassRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.UpdateCustomClassRequest other) { - if (other == com.google.cloud.speech.v1.UpdateCustomClassRequest.getDefaultInstance()) return this; - if (other.hasCustomClass()) { - mergeCustomClass(other.getCustomClass()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.UpdateCustomClassRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.UpdateCustomClassRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1.CustomClass customClass_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> customClassBuilder_; - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the customClass field is set. - */ - public boolean hasCustomClass() { - return customClassBuilder_ != null || customClass_ != null; - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClass. - */ - public com.google.cloud.speech.v1.CustomClass getCustomClass() { - if (customClassBuilder_ == null) { - return customClass_ == null ? com.google.cloud.speech.v1.CustomClass.getDefaultInstance() : customClass_; - } else { - return customClassBuilder_.getMessage(); - } - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setCustomClass(com.google.cloud.speech.v1.CustomClass value) { - if (customClassBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - customClass_ = value; - onChanged(); - } else { - customClassBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setCustomClass( - com.google.cloud.speech.v1.CustomClass.Builder builderForValue) { - if (customClassBuilder_ == null) { - customClass_ = builderForValue.build(); - onChanged(); - } else { - customClassBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeCustomClass(com.google.cloud.speech.v1.CustomClass value) { - if (customClassBuilder_ == null) { - if (customClass_ != null) { - customClass_ = - com.google.cloud.speech.v1.CustomClass.newBuilder(customClass_).mergeFrom(value).buildPartial(); - } else { - customClass_ = value; - } - onChanged(); - } else { - customClassBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearCustomClass() { - if (customClassBuilder_ == null) { - customClass_ = null; - onChanged(); - } else { - customClass_ = null; - customClassBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.CustomClass.Builder getCustomClassBuilder() { - - onChanged(); - return getCustomClassFieldBuilder().getBuilder(); - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassOrBuilder() { - if (customClassBuilder_ != null) { - return customClassBuilder_.getMessageOrBuilder(); - } else { - return customClass_ == null ? - com.google.cloud.speech.v1.CustomClass.getDefaultInstance() : customClass_; - } - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder> - getCustomClassFieldBuilder() { - if (customClassBuilder_ == null) { - customClassBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.CustomClass, com.google.cloud.speech.v1.CustomClass.Builder, com.google.cloud.speech.v1.CustomClassOrBuilder>( - getCustomClass(), - getParentForChildren(), - isClean()); - customClass_ = null; - } - return customClassBuilder_; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - onChanged(); - } else { - updateMaskBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask( - com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - onChanged(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); - } else { - updateMask_ = value; - } - onChanged(); - } else { - updateMaskBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null ? - com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), - getParentForChildren(), - isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.UpdateCustomClassRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.UpdateCustomClassRequest) - private static final com.google.cloud.speech.v1.UpdateCustomClassRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.UpdateCustomClassRequest(); - } - - public static com.google.cloud.speech.v1.UpdateCustomClassRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateCustomClassRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateCustomClassRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.UpdateCustomClassRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequestOrBuilder.java deleted file mode 100644 index 502a36d4010f..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdateCustomClassRequestOrBuilder.java +++ /dev/null @@ -1,87 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public interface UpdateCustomClassRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.UpdateCustomClassRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The custom class to update.
-   * The custom class's `name` field is used to identify the custom class to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the customClass field is set. - */ - boolean hasCustomClass(); - /** - *
-   * Required. The custom class to update.
-   * The custom class's `name` field is used to identify the custom class to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClass. - */ - com.google.cloud.speech.v1.CustomClass getCustomClass(); - /** - *
-   * Required. The custom class to update.
-   * The custom class's `name` field is used to identify the custom class to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1.CustomClassOrBuilder getCustomClassOrBuilder(); - - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequest.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequest.java deleted file mode 100644 index b0510d68c25f..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequest.java +++ /dev/null @@ -1,997 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Message sent by the client for the `UpdatePhraseSet` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.UpdatePhraseSetRequest} - */ -public final class UpdatePhraseSetRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.UpdatePhraseSetRequest) - UpdatePhraseSetRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use UpdatePhraseSetRequest.newBuilder() to construct. - private UpdatePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private UpdatePhraseSetRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new UpdatePhraseSetRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private UpdatePhraseSetRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.cloud.speech.v1.PhraseSet.Builder subBuilder = null; - if (phraseSet_ != null) { - subBuilder = phraseSet_.toBuilder(); - } - phraseSet_ = input.readMessage(com.google.cloud.speech.v1.PhraseSet.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(phraseSet_); - phraseSet_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.UpdatePhraseSetRequest.class, com.google.cloud.speech.v1.UpdatePhraseSetRequest.Builder.class); - } - - public static final int PHRASE_SET_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1.PhraseSet phraseSet_; - /** - *
-   * Required. The phrase set to update.
-   * The phrase set's `name` field is used to identify the set to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the phraseSet field is set. - */ - @java.lang.Override - public boolean hasPhraseSet() { - return phraseSet_ != null; - } - /** - *
-   * Required. The phrase set to update.
-   * The phrase set's `name` field is used to identify the set to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSet. - */ - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSet getPhraseSet() { - return phraseSet_ == null ? com.google.cloud.speech.v1.PhraseSet.getDefaultInstance() : phraseSet_; - } - /** - *
-   * Required. The phrase set to update.
-   * The phrase set's `name` field is used to identify the set to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetOrBuilder() { - return getPhraseSet(); - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 2; - private com.google.protobuf.FieldMask updateMask_; - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (phraseSet_ != null) { - output.writeMessage(1, getPhraseSet()); - } - if (updateMask_ != null) { - output.writeMessage(2, getUpdateMask()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (phraseSet_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPhraseSet()); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getUpdateMask()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.UpdatePhraseSetRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.UpdatePhraseSetRequest other = (com.google.cloud.speech.v1.UpdatePhraseSetRequest) obj; - - if (hasPhraseSet() != other.hasPhraseSet()) return false; - if (hasPhraseSet()) { - if (!getPhraseSet() - .equals(other.getPhraseSet())) return false; - } - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask() - .equals(other.getUpdateMask())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPhraseSet()) { - hash = (37 * hash) + PHRASE_SET_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSet().hashCode(); - } - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.UpdatePhraseSetRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `UpdatePhraseSet` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.UpdatePhraseSetRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.UpdatePhraseSetRequest) - com.google.cloud.speech.v1.UpdatePhraseSetRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.UpdatePhraseSetRequest.class, com.google.cloud.speech.v1.UpdatePhraseSetRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.UpdatePhraseSetRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (phraseSetBuilder_ == null) { - phraseSet_ = null; - } else { - phraseSet_ = null; - phraseSetBuilder_ = null; - } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1_UpdatePhraseSetRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.UpdatePhraseSetRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1.UpdatePhraseSetRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.UpdatePhraseSetRequest build() { - com.google.cloud.speech.v1.UpdatePhraseSetRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.UpdatePhraseSetRequest buildPartial() { - com.google.cloud.speech.v1.UpdatePhraseSetRequest result = new com.google.cloud.speech.v1.UpdatePhraseSetRequest(this); - if (phraseSetBuilder_ == null) { - result.phraseSet_ = phraseSet_; - } else { - result.phraseSet_ = phraseSetBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.UpdatePhraseSetRequest) { - return mergeFrom((com.google.cloud.speech.v1.UpdatePhraseSetRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.UpdatePhraseSetRequest other) { - if (other == com.google.cloud.speech.v1.UpdatePhraseSetRequest.getDefaultInstance()) return this; - if (other.hasPhraseSet()) { - mergePhraseSet(other.getPhraseSet()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.UpdatePhraseSetRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.UpdatePhraseSetRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1.PhraseSet phraseSet_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> phraseSetBuilder_; - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the phraseSet field is set. - */ - public boolean hasPhraseSet() { - return phraseSetBuilder_ != null || phraseSet_ != null; - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSet. - */ - public com.google.cloud.speech.v1.PhraseSet getPhraseSet() { - if (phraseSetBuilder_ == null) { - return phraseSet_ == null ? com.google.cloud.speech.v1.PhraseSet.getDefaultInstance() : phraseSet_; - } else { - return phraseSetBuilder_.getMessage(); - } - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setPhraseSet(com.google.cloud.speech.v1.PhraseSet value) { - if (phraseSetBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - phraseSet_ = value; - onChanged(); - } else { - phraseSetBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setPhraseSet( - com.google.cloud.speech.v1.PhraseSet.Builder builderForValue) { - if (phraseSetBuilder_ == null) { - phraseSet_ = builderForValue.build(); - onChanged(); - } else { - phraseSetBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergePhraseSet(com.google.cloud.speech.v1.PhraseSet value) { - if (phraseSetBuilder_ == null) { - if (phraseSet_ != null) { - phraseSet_ = - com.google.cloud.speech.v1.PhraseSet.newBuilder(phraseSet_).mergeFrom(value).buildPartial(); - } else { - phraseSet_ = value; - } - onChanged(); - } else { - phraseSetBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearPhraseSet() { - if (phraseSetBuilder_ == null) { - phraseSet_ = null; - onChanged(); - } else { - phraseSet_ = null; - phraseSetBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.PhraseSet.Builder getPhraseSetBuilder() { - - onChanged(); - return getPhraseSetFieldBuilder().getBuilder(); - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetOrBuilder() { - if (phraseSetBuilder_ != null) { - return phraseSetBuilder_.getMessageOrBuilder(); - } else { - return phraseSet_ == null ? - com.google.cloud.speech.v1.PhraseSet.getDefaultInstance() : phraseSet_; - } - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder> - getPhraseSetFieldBuilder() { - if (phraseSetBuilder_ == null) { - phraseSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1.PhraseSet, com.google.cloud.speech.v1.PhraseSet.Builder, com.google.cloud.speech.v1.PhraseSetOrBuilder>( - getPhraseSet(), - getParentForChildren(), - isClean()); - phraseSet_ = null; - } - return phraseSetBuilder_; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - onChanged(); - } else { - updateMaskBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask( - com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - onChanged(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); - } else { - updateMask_ = value; - } - onChanged(); - } else { - updateMaskBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null ? - com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), - getParentForChildren(), - isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.UpdatePhraseSetRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.UpdatePhraseSetRequest) - private static final com.google.cloud.speech.v1.UpdatePhraseSetRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.UpdatePhraseSetRequest(); - } - - public static com.google.cloud.speech.v1.UpdatePhraseSetRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdatePhraseSetRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdatePhraseSetRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.UpdatePhraseSetRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequestOrBuilder.java deleted file mode 100644 index 1c70780af975..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/UpdatePhraseSetRequestOrBuilder.java +++ /dev/null @@ -1,87 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1; - -public interface UpdatePhraseSetRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.UpdatePhraseSetRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The phrase set to update.
-   * The phrase set's `name` field is used to identify the set to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the phraseSet field is set. - */ - boolean hasPhraseSet(); - /** - *
-   * Required. The phrase set to update.
-   * The phrase set's `name` field is used to identify the set to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSet. - */ - com.google.cloud.speech.v1.PhraseSet getPhraseSet(); - /** - *
-   * Required. The phrase set to update.
-   * The phrase set's `name` field is used to identify the set to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1.PhraseSetOrBuilder getPhraseSetOrBuilder(); - - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java deleted file mode 100644 index 45597a92de64..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfo.java +++ /dev/null @@ -1,1389 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -/** - *
- * Word-specific information for recognized words.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1.WordInfo} - */ -public final class WordInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.WordInfo) - WordInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use WordInfo.newBuilder() to construct. - private WordInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private WordInfo() { - word_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new WordInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private WordInfo( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (endTime_ != null) { - subBuilder = endTime_.toBuilder(); - } - endTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endTime_); - endTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - word_ = s; - break; - } - case 37: { - - confidence_ = input.readFloat(); - break; - } - case 40: { - - speakerTag_ = input.readInt32(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_WordInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_WordInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.WordInfo.class, com.google.cloud.speech.v1.WordInfo.Builder.class); - } - - public static final int START_TIME_FIELD_NUMBER = 1; - private com.google.protobuf.Duration startTime_; - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * @return Whether the startTime field is set. - */ - @java.lang.Override - public boolean hasStartTime() { - return startTime_ != null; - } - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * @return The startTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getStartTime() { - return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; - } - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { - return getStartTime(); - } - - public static final int END_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Duration endTime_; - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * @return Whether the endTime field is set. - */ - @java.lang.Override - public boolean hasEndTime() { - return endTime_ != null; - } - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * @return The endTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getEndTime() { - return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; - } - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { - return getEndTime(); - } - - public static final int WORD_FIELD_NUMBER = 3; - private volatile java.lang.Object word_; - /** - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * @return The word. - */ - @java.lang.Override - public java.lang.String getWord() { - java.lang.Object ref = word_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - word_ = s; - return s; - } - } - /** - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * @return The bytes for word. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getWordBytes() { - java.lang.Object ref = word_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - word_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONFIDENCE_FIELD_NUMBER = 4; - private float confidence_; - /** - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 4; - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - - public static final int SPEAKER_TAG_FIELD_NUMBER = 5; - private int speakerTag_; - /** - *
-   * Output only. A distinct integer value is assigned for every speaker within
-   * the audio. This field specifies which one of those speakers was detected to
-   * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-   * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-   * top alternative.
-   * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The speakerTag. - */ - @java.lang.Override - public int getSpeakerTag() { - return speakerTag_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (startTime_ != null) { - output.writeMessage(1, getStartTime()); - } - if (endTime_ != null) { - output.writeMessage(2, getEndTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(word_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, word_); - } - if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { - output.writeFloat(4, confidence_); - } - if (speakerTag_ != 0) { - output.writeInt32(5, speakerTag_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (startTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getStartTime()); - } - if (endTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getEndTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(word_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, word_); - } - if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(4, confidence_); - } - if (speakerTag_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, speakerTag_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1.WordInfo)) { - return super.equals(obj); - } - com.google.cloud.speech.v1.WordInfo other = (com.google.cloud.speech.v1.WordInfo) obj; - - if (hasStartTime() != other.hasStartTime()) return false; - if (hasStartTime()) { - if (!getStartTime() - .equals(other.getStartTime())) return false; - } - if (hasEndTime() != other.hasEndTime()) return false; - if (hasEndTime()) { - if (!getEndTime() - .equals(other.getEndTime())) return false; - } - if (!getWord() - .equals(other.getWord())) return false; - if (java.lang.Float.floatToIntBits(getConfidence()) - != java.lang.Float.floatToIntBits( - other.getConfidence())) return false; - if (getSpeakerTag() - != other.getSpeakerTag()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasStartTime()) { - hash = (37 * hash) + START_TIME_FIELD_NUMBER; - hash = (53 * hash) + getStartTime().hashCode(); - } - if (hasEndTime()) { - hash = (37 * hash) + END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getEndTime().hashCode(); - } - hash = (37 * hash) + WORD_FIELD_NUMBER; - hash = (53 * hash) + getWord().hashCode(); - hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getConfidence()); - hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; - hash = (53 * hash) + getSpeakerTag(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1.WordInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.WordInfo parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.WordInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.WordInfo parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.WordInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1.WordInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1.WordInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.WordInfo parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.WordInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.WordInfo parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1.WordInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1.WordInfo parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1.WordInfo prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Word-specific information for recognized words.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1.WordInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1.WordInfo) - com.google.cloud.speech.v1.WordInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_WordInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_WordInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1.WordInfo.class, com.google.cloud.speech.v1.WordInfo.Builder.class); - } - - // Construct using com.google.cloud.speech.v1.WordInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - if (endTimeBuilder_ == null) { - endTime_ = null; - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - word_ = ""; - - confidence_ = 0F; - - speakerTag_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1.SpeechProto.internal_static_google_cloud_speech_v1_WordInfo_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1.WordInfo getDefaultInstanceForType() { - return com.google.cloud.speech.v1.WordInfo.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1.WordInfo build() { - com.google.cloud.speech.v1.WordInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1.WordInfo buildPartial() { - com.google.cloud.speech.v1.WordInfo result = new com.google.cloud.speech.v1.WordInfo(this); - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); - } - result.word_ = word_; - result.confidence_ = confidence_; - result.speakerTag_ = speakerTag_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1.WordInfo) { - return mergeFrom((com.google.cloud.speech.v1.WordInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1.WordInfo other) { - if (other == com.google.cloud.speech.v1.WordInfo.getDefaultInstance()) return this; - if (other.hasStartTime()) { - mergeStartTime(other.getStartTime()); - } - if (other.hasEndTime()) { - mergeEndTime(other.getEndTime()); - } - if (!other.getWord().isEmpty()) { - word_ = other.word_; - onChanged(); - } - if (other.getConfidence() != 0F) { - setConfidence(other.getConfidence()); - } - if (other.getSpeakerTag() != 0) { - setSpeakerTag(other.getSpeakerTag()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1.WordInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1.WordInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.protobuf.Duration startTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> startTimeBuilder_; - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - * @return Whether the startTime field is set. - */ - public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - * @return The startTime. - */ - public com.google.protobuf.Duration getStartTime() { - if (startTimeBuilder_ == null) { - return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; - } else { - return startTimeBuilder_.getMessage(); - } - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder setStartTime(com.google.protobuf.Duration value) { - if (startTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - startTime_ = value; - onChanged(); - } else { - startTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder setStartTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (startTimeBuilder_ == null) { - startTime_ = builderForValue.build(); - onChanged(); - } else { - startTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder mergeStartTime(com.google.protobuf.Duration value) { - if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Duration.newBuilder(startTime_).mergeFrom(value).buildPartial(); - } else { - startTime_ = value; - } - onChanged(); - } else { - startTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public com.google.protobuf.Duration.Builder getStartTimeBuilder() { - - onChanged(); - return getStartTimeFieldBuilder().getBuilder(); - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { - if (startTimeBuilder_ != null) { - return startTimeBuilder_.getMessageOrBuilder(); - } else { - return startTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : startTime_; - } - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getStartTimeFieldBuilder() { - if (startTimeBuilder_ == null) { - startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getStartTime(), - getParentForChildren(), - isClean()); - startTime_ = null; - } - return startTimeBuilder_; - } - - private com.google.protobuf.Duration endTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> endTimeBuilder_; - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - * @return Whether the endTime field is set. - */ - public boolean hasEndTime() { - return endTimeBuilder_ != null || endTime_ != null; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - * @return The endTime. - */ - public com.google.protobuf.Duration getEndTime() { - if (endTimeBuilder_ == null) { - return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; - } else { - return endTimeBuilder_.getMessage(); - } - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder setEndTime(com.google.protobuf.Duration value) { - if (endTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - endTime_ = value; - onChanged(); - } else { - endTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder setEndTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (endTimeBuilder_ == null) { - endTime_ = builderForValue.build(); - onChanged(); - } else { - endTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder mergeEndTime(com.google.protobuf.Duration value) { - if (endTimeBuilder_ == null) { - if (endTime_ != null) { - endTime_ = - com.google.protobuf.Duration.newBuilder(endTime_).mergeFrom(value).buildPartial(); - } else { - endTime_ = value; - } - onChanged(); - } else { - endTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - endTime_ = null; - onChanged(); - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public com.google.protobuf.Duration.Builder getEndTimeBuilder() { - - onChanged(); - return getEndTimeFieldBuilder().getBuilder(); - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { - if (endTimeBuilder_ != null) { - return endTimeBuilder_.getMessageOrBuilder(); - } else { - return endTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : endTime_; - } - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getEndTimeFieldBuilder() { - if (endTimeBuilder_ == null) { - endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getEndTime(), - getParentForChildren(), - isClean()); - endTime_ = null; - } - return endTimeBuilder_; - } - - private java.lang.Object word_ = ""; - /** - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * @return The word. - */ - public java.lang.String getWord() { - java.lang.Object ref = word_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - word_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * @return The bytes for word. - */ - public com.google.protobuf.ByteString - getWordBytes() { - java.lang.Object ref = word_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - word_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * @param value The word to set. - * @return This builder for chaining. - */ - public Builder setWord( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - word_ = value; - onChanged(); - return this; - } - /** - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * @return This builder for chaining. - */ - public Builder clearWord() { - - word_ = getDefaultInstance().getWord(); - onChanged(); - return this; - } - /** - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * @param value The bytes for word to set. - * @return This builder for chaining. - */ - public Builder setWordBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - word_ = value; - onChanged(); - return this; - } - - private float confidence_ ; - /** - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 4; - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - /** - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 4; - * @param value The confidence to set. - * @return This builder for chaining. - */ - public Builder setConfidence(float value) { - - confidence_ = value; - onChanged(); - return this; - } - /** - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 4; - * @return This builder for chaining. - */ - public Builder clearConfidence() { - - confidence_ = 0F; - onChanged(); - return this; - } - - private int speakerTag_ ; - /** - *
-     * Output only. A distinct integer value is assigned for every speaker within
-     * the audio. This field specifies which one of those speakers was detected to
-     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-     * top alternative.
-     * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The speakerTag. - */ - @java.lang.Override - public int getSpeakerTag() { - return speakerTag_; - } - /** - *
-     * Output only. A distinct integer value is assigned for every speaker within
-     * the audio. This field specifies which one of those speakers was detected to
-     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-     * top alternative.
-     * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The speakerTag to set. - * @return This builder for chaining. - */ - public Builder setSpeakerTag(int value) { - - speakerTag_ = value; - onChanged(); - return this; - } - /** - *
-     * Output only. A distinct integer value is assigned for every speaker within
-     * the audio. This field specifies which one of those speakers was detected to
-     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-     * top alternative.
-     * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return This builder for chaining. - */ - public Builder clearSpeakerTag() { - - speakerTag_ = 0; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1.WordInfo) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1.WordInfo) - private static final com.google.cloud.speech.v1.WordInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1.WordInfo(); - } - - public static com.google.cloud.speech.v1.WordInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WordInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WordInfo(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1.WordInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java deleted file mode 100644 index f8e889216201..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/java/com/google/cloud/speech/v1/WordInfoOrBuilder.java +++ /dev/null @@ -1,143 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1/cloud_speech.proto - -package com.google.cloud.speech.v1; - -public interface WordInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1.WordInfo) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * @return Whether the startTime field is set. - */ - boolean hasStartTime(); - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * @return The startTime. - */ - com.google.protobuf.Duration getStartTime(); - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - */ - com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder(); - - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * @return Whether the endTime field is set. - */ - boolean hasEndTime(); - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * @return The endTime. - */ - com.google.protobuf.Duration getEndTime(); - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - */ - com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder(); - - /** - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * @return The word. - */ - java.lang.String getWord(); - /** - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * @return The bytes for word. - */ - com.google.protobuf.ByteString - getWordBytes(); - - /** - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 4; - * @return The confidence. - */ - float getConfidence(); - - /** - *
-   * Output only. A distinct integer value is assigned for every speaker within
-   * the audio. This field specifies which one of those speakers was detected to
-   * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-   * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-   * top alternative.
-   * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The speakerTag. - */ - int getSpeakerTag(); -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto deleted file mode 100644 index 65aed9837e85..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech.proto +++ /dev/null @@ -1,899 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.speech.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/cloud/speech/v1/resource.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/rpc/status.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1;speech"; -option java_multiple_files = true; -option java_outer_classname = "SpeechProto"; -option java_package = "com.google.cloud.speech.v1"; -option objc_class_prefix = "GCS"; - -// Service that implements Google Cloud Speech API. -service Speech { - option (google.api.default_host) = "speech.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Performs synchronous speech recognition: receive results after all audio - // has been sent and processed. - rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { - option (google.api.http) = { - post: "/v1/speech:recognize" - body: "*" - }; - option (google.api.method_signature) = "config,audio"; - } - - // Performs asynchronous speech recognition: receive results via the - // google.longrunning.Operations interface. Returns either an - // `Operation.error` or an `Operation.response` which contains - // a `LongRunningRecognizeResponse` message. - // For more information on asynchronous speech recognition, see the - // [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - rpc LongRunningRecognize(LongRunningRecognizeRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/speech:longrunningrecognize" - body: "*" - }; - option (google.api.method_signature) = "config,audio"; - option (google.longrunning.operation_info) = { - response_type: "LongRunningRecognizeResponse" - metadata_type: "LongRunningRecognizeMetadata" - }; - } - - // Performs bidirectional streaming speech recognition: receive results while - // sending audio. This method is only available via the gRPC API (not REST). - rpc StreamingRecognize(stream StreamingRecognizeRequest) returns (stream StreamingRecognizeResponse) { - } -} - -// The top-level message sent by the client for the `Recognize` method. -message RecognizeRequest { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The audio data to be recognized. - RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The top-level message sent by the client for the `LongRunningRecognize` -// method. -message LongRunningRecognizeRequest { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The audio data to be recognized. - RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Specifies an optional destination for the recognition results. - TranscriptOutputConfig output_config = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Specifies an optional destination for the recognition results. -message TranscriptOutputConfig { - oneof output_type { - // Specifies a Cloud Storage URI for the recognition results. Must be - // specified in the format: `gs://bucket_name/object_name`, and the bucket - // must already exist. - string gcs_uri = 1; - } -} - -// The top-level message sent by the client for the `StreamingRecognize` method. -// Multiple `StreamingRecognizeRequest` messages are sent. The first message -// must contain a `streaming_config` message and must not contain -// `audio_content`. All subsequent messages must contain `audio_content` and -// must not contain a `streaming_config` message. -message StreamingRecognizeRequest { - // The streaming request, which is either a streaming config or audio content. - oneof streaming_request { - // Provides information to the recognizer that specifies how to process the - // request. The first `StreamingRecognizeRequest` message must contain a - // `streaming_config` message. - StreamingRecognitionConfig streaming_config = 1; - - // The audio data to be recognized. Sequential chunks of audio data are sent - // in sequential `StreamingRecognizeRequest` messages. The first - // `StreamingRecognizeRequest` message must not contain `audio_content` data - // and all subsequent `StreamingRecognizeRequest` messages must contain - // `audio_content` data. The audio bytes must be encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - // pure binary representation (not base64). See - // [content limits](https://cloud.google.com/speech-to-text/quotas#content). - bytes audio_content = 2; - } -} - -// Provides information to the recognizer that specifies how to process the -// request. -message StreamingRecognitionConfig { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // If `false` or omitted, the recognizer will perform continuous - // recognition (continuing to wait for and process audio even if the user - // pauses speaking) until the client closes the input stream (gRPC API) or - // until the maximum time limit has been reached. May return multiple - // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. - // - // If `true`, the recognizer will detect a single spoken utterance. When it - // detects that the user has paused or stopped speaking, it will return an - // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no - // more than one `StreamingRecognitionResult` with the `is_final` flag set to - // `true`. - // - // The `single_utterance` field can only be used with specified models, - // otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] - // must be set to: - // - // * `command_and_search` - // * `phone_call` AND additional field `useEnhanced`=`true` - // * The `model` field is left undefined. In this case the API auto-selects - // a model based on any other parameters that you set in - // `RecognitionConfig`. - bool single_utterance = 2; - - // If `true`, interim results (tentative hypotheses) may be - // returned as they become available (these interim results are indicated with - // the `is_final=false` flag). - // If `false` or omitted, only `is_final=true` result(s) are returned. - bool interim_results = 3; -} - -// Provides information to the recognizer that specifies how to process the -// request. -message RecognitionConfig { - // The encoding of the audio data sent in the request. - // - // All encodings support only 1 channel (mono) audio, unless the - // `audio_channel_count` and `enable_separate_recognition_per_channel` fields - // are set. - // - // For best results, the audio source should be captured and transmitted using - // a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech - // recognition can be reduced if lossy codecs are used to capture or transmit - // audio, particularly if background noise is present. Lossy codecs include - // `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`, - // and `WEBM_OPUS`. - // - // The `FLAC` and `WAV` audio file formats include a header that describes the - // included audio content. You can request recognition for `WAV` files that - // contain either `LINEAR16` or `MULAW` encoded audio. - // If you send `FLAC` or `WAV` audio file format in - // your request, you do not need to specify an `AudioEncoding`; the audio - // encoding format is determined from the file header. If you specify - // an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the - // encoding configuration must match the encoding described in the audio - // header; otherwise the request returns an - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code. - enum AudioEncoding { - // Not specified. - ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - LINEAR16 = 1; - - // `FLAC` (Free Lossless Audio - // Codec) is the recommended encoding because it is - // lossless--therefore recognition is not compromised--and - // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream - // encoding supports 16-bit and 24-bit samples, however, not all fields in - // `STREAMINFO` are supported. - FLAC = 2; - - // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - MULAW = 3; - - // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. - AMR = 4; - - // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. - AMR_WB = 5; - - // Opus encoded audio frames in Ogg container - // ([OggOpus](https://wiki.xiph.org/OggOpus)). - // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. - OGG_OPUS = 6; - - // Although the use of lossy encodings is not recommended, if a very low - // bitrate encoding is required, `OGG_OPUS` is highly preferred over - // Speex encoding. The [Speex](https://speex.org/) encoding supported by - // Cloud Speech API has a header byte in each block, as in MIME type - // `audio/x-speex-with-header-byte`. - // It is a variant of the RTP Speex encoding defined in - // [RFC 5574](https://tools.ietf.org/html/rfc5574). - // The stream is a sequence of blocks, one block per RTP packet. Each block - // starts with a byte containing the length of the block, in bytes, followed - // by one or more frames of Speex data, padded to an integral number of - // bytes (octets) as specified in RFC 5574. In other words, each RTP header - // is replaced with a single byte containing the block length. Only Speex - // wideband is supported. `sample_rate_hertz` must be 16000. - SPEEX_WITH_HEADER_BYTE = 7; - - // Opus encoded audio frames in WebM container - // ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be - // one of 8000, 12000, 16000, 24000, or 48000. - WEBM_OPUS = 9; - } - - // Encoding of audio data sent in all `RecognitionAudio` messages. - // This field is optional for `FLAC` and `WAV` audio files and required - // for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding]. - AudioEncoding encoding = 1; - - // Sample rate in Hertz of the audio data sent in all - // `RecognitionAudio` messages. Valid values are: 8000-48000. - // 16000 is optimal. For best results, set the sampling rate of the audio - // source to 16000 Hz. If that's not possible, use the native sample rate of - // the audio source (instead of re-sampling). - // This field is optional for FLAC and WAV audio files, but is - // required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding]. - int32 sample_rate_hertz = 2; - - // The number of channels in the input audio data. - // ONLY set this for MULTI-CHANNEL recognition. - // Valid values for LINEAR16 and FLAC are `1`-`8`. - // Valid values for OGG_OPUS are '1'-'254'. - // Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. - // If `0` or omitted, defaults to one channel (mono). - // Note: We only recognize the first channel by default. - // To perform independent recognition on each channel set - // `enable_separate_recognition_per_channel` to 'true'. - int32 audio_channel_count = 7; - - // This needs to be set to `true` explicitly and `audio_channel_count` > 1 - // to get each channel recognized separately. The recognition result will - // contain a `channel_tag` field to state which channel that result belongs - // to. If this is not true, we will only recognize the first channel. The - // request is billed cumulatively for all channels recognized: - // `audio_channel_count` multiplied by the length of the audio. - bool enable_separate_recognition_per_channel = 12; - - // Required. The language of the supplied audio as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - // Example: "en-US". - // See [Language - // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - // of the currently supported language codes. - string language_code = 3 [(google.api.field_behavior) = REQUIRED]; - - // A list of up to 3 additional - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, - // listing possible alternative languages of the supplied audio. - // See [Language - // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - // of the currently supported language codes. If alternative languages are - // listed, recognition result will contain recognition in the most likely - // language detected including the main language_code. The recognition result - // will include the language tag of the language detected in the audio. Note: - // This feature is only supported for Voice Command and Voice Search use cases - // and performance may vary for other use cases (e.g., phone call - // transcription). - repeated string alternative_language_codes = 18; - - // Maximum number of recognition hypotheses to be returned. - // Specifically, the maximum number of `SpeechRecognitionAlternative` messages - // within each `SpeechRecognitionResult`. - // The server may return fewer than `max_alternatives`. - // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of - // one. If omitted, will return a maximum of one. - int32 max_alternatives = 4; - - // If set to `true`, the server will attempt to filter out - // profanities, replacing all but the initial character in each filtered word - // with asterisks, e.g. "f***". If set to `false` or omitted, profanities - // won't be filtered out. - bool profanity_filter = 5; - - // Speech adaptation configuration improves the accuracy of speech - // recognition. For more information, see the [speech - // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation) - // documentation. - // When speech adaptation is set it supersedes the `speech_contexts` field. - SpeechAdaptation adaptation = 20; - - // Array of [SpeechContext][google.cloud.speech.v1.SpeechContext]. - // A means to provide context to assist the speech recognition. For more - // information, see - // [speech - // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation). - repeated SpeechContext speech_contexts = 6; - - // If `true`, the top result includes a list of words and - // the start and end time offsets (timestamps) for those words. If - // `false`, no word-level time offset information is returned. The default is - // `false`. - bool enable_word_time_offsets = 8; - - // If `true`, the top result includes a list of words and the - // confidence for those words. If `false`, no word-level confidence - // information is returned. The default is `false`. - bool enable_word_confidence = 15; - - // If 'true', adds punctuation to recognition result hypotheses. - // This feature is only available in select languages. Setting this for - // requests in other languages has no effect at all. - // The default 'false' value does not add punctuation to result hypotheses. - bool enable_automatic_punctuation = 11; - - // The spoken punctuation behavior for the call - // If not set, uses default behavior based on model of choice - // e.g. command_and_search will enable spoken punctuation by default - // If 'true', replaces spoken punctuation with the corresponding symbols in - // the request. For example, "how are you question mark" becomes "how are - // you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation - // for support. If 'false', spoken punctuation is not replaced. - google.protobuf.BoolValue enable_spoken_punctuation = 22; - - // The spoken emoji behavior for the call - // If not set, uses default behavior based on model of choice - // If 'true', adds spoken emoji formatting for the request. This will replace - // spoken emojis with the corresponding Unicode symbols in the final - // transcript. If 'false', spoken emojis are not replaced. - google.protobuf.BoolValue enable_spoken_emojis = 23; - - // Config to enable speaker diarization and set additional - // parameters to make diarization better suited for your application. - // Note: When this is enabled, we send all the words from the beginning of the - // audio for the top alternative in every consecutive STREAMING responses. - // This is done in order to improve our speaker tags as our models learn to - // identify the speakers in the conversation over time. - // For non-streaming requests, the diarization results will be provided only - // in the top alternative of the FINAL SpeechRecognitionResult. - SpeakerDiarizationConfig diarization_config = 19; - - // Metadata regarding this request. - RecognitionMetadata metadata = 9; - - // Which model to select for the given request. Select the model - // best suited to your domain to get best results. If a model is not - // explicitly specified, then we auto-select a model based on the parameters - // in the RecognitionConfig. - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - //
ModelDescription
latest_longBest for long form content like media or conversation.
latest_shortBest for short form content like commands or single shot directed - // speech.
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically - // recorded at an 8khz sampling rate).
videoBest for audio that originated from video or includes multiple - // speakers. Ideally the audio is recorded at a 16khz or greater - // sampling rate. This is a premium model that costs more than the - // standard rate.
defaultBest for audio that is not one of the specific audio models. - // For example, long-form audio. Ideally the audio is high-fidelity, - // recorded at a 16khz or greater sampling rate.
medical_conversationBest for audio that originated from a conversation between a - // medical provider and patient.
medical_dictationBest for audio that originated from dictation notes by a medical - // provider.
- string model = 13; - - // Set to true to use an enhanced model for speech recognition. - // If `use_enhanced` is set to true and the `model` field is not set, then - // an appropriate enhanced model is chosen if an enhanced model exists for - // the audio. - // - // If `use_enhanced` is true and an enhanced version of the specified model - // does not exist, then the speech is recognized using the standard version - // of the specified model. - bool use_enhanced = 14; -} - -// Config to enable speaker diarization. -message SpeakerDiarizationConfig { - // If 'true', enables speaker detection for each recognized word in - // the top alternative of the recognition result using a speaker_tag provided - // in the WordInfo. - bool enable_speaker_diarization = 1; - - // Minimum number of speakers in the conversation. This range gives you more - // flexibility by allowing the system to automatically determine the correct - // number of speakers. If not set, the default value is 2. - int32 min_speaker_count = 2; - - // Maximum number of speakers in the conversation. This range gives you more - // flexibility by allowing the system to automatically determine the correct - // number of speakers. If not set, the default value is 6. - int32 max_speaker_count = 3; - - // Output only. Unused. - int32 speaker_tag = 5 [ - deprecated = true, - (google.api.field_behavior) = OUTPUT_ONLY - ]; -} - -// Description of audio data to be recognized. -message RecognitionMetadata { - option deprecated = true; - - // Use case categories that the audio recognition request can be described - // by. - enum InteractionType { - // Use case is either unknown or is something other than one of the other - // values below. - INTERACTION_TYPE_UNSPECIFIED = 0; - - // Multiple people in a conversation or discussion. For example in a - // meeting with two or more people actively participating. Typically - // all the primary people speaking would be in the same room (if not, - // see PHONE_CALL) - DISCUSSION = 1; - - // One or more persons lecturing or presenting to others, mostly - // uninterrupted. - PRESENTATION = 2; - - // A phone-call or video-conference in which two or more people, who are - // not in the same room, are actively participating. - PHONE_CALL = 3; - - // A recorded message intended for another person to listen to. - VOICEMAIL = 4; - - // Professionally produced audio (eg. TV Show, Podcast). - PROFESSIONALLY_PRODUCED = 5; - - // Transcribe spoken questions and queries into text. - VOICE_SEARCH = 6; - - // Transcribe voice commands, such as for controlling a device. - VOICE_COMMAND = 7; - - // Transcribe speech to text to create a written document, such as a - // text-message, email or report. - DICTATION = 8; - } - - // Enumerates the types of capture settings describing an audio file. - enum MicrophoneDistance { - // Audio type is not known. - MICROPHONE_DISTANCE_UNSPECIFIED = 0; - - // The audio was captured from a closely placed microphone. Eg. phone, - // dictaphone, or handheld microphone. Generally if there speaker is within - // 1 meter of the microphone. - NEARFIELD = 1; - - // The speaker if within 3 meters of the microphone. - MIDFIELD = 2; - - // The speaker is more than 3 meters away from the microphone. - FARFIELD = 3; - } - - // The original media the speech was recorded on. - enum OriginalMediaType { - // Unknown original media type. - ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - - // The speech data is an audio recording. - AUDIO = 1; - - // The speech data originally recorded on a video. - VIDEO = 2; - } - - // The type of device the speech was recorded with. - enum RecordingDeviceType { - // The recording device is unknown. - RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - - // Speech was recorded on a smartphone. - SMARTPHONE = 1; - - // Speech was recorded using a personal computer or tablet. - PC = 2; - - // Speech was recorded over a phone line. - PHONE_LINE = 3; - - // Speech was recorded in a vehicle. - VEHICLE = 4; - - // Speech was recorded outdoors. - OTHER_OUTDOOR_DEVICE = 5; - - // Speech was recorded indoors. - OTHER_INDOOR_DEVICE = 6; - } - - // The use case most closely describing the audio content to be recognized. - InteractionType interaction_type = 1; - - // The industry vertical to which this speech recognition request most - // closely applies. This is most indicative of the topics contained - // in the audio. Use the 6-digit NAICS code to identify the industry - // vertical - see https://www.naics.com/search/. - uint32 industry_naics_code_of_audio = 3; - - // The audio type that most closely describes the audio being recognized. - MicrophoneDistance microphone_distance = 4; - - // The original media the speech was recorded on. - OriginalMediaType original_media_type = 5; - - // The type of device the speech was recorded with. - RecordingDeviceType recording_device_type = 6; - - // The device used to make the recording. Examples 'Nexus 5X' or - // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or - // 'Cardioid Microphone'. - string recording_device_name = 7; - - // Mime type of the original audio file. For example `audio/m4a`, - // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. - // A list of possible audio mime types is maintained at - // http://www.iana.org/assignments/media-types/media-types.xhtml#audio - string original_mime_type = 8; - - // Description of the content. Eg. "Recordings of federal supreme court - // hearings from 2012". - string audio_topic = 10; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message SpeechContext { - // A list of strings containing words and phrases "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - // - // List items can also be set to classes for groups of words that represent - // common concepts that occur in natural language. For example, rather than - // providing phrase hints for every month of the year, using the $MONTH class - // improves the likelihood of correctly transcribing audio that includes - // months. - repeated string phrases = 1; - - // Hint Boost. Positive value will increase the probability that a specific - // phrase will be recognized over other similar sounding phrases. The higher - // the boost, the higher the chance of false positive recognition as well. - // Negative boost values would correspond to anti-biasing. Anti-biasing is not - // enabled, so negative boost will simply be ignored. Though `boost` can - // accept a wide range of positive values, most use cases are best served with - // values between 0 and 20. We recommend using a binary search approach to - // finding the optimal value for your use case. - float boost = 4; -} - -// Contains audio data in the encoding specified in the `RecognitionConfig`. -// Either `content` or `uri` must be supplied. Supplying both or neither -// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See -// [content limits](https://cloud.google.com/speech-to-text/quotas#content). -message RecognitionAudio { - // The audio source, which is either inline content or a Google Cloud - // Storage uri. - oneof audio_source { - // The audio data bytes encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - // pure binary representation, whereas JSON representations use base64. - bytes content = 1; - - // URI that points to a file that contains audio data bytes as specified in - // `RecognitionConfig`. The file must not be compressed (for example, gzip). - // Currently, only Google Cloud Storage URIs are - // supported, which must be specified in the following format: - // `gs://bucket_name/object_name` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see - // [Request URIs](https://cloud.google.com/storage/docs/reference-uris). - string uri = 2; - } -} - -// The only message returned to the client by the `Recognize` method. It -// contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. -message RecognizeResponse { - // Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; - - // When available, billed audio seconds for the corresponding request. - google.protobuf.Duration total_billed_time = 3; -} - -// The only message returned to the client by the `LongRunningRecognize` method. -// It contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. It is included in the `result.response` field of the `Operation` -// returned by the `GetOperation` call of the `google::longrunning::Operations` -// service. -message LongRunningRecognizeResponse { - // Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; - - // When available, billed audio seconds for the corresponding request. - google.protobuf.Duration total_billed_time = 3; - - // Original output config if present in the request. - TranscriptOutputConfig output_config = 6; - - // If the transcript output fails this field contains the relevant error. - google.rpc.Status output_error = 7; -} - -// Describes the progress of a long-running `LongRunningRecognize` call. It is -// included in the `metadata` field of the `Operation` returned by the -// `GetOperation` call of the `google::longrunning::Operations` service. -message LongRunningRecognizeMetadata { - // Approximate percentage of audio processed thus far. Guaranteed to be 100 - // when the audio is fully processed and the results are available. - int32 progress_percent = 1; - - // Time when the request was received. - google.protobuf.Timestamp start_time = 2; - - // Time of the most recent processing update. - google.protobuf.Timestamp last_update_time = 3; - - // Output only. The URI of the audio file being transcribed. Empty if the audio was sent - // as byte content. - string uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// `StreamingRecognizeResponse` is the only message returned to the client by -// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` -// messages are streamed back to the client. If there is no recognizable -// audio, and `single_utterance` is set to false, then no messages are streamed -// back to the client. -// -// Here's an example of a series of `StreamingRecognizeResponse`s that might be -// returned while processing audio: -// -// 1. results { alternatives { transcript: "tube" } stability: 0.01 } -// -// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } -// -// 3. results { alternatives { transcript: "to be" } stability: 0.9 } -// results { alternatives { transcript: " or not to be" } stability: 0.01 } -// -// 4. results { alternatives { transcript: "to be or not to be" -// confidence: 0.92 } -// alternatives { transcript: "to bee or not to bee" } -// is_final: true } -// -// 5. results { alternatives { transcript: " that's" } stability: 0.01 } -// -// 6. results { alternatives { transcript: " that is" } stability: 0.9 } -// results { alternatives { transcript: " the question" } stability: 0.01 } -// -// 7. results { alternatives { transcript: " that is the question" -// confidence: 0.98 } -// alternatives { transcript: " that was the question" } -// is_final: true } -// -// Notes: -// -// - Only two of the above responses #4 and #7 contain final results; they are -// indicated by `is_final: true`. Concatenating these together generates the -// full transcript: "to be or not to be that is the question". -// -// - The others contain interim `results`. #3 and #6 contain two interim -// `results`: the first portion has a high stability and is less likely to -// change; the second portion has a low stability and is very likely to -// change. A UI designer might choose to show only high stability `results`. -// -// - The specific `stability` and `confidence` values shown above are only for -// illustrative purposes. Actual values may vary. -// -// - In each response, only one of these fields will be set: -// `error`, -// `speech_event_type`, or -// one or more (repeated) `results`. -message StreamingRecognizeResponse { - // Indicates the type of speech event. - enum SpeechEventType { - // No speech event specified. - SPEECH_EVENT_UNSPECIFIED = 0; - - // This event indicates that the server has detected the end of the user's - // speech utterance and expects no additional speech. Therefore, the server - // will not process additional audio (although it may subsequently return - // additional results). The client should stop sending additional audio - // data, half-close the gRPC connection, and wait for any additional results - // until the server closes the gRPC connection. This event is only sent if - // `single_utterance` was set to `true`, and is not used otherwise. - END_OF_SINGLE_UTTERANCE = 1; - } - - // If set, returns a [google.rpc.Status][google.rpc.Status] message that - // specifies the error for the operation. - google.rpc.Status error = 1; - - // This repeated list contains zero or more results that - // correspond to consecutive portions of the audio currently being processed. - // It contains zero or one `is_final=true` result (the newly settled portion), - // followed by zero or more `is_final=false` results (the interim results). - repeated StreamingRecognitionResult results = 2; - - // Indicates the type of speech event. - SpeechEventType speech_event_type = 4; - - // When available, billed audio seconds for the stream. - // Set only if this is the last response in the stream. - google.protobuf.Duration total_billed_time = 5; -} - -// A streaming speech recognition result corresponding to a portion of the audio -// that is currently being processed. -message StreamingRecognitionResult { - // May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // If `false`, this `StreamingRecognitionResult` represents an - // interim result that may change. If `true`, this is the final time the - // speech service will return this particular `StreamingRecognitionResult`, - // the recognizer will not return any further hypotheses for this portion of - // the transcript and corresponding audio. - bool is_final = 2; - - // An estimate of the likelihood that the recognizer will not - // change its guess about this interim result. Values range from 0.0 - // (completely unstable) to 1.0 (completely stable). - // This field is only provided for interim results (`is_final=false`). - // The default of 0.0 is a sentinel value indicating `stability` was not set. - float stability = 3; - - // Time offset of the end of this result relative to the - // beginning of the audio. - google.protobuf.Duration result_end_time = 4; - - // For multi-channel audio, this is the channel number corresponding to the - // recognized result for the audio from that channel. - // For audio_channel_count = N, its output values can range from '1' to 'N'. - int32 channel_tag = 5; - - // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag - // of the language in this result. This language code was detected to have - // the most likelihood of being spoken in the audio. - string language_code = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A speech recognition result corresponding to a portion of the audio. -message SpeechRecognitionResult { - // May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // For multi-channel audio, this is the channel number corresponding to the - // recognized result for the audio from that channel. - // For audio_channel_count = N, its output values can range from '1' to 'N'. - int32 channel_tag = 2; - - // Time offset of the end of this result relative to the - // beginning of the audio. - google.protobuf.Duration result_end_time = 4; - - // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag - // of the language in this result. This language code was detected to have - // the most likelihood of being spoken in the audio. - string language_code = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Alternative hypotheses (a.k.a. n-best list). -message SpeechRecognitionAlternative { - // Transcript text representing the words that the user spoke. - // In languages that use spaces to separate words, the transcript might have a - // leading space if it isn't the first result. You can concatenate each result - // to obtain the full transcript without using a separator. - string transcript = 1; - - // The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative of a non-streaming - // result or, of a streaming result where `is_final=true`. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 2; - - // A list of word-specific information for each recognized word. - // Note: When `enable_speaker_diarization` is true, you will see all the words - // from the beginning of the audio. - repeated WordInfo words = 3; -} - -// Word-specific information for recognized words. -message WordInfo { - // Time offset relative to the beginning of the audio, - // and corresponding to the start of the spoken word. - // This field is only set if `enable_word_time_offsets=true` and only - // in the top hypothesis. - // This is an experimental feature and the accuracy of the time offset can - // vary. - google.protobuf.Duration start_time = 1; - - // Time offset relative to the beginning of the audio, - // and corresponding to the end of the spoken word. - // This field is only set if `enable_word_time_offsets=true` and only - // in the top hypothesis. - // This is an experimental feature and the accuracy of the time offset can - // vary. - google.protobuf.Duration end_time = 2; - - // The word corresponding to this set of information. - string word = 3; - - // The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative of a non-streaming - // result or, of a streaming result where `is_final=true`. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 4; - - // Output only. A distinct integer value is assigned for every speaker within - // the audio. This field specifies which one of those speakers was detected to - // have spoken this word. Value ranges from '1' to diarization_speaker_count. - // speaker_tag is set if enable_speaker_diarization = 'true' and only in the - // top alternative. - int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech_adaptation.proto b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech_adaptation.proto deleted file mode 100644 index b0d60ab4a1dd..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/cloud_speech_adaptation.proto +++ /dev/null @@ -1,370 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.speech.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/speech/v1/resource.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1;speech"; -option java_multiple_files = true; -option java_outer_classname = "SpeechAdaptationProto"; -option java_package = "com.google.cloud.speech.v1"; -option objc_class_prefix = "GCS"; - -// Service that implements Google Cloud Speech Adaptation API. -service Adaptation { - option (google.api.default_host) = "speech.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Create a set of phrase hints. Each item in the set can be a single word or - // a multi-word phrase. The items in the PhraseSet are favored by the - // recognition model when you send a call that includes the PhraseSet. - rpc CreatePhraseSet(CreatePhraseSetRequest) returns (PhraseSet) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/phraseSets" - body: "*" - }; - option (google.api.method_signature) = "parent,phrase_set,phrase_set_id"; - } - - // Get a phrase set. - rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/phraseSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List phrase sets. - rpc ListPhraseSet(ListPhraseSetRequest) returns (ListPhraseSetResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/phraseSets" - }; - option (google.api.method_signature) = "parent"; - } - - // Update a phrase set. - rpc UpdatePhraseSet(UpdatePhraseSetRequest) returns (PhraseSet) { - option (google.api.http) = { - patch: "/v1/{phrase_set.name=projects/*/locations/*/phraseSets/*}" - body: "phrase_set" - }; - option (google.api.method_signature) = "phrase_set,update_mask"; - } - - // Delete a phrase set. - rpc DeletePhraseSet(DeletePhraseSetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/phraseSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Create a custom class. - rpc CreateCustomClass(CreateCustomClassRequest) returns (CustomClass) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/customClasses" - body: "*" - }; - option (google.api.method_signature) = "parent,custom_class,custom_class_id"; - } - - // Get a custom class. - rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/customClasses/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List custom classes. - rpc ListCustomClasses(ListCustomClassesRequest) returns (ListCustomClassesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/customClasses" - }; - option (google.api.method_signature) = "parent"; - } - - // Update a custom class. - rpc UpdateCustomClass(UpdateCustomClassRequest) returns (CustomClass) { - option (google.api.http) = { - patch: "/v1/{custom_class.name=projects/*/locations/*/customClasses/*}" - body: "custom_class" - }; - option (google.api.method_signature) = "custom_class,update_mask"; - } - - // Delete a custom class. - rpc DeleteCustomClass(DeleteCustomClassRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/customClasses/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// Message sent by the client for the `CreatePhraseSet` method. -message CreatePhraseSetRequest { - // Required. The parent resource where this phrase set will be created. Format: - // - // `projects/{project}/locations/{location}/phraseSets` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "speech.googleapis.com/PhraseSet" - } - ]; - - // Required. The ID to use for the phrase set, which will become the final - // component of the phrase set's resource name. - // - // This value should restrict to letters, numbers, and hyphens, with the first - // character a letter, the last a letter or a number, and be 4-63 characters. - string phrase_set_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The phrase set to create. - PhraseSet phrase_set = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Message sent by the client for the `UpdatePhraseSet` method. -message UpdatePhraseSetRequest { - // Required. The phrase set to update. - // - // The phrase set's `name` field is used to identify the set to be - // updated. Format: - // - // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// Message sent by the client for the `GetPhraseSet` method. -message GetPhraseSetRequest { - // Required. The name of the phrase set to retrieve. Format: - // - // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "speech.googleapis.com/PhraseSet" - } - ]; -} - -// Message sent by the client for the `ListPhraseSet` method. -message ListPhraseSetRequest { - // Required. The parent, which owns this collection of phrase set. Format: - // - // `projects/{project}/locations/{location}` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "speech.googleapis.com/PhraseSet" - } - ]; - - // The maximum number of phrase sets to return. The service may return - // fewer than this value. If unspecified, at most 50 phrase sets will be - // returned. The maximum value is 1000; values above 1000 will be coerced to - // 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListPhraseSet` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListPhraseSet` must - // match the call that provided the page token. - string page_token = 3; -} - -// Message returned to the client by the `ListPhraseSet` method. -message ListPhraseSetResponse { - // The phrase set. - repeated PhraseSet phrase_sets = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Message sent by the client for the `DeletePhraseSet` method. -message DeletePhraseSetRequest { - // Required. The name of the phrase set to delete. Format: - // - // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "speech.googleapis.com/PhraseSet" - } - ]; -} - -// Message sent by the client for the `CreateCustomClass` method. -message CreateCustomClassRequest { - // Required. The parent resource where this custom class will be created. Format: - // - // `projects/{project}/locations/{location}/customClasses` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "speech.googleapis.com/CustomClass" - } - ]; - - // Required. The ID to use for the custom class, which will become the final - // component of the custom class' resource name. - // - // This value should restrict to letters, numbers, and hyphens, with the first - // character a letter, the last a letter or a number, and be 4-63 characters. - string custom_class_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The custom class to create. - CustomClass custom_class = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Message sent by the client for the `UpdateCustomClass` method. -message UpdateCustomClassRequest { - // Required. The custom class to update. - // - // The custom class's `name` field is used to identify the custom class to be - // updated. Format: - // - // `projects/{project}/locations/{location}/customClasses/{custom_class}` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// Message sent by the client for the `GetCustomClass` method. -message GetCustomClassRequest { - // Required. The name of the custom class to retrieve. Format: - // - // `projects/{project}/locations/{location}/customClasses/{custom_class}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "speech.googleapis.com/CustomClass" - } - ]; -} - -// Message sent by the client for the `ListCustomClasses` method. -message ListCustomClassesRequest { - // Required. The parent, which owns this collection of custom classes. Format: - // - // `projects/{project}/locations/{location}/customClasses` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "speech.googleapis.com/CustomClass" - } - ]; - - // The maximum number of custom classes to return. The service may return - // fewer than this value. If unspecified, at most 50 custom classes will be - // returned. The maximum value is 1000; values above 1000 will be coerced to - // 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListCustomClass` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListCustomClass` must - // match the call that provided the page token. - string page_token = 3; -} - -// Message returned to the client by the `ListCustomClasses` method. -message ListCustomClassesResponse { - // The custom classes. - repeated CustomClass custom_classes = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Message sent by the client for the `DeleteCustomClass` method. -message DeleteCustomClassRequest { - // Required. The name of the custom class to delete. Format: - // - // `projects/{project}/locations/{location}/customClasses/{custom_class}` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "speech.googleapis.com/CustomClass" - } - ]; -} diff --git a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/resource.proto b/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/resource.proto deleted file mode 100644 index 0ae5caa9e9ff..000000000000 --- a/owl-bot-staging/java-speech/v1/proto-google-cloud-speech-v1/src/main/proto/google/cloud/speech/v1/resource.proto +++ /dev/null @@ -1,138 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.speech.v1; - -import "google/api/resource.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1;speech"; -option java_multiple_files = true; -option java_outer_classname = "SpeechResourceProto"; -option java_package = "com.google.cloud.speech.v1"; -option objc_class_prefix = "GCS"; - -// A set of words or phrases that represents a common concept likely to appear -// in your audio, for example a list of passenger ship names. CustomClass items -// can be substituted into placeholders that you set in PhraseSet phrases. -message CustomClass { - option (google.api.resource) = { - type: "speech.googleapis.com/CustomClass" - pattern: "projects/{project}/locations/{location}/customClasses/{custom_class}" - }; - - // An item of the class. - message ClassItem { - // The class item's value. - string value = 1; - } - - // The resource name of the custom class. - string name = 1; - - // If this custom class is a resource, the custom_class_id is the resource id - // of the CustomClass. Case sensitive. - string custom_class_id = 2; - - // A collection of class items. - repeated ClassItem items = 3; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message PhraseSet { - option (google.api.resource) = { - type: "speech.googleapis.com/PhraseSet" - pattern: "projects/{project}/locations/{location}/phraseSets/{phrase_set}" - }; - - // A phrases containing words and phrase "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - // - // List items can also include pre-built or custom classes containing groups - // of words that represent common concepts that occur in natural language. For - // example, rather than providing a phrase hint for every month of the - // year (e.g. "i was born in january", "i was born in febuary", ...), use the - // pre-built `$MONTH` class improves the likelihood of correctly transcribing - // audio that includes months (e.g. "i was born in $month"). - // To refer to pre-built classes, use the class' symbol prepended with `$` - // e.g. `$MONTH`. To refer to custom classes that were defined inline in the - // request, set the class's `custom_class_id` to a string unique to all class - // resources and inline classes. Then use the class' id wrapped in $`{...}` - // e.g. "${my-months}". To refer to custom classes resources, use the class' - // id wrapped in `${}` (e.g. `${my-months}`). - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or - // `eu` location value. - message Phrase { - // The phrase itself. - string value = 1; - - // Hint Boost. Overrides the boost set at the phrase set level. - // Positive value will increase the probability that a specific phrase will - // be recognized over other similar sounding phrases. The higher the boost, - // the higher the chance of false positive recognition as well. Negative - // boost will simply be ignored. Though `boost` can accept a wide range of - // positive values, most use cases are best served - // with values between 0 and 20. We recommend using a binary search approach - // to finding the optimal value for your use case. Speech recognition - // will skip PhraseSets with a boost value of 0. - float boost = 2; - } - - // The resource name of the phrase set. - string name = 1; - - // A list of word and phrases. - repeated Phrase phrases = 2; - - // Hint Boost. Positive value will increase the probability that a specific - // phrase will be recognized over other similar sounding phrases. The higher - // the boost, the higher the chance of false positive recognition as well. - // Negative boost values would correspond to anti-biasing. Anti-biasing is not - // enabled, so negative boost will simply be ignored. Though `boost` can - // accept a wide range of positive values, most use cases are best served with - // values between 0 (exclusive) and 20. We recommend using a binary search - // approach to finding the optimal value for your use case. Speech recognition - // will skip PhraseSets with a boost value of 0. - float boost = 4; -} - -// Speech adaptation configuration. -message SpeechAdaptation { - // A collection of phrase sets. To specify the hints inline, leave the - // phrase set's `name` blank and fill in the rest of its fields. Any - // phrase set can use any custom class. - repeated PhraseSet phrase_sets = 1; - - // A collection of phrase set resource names to use. - repeated string phrase_set_references = 2 [(google.api.resource_reference) = { - type: "speech.googleapis.com/PhraseSet" - }]; - - // A collection of custom classes. To specify the classes inline, leave the - // class' `name` blank and fill in the rest of its fields, giving it a unique - // `custom_class_id`. Refer to the inline defined class in phrase hints by its - // `custom_class_id`. - repeated CustomClass custom_classes = 3; -} diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index b2bcdf720b7f..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_create_setcredentialsprovider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.AdaptationSettings; -import com.google.cloud.speech.v1.myCredentials; - -public class SyncCreateSetCredentialsProvider { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider(); - } - - public static void syncCreateSetCredentialsProvider() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - AdaptationSettings adaptationSettings = - AdaptationSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings); - } -} -// [END speech_v1_generated_adaptationclient_create_setcredentialsprovider_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index 1bab8005d019..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_create_setcredentialsprovider1_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.AdaptationSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - AdaptationSettings adaptationSettings = - AdaptationSettings.newBuilder() - .setTransportChannelProvider( - AdaptationSettings.defaultHttpJsonTransportProviderBuilder().build()) - .build(); - AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings); - } -} -// [END speech_v1_generated_adaptationclient_create_setcredentialsprovider1_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetEndpoint.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetEndpoint.java deleted file mode 100644 index bd27d2fcec3c..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_create_setendpoint_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.AdaptationSettings; -import com.google.cloud.speech.v1.myEndpoint; - -public class SyncCreateSetEndpoint { - - public static void main(String[] args) throws Exception { - syncCreateSetEndpoint(); - } - - public static void syncCreateSetEndpoint() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - AdaptationSettings adaptationSettings = - AdaptationSettings.newBuilder().setEndpoint(myEndpoint).build(); - AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings); - } -} -// [END speech_v1_generated_adaptationclient_create_setendpoint_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java deleted file mode 100644 index 40bd825d213d..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_createcustomclass_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CreateCustomClassRequest; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.LocationName; - -public class AsyncCreateCustomClass { - - public static void main(String[] args) throws Exception { - asyncCreateCustomClass(); - } - - public static void asyncCreateCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CreateCustomClassRequest request = - CreateCustomClassRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setCustomClassId("customClassId1871032322") - .setCustomClass(CustomClass.newBuilder().build()) - .build(); - ApiFuture future = - adaptationClient.createCustomClassCallable().futureCall(request); - // Do something. - CustomClass response = future.get(); - } - } -} -// [END speech_v1_generated_adaptationclient_createcustomclass_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClass.java deleted file mode 100644 index 3d8f3f2c0f31..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClass.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_createcustomclass_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CreateCustomClassRequest; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.LocationName; - -public class SyncCreateCustomClass { - - public static void main(String[] args) throws Exception { - syncCreateCustomClass(); - } - - public static void syncCreateCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CreateCustomClassRequest request = - CreateCustomClassRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setCustomClassId("customClassId1871032322") - .setCustomClass(CustomClass.newBuilder().build()) - .build(); - CustomClass response = adaptationClient.createCustomClass(request); - } - } -} -// [END speech_v1_generated_adaptationclient_createcustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java deleted file mode 100644 index 2203cbf4e00f..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_createcustomclass_locationnamecustomclassstring_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.LocationName; - -public class SyncCreateCustomClassLocationnameCustomclassString { - - public static void main(String[] args) throws Exception { - syncCreateCustomClassLocationnameCustomclassString(); - } - - public static void syncCreateCustomClassLocationnameCustomclassString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId); - } - } -} -// [END speech_v1_generated_adaptationclient_createcustomclass_locationnamecustomclassstring_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java deleted file mode 100644 index 4ba5f80f6f6d..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_createcustomclass_stringcustomclassstring_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.LocationName; - -public class SyncCreateCustomClassStringCustomclassString { - - public static void main(String[] args) throws Exception { - syncCreateCustomClassStringCustomclassString(); - } - - public static void syncCreateCustomClassStringCustomclassString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId); - } - } -} -// [END speech_v1_generated_adaptationclient_createcustomclass_stringcustomclassstring_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java deleted file mode 100644 index 52d59f186ef3..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_createphraseset_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CreatePhraseSetRequest; -import com.google.cloud.speech.v1.LocationName; -import com.google.cloud.speech.v1.PhraseSet; - -public class AsyncCreatePhraseSet { - - public static void main(String[] args) throws Exception { - asyncCreatePhraseSet(); - } - - public static void asyncCreatePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CreatePhraseSetRequest request = - CreatePhraseSetRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPhraseSetId("phraseSetId959902180") - .setPhraseSet(PhraseSet.newBuilder().build()) - .build(); - ApiFuture future = adaptationClient.createPhraseSetCallable().futureCall(request); - // Do something. - PhraseSet response = future.get(); - } - } -} -// [END speech_v1_generated_adaptationclient_createphraseset_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSet.java deleted file mode 100644 index 6512403a09dd..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSet.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_createphraseset_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CreatePhraseSetRequest; -import com.google.cloud.speech.v1.LocationName; -import com.google.cloud.speech.v1.PhraseSet; - -public class SyncCreatePhraseSet { - - public static void main(String[] args) throws Exception { - syncCreatePhraseSet(); - } - - public static void syncCreatePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CreatePhraseSetRequest request = - CreatePhraseSetRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPhraseSetId("phraseSetId959902180") - .setPhraseSet(PhraseSet.newBuilder().build()) - .build(); - PhraseSet response = adaptationClient.createPhraseSet(request); - } - } -} -// [END speech_v1_generated_adaptationclient_createphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java deleted file mode 100644 index 8cbc5627275c..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_createphraseset_locationnamephrasesetstring_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.LocationName; -import com.google.cloud.speech.v1.PhraseSet; - -public class SyncCreatePhraseSetLocationnamePhrasesetString { - - public static void main(String[] args) throws Exception { - syncCreatePhraseSetLocationnamePhrasesetString(); - } - - public static void syncCreatePhraseSetLocationnamePhrasesetString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId); - } - } -} -// [END speech_v1_generated_adaptationclient_createphraseset_locationnamephrasesetstring_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java deleted file mode 100644 index ca700e324514..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_createphraseset_stringphrasesetstring_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.LocationName; -import com.google.cloud.speech.v1.PhraseSet; - -public class SyncCreatePhraseSetStringPhrasesetString { - - public static void main(String[] args) throws Exception { - syncCreatePhraseSetStringPhrasesetString(); - } - - public static void syncCreatePhraseSetStringPhrasesetString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId); - } - } -} -// [END speech_v1_generated_adaptationclient_createphraseset_stringphrasesetstring_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java deleted file mode 100644 index 0d0fd62e6a07..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_deletecustomclass_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClassName; -import com.google.cloud.speech.v1.DeleteCustomClassRequest; -import com.google.protobuf.Empty; - -public class AsyncDeleteCustomClass { - - public static void main(String[] args) throws Exception { - asyncDeleteCustomClass(); - } - - public static void asyncDeleteCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - DeleteCustomClassRequest request = - DeleteCustomClassRequest.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .build(); - ApiFuture future = adaptationClient.deleteCustomClassCallable().futureCall(request); - // Do something. - future.get(); - } - } -} -// [END speech_v1_generated_adaptationclient_deletecustomclass_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java deleted file mode 100644 index 86e20619366a..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_deletecustomclass_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClassName; -import com.google.cloud.speech.v1.DeleteCustomClassRequest; -import com.google.protobuf.Empty; - -public class SyncDeleteCustomClass { - - public static void main(String[] args) throws Exception { - syncDeleteCustomClass(); - } - - public static void syncDeleteCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - DeleteCustomClassRequest request = - DeleteCustomClassRequest.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .build(); - adaptationClient.deleteCustomClass(request); - } - } -} -// [END speech_v1_generated_adaptationclient_deletecustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java deleted file mode 100644 index a40dfb49e8ce..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_deletecustomclass_customclassname_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClassName; -import com.google.protobuf.Empty; - -public class SyncDeleteCustomClassCustomclassname { - - public static void main(String[] args) throws Exception { - syncDeleteCustomClassCustomclassname(); - } - - public static void syncDeleteCustomClassCustomclassname() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - adaptationClient.deleteCustomClass(name); - } - } -} -// [END speech_v1_generated_adaptationclient_deletecustomclass_customclassname_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java deleted file mode 100644 index 784c891bc532..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_deletecustomclass_string_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClassName; -import com.google.protobuf.Empty; - -public class SyncDeleteCustomClassString { - - public static void main(String[] args) throws Exception { - syncDeleteCustomClassString(); - } - - public static void syncDeleteCustomClassString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString(); - adaptationClient.deleteCustomClass(name); - } - } -} -// [END speech_v1_generated_adaptationclient_deletecustomclass_string_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java deleted file mode 100644 index a78c39816344..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_deletephraseset_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.DeletePhraseSetRequest; -import com.google.cloud.speech.v1.PhraseSetName; -import com.google.protobuf.Empty; - -public class AsyncDeletePhraseSet { - - public static void main(String[] args) throws Exception { - asyncDeletePhraseSet(); - } - - public static void asyncDeletePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - DeletePhraseSetRequest request = - DeletePhraseSetRequest.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .build(); - ApiFuture future = adaptationClient.deletePhraseSetCallable().futureCall(request); - // Do something. - future.get(); - } - } -} -// [END speech_v1_generated_adaptationclient_deletephraseset_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java deleted file mode 100644 index 367673ef3c2b..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_deletephraseset_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.DeletePhraseSetRequest; -import com.google.cloud.speech.v1.PhraseSetName; -import com.google.protobuf.Empty; - -public class SyncDeletePhraseSet { - - public static void main(String[] args) throws Exception { - syncDeletePhraseSet(); - } - - public static void syncDeletePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - DeletePhraseSetRequest request = - DeletePhraseSetRequest.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .build(); - adaptationClient.deletePhraseSet(request); - } - } -} -// [END speech_v1_generated_adaptationclient_deletephraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java deleted file mode 100644 index c3c1427d133d..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_deletephraseset_phrasesetname_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.PhraseSetName; -import com.google.protobuf.Empty; - -public class SyncDeletePhraseSetPhrasesetname { - - public static void main(String[] args) throws Exception { - syncDeletePhraseSetPhrasesetname(); - } - - public static void syncDeletePhraseSetPhrasesetname() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - adaptationClient.deletePhraseSet(name); - } - } -} -// [END speech_v1_generated_adaptationclient_deletephraseset_phrasesetname_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java deleted file mode 100644 index bf8bb5a391a5..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_deletephraseset_string_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.PhraseSetName; -import com.google.protobuf.Empty; - -public class SyncDeletePhraseSetString { - - public static void main(String[] args) throws Exception { - syncDeletePhraseSetString(); - } - - public static void syncDeletePhraseSetString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString(); - adaptationClient.deletePhraseSet(name); - } - } -} -// [END speech_v1_generated_adaptationclient_deletephraseset_string_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/AsyncGetCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/AsyncGetCustomClass.java deleted file mode 100644 index cd328b12ee82..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/AsyncGetCustomClass.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_getcustomclass_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.CustomClassName; -import com.google.cloud.speech.v1.GetCustomClassRequest; - -public class AsyncGetCustomClass { - - public static void main(String[] args) throws Exception { - asyncGetCustomClass(); - } - - public static void asyncGetCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - GetCustomClassRequest request = - GetCustomClassRequest.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .build(); - ApiFuture future = adaptationClient.getCustomClassCallable().futureCall(request); - // Do something. - CustomClass response = future.get(); - } - } -} -// [END speech_v1_generated_adaptationclient_getcustomclass_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClass.java deleted file mode 100644 index 191aa960d608..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClass.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_getcustomclass_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.CustomClassName; -import com.google.cloud.speech.v1.GetCustomClassRequest; - -public class SyncGetCustomClass { - - public static void main(String[] args) throws Exception { - syncGetCustomClass(); - } - - public static void syncGetCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - GetCustomClassRequest request = - GetCustomClassRequest.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .build(); - CustomClass response = adaptationClient.getCustomClass(request); - } - } -} -// [END speech_v1_generated_adaptationclient_getcustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java deleted file mode 100644 index a233a5292c83..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_getcustomclass_customclassname_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.CustomClassName; - -public class SyncGetCustomClassCustomclassname { - - public static void main(String[] args) throws Exception { - syncGetCustomClassCustomclassname(); - } - - public static void syncGetCustomClassCustomclassname() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - CustomClass response = adaptationClient.getCustomClass(name); - } - } -} -// [END speech_v1_generated_adaptationclient_getcustomclass_customclassname_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassString.java deleted file mode 100644 index 47c1cd4352f9..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getcustomclass/SyncGetCustomClassString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_getcustomclass_string_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.CustomClassName; - -public class SyncGetCustomClassString { - - public static void main(String[] args) throws Exception { - syncGetCustomClassString(); - } - - public static void syncGetCustomClassString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString(); - CustomClass response = adaptationClient.getCustomClass(name); - } - } -} -// [END speech_v1_generated_adaptationclient_getcustomclass_string_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/AsyncGetPhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/AsyncGetPhraseSet.java deleted file mode 100644 index 20bfd9e54da1..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/AsyncGetPhraseSet.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_getphraseset_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.GetPhraseSetRequest; -import com.google.cloud.speech.v1.PhraseSet; -import com.google.cloud.speech.v1.PhraseSetName; - -public class AsyncGetPhraseSet { - - public static void main(String[] args) throws Exception { - asyncGetPhraseSet(); - } - - public static void asyncGetPhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - GetPhraseSetRequest request = - GetPhraseSetRequest.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .build(); - ApiFuture future = adaptationClient.getPhraseSetCallable().futureCall(request); - // Do something. - PhraseSet response = future.get(); - } - } -} -// [END speech_v1_generated_adaptationclient_getphraseset_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSet.java deleted file mode 100644 index 9399c9f20d73..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSet.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_getphraseset_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.GetPhraseSetRequest; -import com.google.cloud.speech.v1.PhraseSet; -import com.google.cloud.speech.v1.PhraseSetName; - -public class SyncGetPhraseSet { - - public static void main(String[] args) throws Exception { - syncGetPhraseSet(); - } - - public static void syncGetPhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - GetPhraseSetRequest request = - GetPhraseSetRequest.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .build(); - PhraseSet response = adaptationClient.getPhraseSet(request); - } - } -} -// [END speech_v1_generated_adaptationclient_getphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java deleted file mode 100644 index eb9726fb2052..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_getphraseset_phrasesetname_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.PhraseSet; -import com.google.cloud.speech.v1.PhraseSetName; - -public class SyncGetPhraseSetPhrasesetname { - - public static void main(String[] args) throws Exception { - syncGetPhraseSetPhrasesetname(); - } - - public static void syncGetPhraseSetPhrasesetname() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - PhraseSet response = adaptationClient.getPhraseSet(name); - } - } -} -// [END speech_v1_generated_adaptationclient_getphraseset_phrasesetname_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetString.java deleted file mode 100644 index 67068562983b..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/getphraseset/SyncGetPhraseSetString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_getphraseset_string_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.PhraseSet; -import com.google.cloud.speech.v1.PhraseSetName; - -public class SyncGetPhraseSetString { - - public static void main(String[] args) throws Exception { - syncGetPhraseSetString(); - } - - public static void syncGetPhraseSetString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString(); - PhraseSet response = adaptationClient.getPhraseSet(name); - } - } -} -// [END speech_v1_generated_adaptationclient_getphraseset_string_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java deleted file mode 100644 index 8fd934090797..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_listcustomclasses_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.ListCustomClassesRequest; -import com.google.cloud.speech.v1.LocationName; - -public class AsyncListCustomClasses { - - public static void main(String[] args) throws Exception { - asyncListCustomClasses(); - } - - public static void asyncListCustomClasses() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - ListCustomClassesRequest request = - ListCustomClassesRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - ApiFuture future = - adaptationClient.listCustomClassesPagedCallable().futureCall(request); - // Do something. - for (CustomClass element : future.get().iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1_generated_adaptationclient_listcustomclasses_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java deleted file mode 100644 index 34e934e7a73c..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_listcustomclasses_paged_async] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.ListCustomClassesRequest; -import com.google.cloud.speech.v1.ListCustomClassesResponse; -import com.google.cloud.speech.v1.LocationName; -import com.google.common.base.Strings; - -public class AsyncListCustomClassesPaged { - - public static void main(String[] args) throws Exception { - asyncListCustomClassesPaged(); - } - - public static void asyncListCustomClassesPaged() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - ListCustomClassesRequest request = - ListCustomClassesRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - while (true) { - ListCustomClassesResponse response = - adaptationClient.listCustomClassesCallable().call(request); - for (CustomClass element : response.getCustomClassesList()) { - // doThingsWith(element); - } - String nextPageToken = response.getNextPageToken(); - if (!Strings.isNullOrEmpty(nextPageToken)) { - request = request.toBuilder().setPageToken(nextPageToken).build(); - } else { - break; - } - } - } - } -} -// [END speech_v1_generated_adaptationclient_listcustomclasses_paged_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClasses.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClasses.java deleted file mode 100644 index 09c326f4d220..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClasses.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_listcustomclasses_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.ListCustomClassesRequest; -import com.google.cloud.speech.v1.LocationName; - -public class SyncListCustomClasses { - - public static void main(String[] args) throws Exception { - syncListCustomClasses(); - } - - public static void syncListCustomClasses() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - ListCustomClassesRequest request = - ListCustomClassesRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - for (CustomClass element : adaptationClient.listCustomClasses(request).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1_generated_adaptationclient_listcustomclasses_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java deleted file mode 100644 index 5289bee23bb5..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_listcustomclasses_locationname_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.LocationName; - -public class SyncListCustomClassesLocationname { - - public static void main(String[] args) throws Exception { - syncListCustomClassesLocationname(); - } - - public static void syncListCustomClassesLocationname() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1_generated_adaptationclient_listcustomclasses_locationname_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java deleted file mode 100644 index 42bba433c3dc..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_listcustomclasses_string_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.LocationName; - -public class SyncListCustomClassesString { - - public static void main(String[] args) throws Exception { - syncListCustomClassesString(); - } - - public static void syncListCustomClassesString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1_generated_adaptationclient_listcustomclasses_string_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSet.java deleted file mode 100644 index fe7003398fac..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSet.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_listphraseset_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.ListPhraseSetRequest; -import com.google.cloud.speech.v1.LocationName; -import com.google.cloud.speech.v1.PhraseSet; - -public class AsyncListPhraseSet { - - public static void main(String[] args) throws Exception { - asyncListPhraseSet(); - } - - public static void asyncListPhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - ListPhraseSetRequest request = - ListPhraseSetRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - ApiFuture future = - adaptationClient.listPhraseSetPagedCallable().futureCall(request); - // Do something. - for (PhraseSet element : future.get().iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1_generated_adaptationclient_listphraseset_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java deleted file mode 100644 index e9b49a546e26..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_listphraseset_paged_async] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.ListPhraseSetRequest; -import com.google.cloud.speech.v1.ListPhraseSetResponse; -import com.google.cloud.speech.v1.LocationName; -import com.google.cloud.speech.v1.PhraseSet; -import com.google.common.base.Strings; - -public class AsyncListPhraseSetPaged { - - public static void main(String[] args) throws Exception { - asyncListPhraseSetPaged(); - } - - public static void asyncListPhraseSetPaged() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - ListPhraseSetRequest request = - ListPhraseSetRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - while (true) { - ListPhraseSetResponse response = adaptationClient.listPhraseSetCallable().call(request); - for (PhraseSet element : response.getPhraseSetsList()) { - // doThingsWith(element); - } - String nextPageToken = response.getNextPageToken(); - if (!Strings.isNullOrEmpty(nextPageToken)) { - request = request.toBuilder().setPageToken(nextPageToken).build(); - } else { - break; - } - } - } - } -} -// [END speech_v1_generated_adaptationclient_listphraseset_paged_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSet.java deleted file mode 100644 index aaac2ba57d8b..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSet.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_listphraseset_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.ListPhraseSetRequest; -import com.google.cloud.speech.v1.LocationName; -import com.google.cloud.speech.v1.PhraseSet; - -public class SyncListPhraseSet { - - public static void main(String[] args) throws Exception { - syncListPhraseSet(); - } - - public static void syncListPhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - ListPhraseSetRequest request = - ListPhraseSetRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - for (PhraseSet element : adaptationClient.listPhraseSet(request).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1_generated_adaptationclient_listphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java deleted file mode 100644 index 9948db0c2fa5..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_listphraseset_locationname_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.LocationName; -import com.google.cloud.speech.v1.PhraseSet; - -public class SyncListPhraseSetLocationname { - - public static void main(String[] args) throws Exception { - syncListPhraseSetLocationname(); - } - - public static void syncListPhraseSetLocationname() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1_generated_adaptationclient_listphraseset_locationname_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetString.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetString.java deleted file mode 100644 index abfbf98740be..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/listphraseset/SyncListPhraseSetString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_listphraseset_string_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.LocationName; -import com.google.cloud.speech.v1.PhraseSet; - -public class SyncListPhraseSetString { - - public static void main(String[] args) throws Exception { - syncListPhraseSetString(); - } - - public static void syncListPhraseSetString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1_generated_adaptationclient_listphraseset_string_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java deleted file mode 100644 index 5c89002514c1..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_updatecustomclass_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.UpdateCustomClassRequest; -import com.google.protobuf.FieldMask; - -public class AsyncUpdateCustomClass { - - public static void main(String[] args) throws Exception { - asyncUpdateCustomClass(); - } - - public static void asyncUpdateCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - UpdateCustomClassRequest request = - UpdateCustomClassRequest.newBuilder() - .setCustomClass(CustomClass.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - ApiFuture future = - adaptationClient.updateCustomClassCallable().futureCall(request); - // Do something. - CustomClass response = future.get(); - } - } -} -// [END speech_v1_generated_adaptationclient_updatecustomclass_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java deleted file mode 100644 index a1535b85a5f7..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_updatecustomclass_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.cloud.speech.v1.UpdateCustomClassRequest; -import com.google.protobuf.FieldMask; - -public class SyncUpdateCustomClass { - - public static void main(String[] args) throws Exception { - syncUpdateCustomClass(); - } - - public static void syncUpdateCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - UpdateCustomClassRequest request = - UpdateCustomClassRequest.newBuilder() - .setCustomClass(CustomClass.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - CustomClass response = adaptationClient.updateCustomClass(request); - } - } -} -// [END speech_v1_generated_adaptationclient_updatecustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java deleted file mode 100644 index faa4757595d1..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_updatecustomclass_customclassfieldmask_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.CustomClass; -import com.google.protobuf.FieldMask; - -public class SyncUpdateCustomClassCustomclassFieldmask { - - public static void main(String[] args) throws Exception { - syncUpdateCustomClassCustomclassFieldmask(); - } - - public static void syncUpdateCustomClassCustomclassFieldmask() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CustomClass customClass = CustomClass.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - CustomClass response = adaptationClient.updateCustomClass(customClass, updateMask); - } - } -} -// [END speech_v1_generated_adaptationclient_updatecustomclass_customclassfieldmask_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java deleted file mode 100644 index 1c8c11ab45e9..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_updatephraseset_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.PhraseSet; -import com.google.cloud.speech.v1.UpdatePhraseSetRequest; -import com.google.protobuf.FieldMask; - -public class AsyncUpdatePhraseSet { - - public static void main(String[] args) throws Exception { - asyncUpdatePhraseSet(); - } - - public static void asyncUpdatePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - UpdatePhraseSetRequest request = - UpdatePhraseSetRequest.newBuilder() - .setPhraseSet(PhraseSet.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - ApiFuture future = adaptationClient.updatePhraseSetCallable().futureCall(request); - // Do something. - PhraseSet response = future.get(); - } - } -} -// [END speech_v1_generated_adaptationclient_updatephraseset_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java deleted file mode 100644 index 5a7c4c3357cd..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_updatephraseset_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.PhraseSet; -import com.google.cloud.speech.v1.UpdatePhraseSetRequest; -import com.google.protobuf.FieldMask; - -public class SyncUpdatePhraseSet { - - public static void main(String[] args) throws Exception { - syncUpdatePhraseSet(); - } - - public static void syncUpdatePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - UpdatePhraseSetRequest request = - UpdatePhraseSetRequest.newBuilder() - .setPhraseSet(PhraseSet.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - PhraseSet response = adaptationClient.updatePhraseSet(request); - } - } -} -// [END speech_v1_generated_adaptationclient_updatephraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java deleted file mode 100644 index 939e3c359d0f..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationclient_updatephraseset_phrasesetfieldmask_sync] -import com.google.cloud.speech.v1.AdaptationClient; -import com.google.cloud.speech.v1.PhraseSet; -import com.google.protobuf.FieldMask; - -public class SyncUpdatePhraseSetPhrasesetFieldmask { - - public static void main(String[] args) throws Exception { - syncUpdatePhraseSetPhrasesetFieldmask(); - } - - public static void syncUpdatePhraseSetPhrasesetFieldmask() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - PhraseSet response = adaptationClient.updatePhraseSet(phraseSet, updateMask); - } - } -} -// [END speech_v1_generated_adaptationclient_updatephraseset_phrasesetfieldmask_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java deleted file mode 100644 index af61f9983d36..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_adaptationsettings_createphraseset_sync] -import com.google.cloud.speech.v1.AdaptationSettings; -import java.time.Duration; - -public class SyncCreatePhraseSet { - - public static void main(String[] args) throws Exception { - syncCreatePhraseSet(); - } - - public static void syncCreatePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - AdaptationSettings.Builder adaptationSettingsBuilder = AdaptationSettings.newBuilder(); - adaptationSettingsBuilder - .createPhraseSetSettings() - .setRetrySettings( - adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - AdaptationSettings adaptationSettings = adaptationSettingsBuilder.build(); - } -} -// [END speech_v1_generated_adaptationsettings_createphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index 4d001abc7c00..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_speechclient_create_setcredentialsprovider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechSettings; -import com.google.cloud.speech.v1.myCredentials; - -public class SyncCreateSetCredentialsProvider { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider(); - } - - public static void syncCreateSetCredentialsProvider() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SpeechSettings speechSettings = - SpeechSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - SpeechClient speechClient = SpeechClient.create(speechSettings); - } -} -// [END speech_v1_generated_speechclient_create_setcredentialsprovider_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider1.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index 5057116dfad9..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_speechclient_create_setcredentialsprovider1_sync] -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SpeechSettings speechSettings = - SpeechSettings.newBuilder() - .setTransportChannelProvider( - SpeechSettings.defaultHttpJsonTransportProviderBuilder().build()) - .build(); - SpeechClient speechClient = SpeechClient.create(speechSettings); - } -} -// [END speech_v1_generated_speechclient_create_setcredentialsprovider1_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetEndpoint.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetEndpoint.java deleted file mode 100644 index dffc532af6ee..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_speechclient_create_setendpoint_sync] -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.SpeechSettings; -import com.google.cloud.speech.v1.myEndpoint; - -public class SyncCreateSetEndpoint { - - public static void main(String[] args) throws Exception { - syncCreateSetEndpoint(); - } - - public static void syncCreateSetEndpoint() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build(); - SpeechClient speechClient = SpeechClient.create(speechSettings); - } -} -// [END speech_v1_generated_speechclient_create_setendpoint_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java deleted file mode 100644 index 4674a8bf43b4..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_speechclient_longrunningrecognize_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.TranscriptOutputConfig; -import com.google.longrunning.Operation; - -public class AsyncLongRunningRecognize { - - public static void main(String[] args) throws Exception { - asyncLongRunningRecognize(); - } - - public static void asyncLongRunningRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder() - .setConfig(RecognitionConfig.newBuilder().build()) - .setAudio(RecognitionAudio.newBuilder().build()) - .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) - .build(); - ApiFuture future = speechClient.longRunningRecognizeCallable().futureCall(request); - // Do something. - Operation response = future.get(); - } - } -} -// [END speech_v1_generated_speechclient_longrunningrecognize_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java deleted file mode 100644 index e68f8d9dec30..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_speechclient_longrunningrecognize_lro_async] -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.speech.v1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.TranscriptOutputConfig; - -public class AsyncLongRunningRecognizeLRO { - - public static void main(String[] args) throws Exception { - asyncLongRunningRecognizeLRO(); - } - - public static void asyncLongRunningRecognizeLRO() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder() - .setConfig(RecognitionConfig.newBuilder().build()) - .setAudio(RecognitionAudio.newBuilder().build()) - .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) - .build(); - OperationFuture future = - speechClient.longRunningRecognizeOperationCallable().futureCall(request); - // Do something. - LongRunningRecognizeResponse response = future.get(); - } - } -} -// [END speech_v1_generated_speechclient_longrunningrecognize_lro_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java deleted file mode 100644 index 17f2879d8711..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_speechclient_longrunningrecognize_sync] -import com.google.cloud.speech.v1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.TranscriptOutputConfig; - -public class SyncLongRunningRecognize { - - public static void main(String[] args) throws Exception { - syncLongRunningRecognize(); - } - - public static void syncLongRunningRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder() - .setConfig(RecognitionConfig.newBuilder().build()) - .setAudio(RecognitionAudio.newBuilder().build()) - .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) - .build(); - LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get(); - } - } -} -// [END speech_v1_generated_speechclient_longrunningrecognize_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java deleted file mode 100644 index 04feacdf3446..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_speechclient_longrunningrecognize_recognitionconfigrecognitionaudio_sync] -import com.google.cloud.speech.v1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.SpeechClient; - -public class SyncLongRunningRecognizeRecognitionconfigRecognitionaudio { - - public static void main(String[] args) throws Exception { - syncLongRunningRecognizeRecognitionconfigRecognitionaudio(); - } - - public static void syncLongRunningRecognizeRecognitionconfigRecognitionaudio() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - LongRunningRecognizeResponse response = - speechClient.longRunningRecognizeAsync(config, audio).get(); - } - } -} -// [END speech_v1_generated_speechclient_longrunningrecognize_recognitionconfigrecognitionaudio_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/AsyncRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/AsyncRecognize.java deleted file mode 100644 index b905afd8134c..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/AsyncRecognize.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_speechclient_recognize_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; - -public class AsyncRecognize { - - public static void main(String[] args) throws Exception { - asyncRecognize(); - } - - public static void asyncRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - RecognizeRequest request = - RecognizeRequest.newBuilder() - .setConfig(RecognitionConfig.newBuilder().build()) - .setAudio(RecognitionAudio.newBuilder().build()) - .build(); - ApiFuture future = speechClient.recognizeCallable().futureCall(request); - // Do something. - RecognizeResponse response = future.get(); - } - } -} -// [END speech_v1_generated_speechclient_recognize_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognize.java deleted file mode 100644 index 77ea09fdcb29..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognize.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_speechclient_recognize_sync] -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeRequest; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; - -public class SyncRecognize { - - public static void main(String[] args) throws Exception { - syncRecognize(); - } - - public static void syncRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - RecognizeRequest request = - RecognizeRequest.newBuilder() - .setConfig(RecognitionConfig.newBuilder().build()) - .setAudio(RecognitionAudio.newBuilder().build()) - .build(); - RecognizeResponse response = speechClient.recognize(request); - } - } -} -// [END speech_v1_generated_speechclient_recognize_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java deleted file mode 100644 index 886ab8017225..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_speechclient_recognize_recognitionconfigrecognitionaudio_sync] -import com.google.cloud.speech.v1.RecognitionAudio; -import com.google.cloud.speech.v1.RecognitionConfig; -import com.google.cloud.speech.v1.RecognizeResponse; -import com.google.cloud.speech.v1.SpeechClient; - -public class SyncRecognizeRecognitionconfigRecognitionaudio { - - public static void main(String[] args) throws Exception { - syncRecognizeRecognitionconfigRecognitionaudio(); - } - - public static void syncRecognizeRecognitionconfigRecognitionaudio() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - RecognizeResponse response = speechClient.recognize(config, audio); - } - } -} -// [END speech_v1_generated_speechclient_recognize_recognitionconfigrecognitionaudio_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/streamingrecognize/AsyncStreamingRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/streamingrecognize/AsyncStreamingRecognize.java deleted file mode 100644 index 99388791a7a3..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechclient/streamingrecognize/AsyncStreamingRecognize.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_speechclient_streamingrecognize_async] -import com.google.api.gax.rpc.BidiStream; -import com.google.cloud.speech.v1.SpeechClient; -import com.google.cloud.speech.v1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1.StreamingRecognizeResponse; - -public class AsyncStreamingRecognize { - - public static void main(String[] args) throws Exception { - asyncStreamingRecognize(); - } - - public static void asyncStreamingRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - BidiStream bidiStream = - speechClient.streamingRecognizeCallable().call(); - StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); - bidiStream.send(request); - for (StreamingRecognizeResponse response : bidiStream) { - // Do something when a response is received. - } - } - } -} -// [END speech_v1_generated_speechclient_streamingrecognize_async] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechsettings/recognize/SyncRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechsettings/recognize/SyncRecognize.java deleted file mode 100644 index 6c7ac4c9601e..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/speechsettings/recognize/SyncRecognize.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.samples; - -// [START speech_v1_generated_speechsettings_recognize_sync] -import com.google.cloud.speech.v1.SpeechSettings; -import java.time.Duration; - -public class SyncRecognize { - - public static void main(String[] args) throws Exception { - syncRecognize(); - } - - public static void syncRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder(); - speechSettingsBuilder - .recognizeSettings() - .setRetrySettings( - speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - SpeechSettings speechSettings = speechSettingsBuilder.build(); - } -} -// [END speech_v1_generated_speechsettings_recognize_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java deleted file mode 100644 index ba671b79bc53..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub.samples; - -// [START speech_v1_generated_adaptationstubsettings_createphraseset_sync] -import com.google.cloud.speech.v1.stub.AdaptationStubSettings; -import java.time.Duration; - -public class SyncCreatePhraseSet { - - public static void main(String[] args) throws Exception { - syncCreatePhraseSet(); - } - - public static void syncCreatePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - AdaptationStubSettings.Builder adaptationSettingsBuilder = AdaptationStubSettings.newBuilder(); - adaptationSettingsBuilder - .createPhraseSetSettings() - .setRetrySettings( - adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - AdaptationStubSettings adaptationSettings = adaptationSettingsBuilder.build(); - } -} -// [END speech_v1_generated_adaptationstubsettings_createphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/speechstubsettings/recognize/SyncRecognize.java b/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/speechstubsettings/recognize/SyncRecognize.java deleted file mode 100644 index af6790d8c8bf..000000000000 --- a/owl-bot-staging/java-speech/v1/samples/snippets/generated/com/google/cloud/speech/v1/stub/speechstubsettings/recognize/SyncRecognize.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1.stub.samples; - -// [START speech_v1_generated_speechstubsettings_recognize_sync] -import com.google.cloud.speech.v1.stub.SpeechStubSettings; -import java.time.Duration; - -public class SyncRecognize { - - public static void main(String[] args) throws Exception { - syncRecognize(); - } - - public static void syncRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SpeechStubSettings.Builder speechSettingsBuilder = SpeechStubSettings.newBuilder(); - speechSettingsBuilder - .recognizeSettings() - .setRetrySettings( - speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - SpeechStubSettings speechSettings = speechSettingsBuilder.build(); - } -} -// [END speech_v1_generated_speechstubsettings_recognize_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java deleted file mode 100644 index 99136ef2cd56..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationClient.java +++ /dev/null @@ -1,1676 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.core.ApiFuture; -import com.google.api.core.ApiFutures; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.paging.AbstractFixedSizeCollection; -import com.google.api.gax.paging.AbstractPage; -import com.google.api.gax.paging.AbstractPagedListResponse; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1p1beta1.stub.AdaptationStub; -import com.google.cloud.speech.v1p1beta1.stub.AdaptationStubSettings; -import com.google.common.util.concurrent.MoreExecutors; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import java.io.IOException; -import java.util.List; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: Service that implements Google Cloud Speech Adaptation API. - * - *

This class provides the ability to make remote calls to the backing service through method - * calls that map to API methods. Sample code to get started: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
- *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
- *   String phraseSetId = "phraseSetId959902180";
- *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
- * }
- * }
- * - *

Note: close() needs to be called on the AdaptationClient object to clean up resources such as - * threads. In the example above, try-with-resources is used, which automatically calls close(). - * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
- * - *

See the individual methods for example code. - * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. - * - *

This class can be customized by passing in a custom instance of AdaptationSettings to - * create(). For example: - * - *

To customize credentials: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * AdaptationSettings adaptationSettings =
- *     AdaptationSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * AdaptationSettings adaptationSettings =
- *     AdaptationSettings.newBuilder().setEndpoint(myEndpoint).build();
- * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
- * }
- * - *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * AdaptationSettings adaptationSettings =
- *     AdaptationSettings.newBuilder()
- *         .setTransportChannelProvider(
- *             AdaptationSettings.defaultHttpJsonTransportProviderBuilder().build())
- *         .build();
- * AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class AdaptationClient implements BackgroundResource { - private final AdaptationSettings settings; - private final AdaptationStub stub; - - /** Constructs an instance of AdaptationClient with default settings. */ - public static final AdaptationClient create() throws IOException { - return create(AdaptationSettings.newBuilder().build()); - } - - /** - * Constructs an instance of AdaptationClient, using the given settings. The channels are created - * based on the settings passed in, or defaults for any settings that are not set. - */ - public static final AdaptationClient create(AdaptationSettings settings) throws IOException { - return new AdaptationClient(settings); - } - - /** - * Constructs an instance of AdaptationClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(AdaptationSettings). - */ - public static final AdaptationClient create(AdaptationStub stub) { - return new AdaptationClient(stub); - } - - /** - * Constructs an instance of AdaptationClient, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected AdaptationClient(AdaptationSettings settings) throws IOException { - this.settings = settings; - this.stub = ((AdaptationStubSettings) settings.getStubSettings()).createStub(); - } - - protected AdaptationClient(AdaptationStub stub) { - this.settings = null; - this.stub = stub; - } - - public final AdaptationSettings getSettings() { - return settings; - } - - public AdaptationStub getStub() { - return stub; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. - * The items in the PhraseSet are favored by the recognition model when you send a call that - * includes the PhraseSet. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
-   *   String phraseSetId = "phraseSetId959902180";
-   *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
-   * }
-   * }
- * - * @param parent Required. The parent resource where this phrase set will be created. Format: - *

`projects/{project}/locations/{location}/phraseSets` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @param phraseSet Required. The phrase set to create. - * @param phraseSetId Required. The ID to use for the phrase set, which will become the final - * component of the phrase set's resource name. - *

This value should restrict to letters, numbers, and hyphens, with the first character a - * letter, the last a letter or a number, and be 4-63 characters. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet createPhraseSet( - LocationName parent, PhraseSet phraseSet, String phraseSetId) { - CreatePhraseSetRequest request = - CreatePhraseSetRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setPhraseSet(phraseSet) - .setPhraseSetId(phraseSetId) - .build(); - return createPhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. - * The items in the PhraseSet are favored by the recognition model when you send a call that - * includes the PhraseSet. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
-   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
-   *   String phraseSetId = "phraseSetId959902180";
-   *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
-   * }
-   * }
- * - * @param parent Required. The parent resource where this phrase set will be created. Format: - *

`projects/{project}/locations/{location}/phraseSets` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @param phraseSet Required. The phrase set to create. - * @param phraseSetId Required. The ID to use for the phrase set, which will become the final - * component of the phrase set's resource name. - *

This value should restrict to letters, numbers, and hyphens, with the first character a - * letter, the last a letter or a number, and be 4-63 characters. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet createPhraseSet(String parent, PhraseSet phraseSet, String phraseSetId) { - CreatePhraseSetRequest request = - CreatePhraseSetRequest.newBuilder() - .setParent(parent) - .setPhraseSet(phraseSet) - .setPhraseSetId(phraseSetId) - .build(); - return createPhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. - * The items in the PhraseSet are favored by the recognition model when you send a call that - * includes the PhraseSet. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CreatePhraseSetRequest request =
-   *       CreatePhraseSetRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPhraseSetId("phraseSetId959902180")
-   *           .setPhraseSet(PhraseSet.newBuilder().build())
-   *           .build();
-   *   PhraseSet response = adaptationClient.createPhraseSet(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet createPhraseSet(CreatePhraseSetRequest request) { - return createPhraseSetCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. - * The items in the PhraseSet are favored by the recognition model when you send a call that - * includes the PhraseSet. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CreatePhraseSetRequest request =
-   *       CreatePhraseSetRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPhraseSetId("phraseSetId959902180")
-   *           .setPhraseSet(PhraseSet.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = adaptationClient.createPhraseSetCallable().futureCall(request);
-   *   // Do something.
-   *   PhraseSet response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createPhraseSetCallable() { - return stub.createPhraseSetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
-   *   PhraseSet response = adaptationClient.getPhraseSet(name);
-   * }
-   * }
- * - * @param name Required. The name of the phrase set to retrieve. Format: - *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet getPhraseSet(PhraseSetName name) { - GetPhraseSetRequest request = - GetPhraseSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getPhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
-   *   PhraseSet response = adaptationClient.getPhraseSet(name);
-   * }
-   * }
- * - * @param name Required. The name of the phrase set to retrieve. Format: - *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet getPhraseSet(String name) { - GetPhraseSetRequest request = GetPhraseSetRequest.newBuilder().setName(name).build(); - return getPhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   GetPhraseSetRequest request =
-   *       GetPhraseSetRequest.newBuilder()
-   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
-   *           .build();
-   *   PhraseSet response = adaptationClient.getPhraseSet(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet getPhraseSet(GetPhraseSetRequest request) { - return getPhraseSetCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   GetPhraseSetRequest request =
-   *       GetPhraseSetRequest.newBuilder()
-   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
-   *           .build();
-   *   ApiFuture future = adaptationClient.getPhraseSetCallable().futureCall(request);
-   *   // Do something.
-   *   PhraseSet response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getPhraseSetCallable() { - return stub.getPhraseSetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List phrase sets. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The parent, which owns this collection of phrase set. Format: - *

`projects/{project}/locations/{location}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPhraseSetPagedResponse listPhraseSet(LocationName parent) { - ListPhraseSetRequest request = - ListPhraseSetRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listPhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List phrase sets. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
-   *   for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The parent, which owns this collection of phrase set. Format: - *

`projects/{project}/locations/{location}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPhraseSetPagedResponse listPhraseSet(String parent) { - ListPhraseSetRequest request = ListPhraseSetRequest.newBuilder().setParent(parent).build(); - return listPhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List phrase sets. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   ListPhraseSetRequest request =
-   *       ListPhraseSetRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (PhraseSet element : adaptationClient.listPhraseSet(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListPhraseSetPagedResponse listPhraseSet(ListPhraseSetRequest request) { - return listPhraseSetPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List phrase sets. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   ListPhraseSetRequest request =
-   *       ListPhraseSetRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future =
-   *       adaptationClient.listPhraseSetPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (PhraseSet element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listPhraseSetPagedCallable() { - return stub.listPhraseSetPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List phrase sets. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   ListPhraseSetRequest request =
-   *       ListPhraseSetRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListPhraseSetResponse response = adaptationClient.listPhraseSetCallable().call(request);
-   *     for (PhraseSet element : response.getPhraseSetsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable listPhraseSetCallable() { - return stub.listPhraseSetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Update a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   PhraseSet response = adaptationClient.updatePhraseSet(phraseSet, updateMask);
-   * }
-   * }
- * - * @param phraseSet Required. The phrase set to update. - *

The phrase set's `name` field is used to identify the set to be updated. Format: - *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @param updateMask The list of fields to be updated. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet updatePhraseSet(PhraseSet phraseSet, FieldMask updateMask) { - UpdatePhraseSetRequest request = - UpdatePhraseSetRequest.newBuilder() - .setPhraseSet(phraseSet) - .setUpdateMask(updateMask) - .build(); - return updatePhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Update a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   UpdatePhraseSetRequest request =
-   *       UpdatePhraseSetRequest.newBuilder()
-   *           .setPhraseSet(PhraseSet.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   PhraseSet response = adaptationClient.updatePhraseSet(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final PhraseSet updatePhraseSet(UpdatePhraseSetRequest request) { - return updatePhraseSetCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Update a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   UpdatePhraseSetRequest request =
-   *       UpdatePhraseSetRequest.newBuilder()
-   *           .setPhraseSet(PhraseSet.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = adaptationClient.updatePhraseSetCallable().futureCall(request);
-   *   // Do something.
-   *   PhraseSet response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updatePhraseSetCallable() { - return stub.updatePhraseSetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
-   *   adaptationClient.deletePhraseSet(name);
-   * }
-   * }
- * - * @param name Required. The name of the phrase set to delete. Format: - *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deletePhraseSet(PhraseSetName name) { - DeletePhraseSetRequest request = - DeletePhraseSetRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - deletePhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
-   *   adaptationClient.deletePhraseSet(name);
-   * }
-   * }
- * - * @param name Required. The name of the phrase set to delete. Format: - *

`projects/{project}/locations/{location}/phraseSets/{phrase_set}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deletePhraseSet(String name) { - DeletePhraseSetRequest request = DeletePhraseSetRequest.newBuilder().setName(name).build(); - deletePhraseSet(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   DeletePhraseSetRequest request =
-   *       DeletePhraseSetRequest.newBuilder()
-   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
-   *           .build();
-   *   adaptationClient.deletePhraseSet(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deletePhraseSet(DeletePhraseSetRequest request) { - deletePhraseSetCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a phrase set. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   DeletePhraseSetRequest request =
-   *       DeletePhraseSetRequest.newBuilder()
-   *           .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
-   *           .build();
-   *   ApiFuture future = adaptationClient.deletePhraseSetCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deletePhraseSetCallable() { - return stub.deletePhraseSetCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   CustomClass customClass = CustomClass.newBuilder().build();
-   *   String customClassId = "customClassId1871032322";
-   *   CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId);
-   * }
-   * }
- * - * @param parent Required. The parent resource where this custom class will be created. Format: - *

`projects/{project}/locations/{location}/customClasses` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @param customClass Required. The custom class to create. - * @param customClassId Required. The ID to use for the custom class, which will become the final - * component of the custom class' resource name. - *

This value should restrict to letters, numbers, and hyphens, with the first character a - * letter, the last a letter or a number, and be 4-63 characters. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass createCustomClass( - LocationName parent, CustomClass customClass, String customClassId) { - CreateCustomClassRequest request = - CreateCustomClassRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .setCustomClass(customClass) - .setCustomClassId(customClassId) - .build(); - return createCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
-   *   CustomClass customClass = CustomClass.newBuilder().build();
-   *   String customClassId = "customClassId1871032322";
-   *   CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId);
-   * }
-   * }
- * - * @param parent Required. The parent resource where this custom class will be created. Format: - *

`projects/{project}/locations/{location}/customClasses` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @param customClass Required. The custom class to create. - * @param customClassId Required. The ID to use for the custom class, which will become the final - * component of the custom class' resource name. - *

This value should restrict to letters, numbers, and hyphens, with the first character a - * letter, the last a letter or a number, and be 4-63 characters. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass createCustomClass( - String parent, CustomClass customClass, String customClassId) { - CreateCustomClassRequest request = - CreateCustomClassRequest.newBuilder() - .setParent(parent) - .setCustomClass(customClass) - .setCustomClassId(customClassId) - .build(); - return createCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CreateCustomClassRequest request =
-   *       CreateCustomClassRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setCustomClassId("customClassId1871032322")
-   *           .setCustomClass(CustomClass.newBuilder().build())
-   *           .build();
-   *   CustomClass response = adaptationClient.createCustomClass(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass createCustomClass(CreateCustomClassRequest request) { - return createCustomClassCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Create a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CreateCustomClassRequest request =
-   *       CreateCustomClassRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setCustomClassId("customClassId1871032322")
-   *           .setCustomClass(CustomClass.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       adaptationClient.createCustomClassCallable().futureCall(request);
-   *   // Do something.
-   *   CustomClass response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable createCustomClassCallable() { - return stub.createCustomClassCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
-   *   CustomClass response = adaptationClient.getCustomClass(name);
-   * }
-   * }
- * - * @param name Required. The name of the custom class to retrieve. Format: - *

`projects/{project}/locations/{location}/customClasses/{custom_class}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass getCustomClass(CustomClassName name) { - GetCustomClassRequest request = - GetCustomClassRequest.newBuilder().setName(name == null ? null : name.toString()).build(); - return getCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
-   *   CustomClass response = adaptationClient.getCustomClass(name);
-   * }
-   * }
- * - * @param name Required. The name of the custom class to retrieve. Format: - *

`projects/{project}/locations/{location}/customClasses/{custom_class}` - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass getCustomClass(String name) { - GetCustomClassRequest request = GetCustomClassRequest.newBuilder().setName(name).build(); - return getCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   GetCustomClassRequest request =
-   *       GetCustomClassRequest.newBuilder()
-   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
-   *           .build();
-   *   CustomClass response = adaptationClient.getCustomClass(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass getCustomClass(GetCustomClassRequest request) { - return getCustomClassCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Get a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   GetCustomClassRequest request =
-   *       GetCustomClassRequest.newBuilder()
-   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
-   *           .build();
-   *   ApiFuture future = adaptationClient.getCustomClassCallable().futureCall(request);
-   *   // Do something.
-   *   CustomClass response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable getCustomClassCallable() { - return stub.getCustomClassCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List custom classes. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The parent, which owns this collection of custom classes. Format: - *

`projects/{project}/locations/{location}/customClasses` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListCustomClassesPagedResponse listCustomClasses(LocationName parent) { - ListCustomClassesRequest request = - ListCustomClassesRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) - .build(); - return listCustomClasses(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List custom classes. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
-   *   for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param parent Required. The parent, which owns this collection of custom classes. Format: - *

`projects/{project}/locations/{location}/customClasses` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListCustomClassesPagedResponse listCustomClasses(String parent) { - ListCustomClassesRequest request = - ListCustomClassesRequest.newBuilder().setParent(parent).build(); - return listCustomClasses(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List custom classes. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   ListCustomClassesRequest request =
-   *       ListCustomClassesRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   for (CustomClass element : adaptationClient.listCustomClasses(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final ListCustomClassesPagedResponse listCustomClasses(ListCustomClassesRequest request) { - return listCustomClassesPagedCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List custom classes. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   ListCustomClassesRequest request =
-   *       ListCustomClassesRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   ApiFuture future =
-   *       adaptationClient.listCustomClassesPagedCallable().futureCall(request);
-   *   // Do something.
-   *   for (CustomClass element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listCustomClassesPagedCallable() { - return stub.listCustomClassesPagedCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * List custom classes. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   ListCustomClassesRequest request =
-   *       ListCustomClassesRequest.newBuilder()
-   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
-   *           .setPageSize(883849137)
-   *           .setPageToken("pageToken873572522")
-   *           .build();
-   *   while (true) {
-   *     ListCustomClassesResponse response =
-   *         adaptationClient.listCustomClassesCallable().call(request);
-   *     for (CustomClass element : response.getCustomClassesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * }
- */ - public final UnaryCallable - listCustomClassesCallable() { - return stub.listCustomClassesCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Update a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CustomClass customClass = CustomClass.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   CustomClass response = adaptationClient.updateCustomClass(customClass, updateMask);
-   * }
-   * }
- * - * @param customClass Required. The custom class to update. - *

The custom class's `name` field is used to identify the custom class to be updated. - * Format: - *

`projects/{project}/locations/{location}/customClasses/{custom_class}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @param updateMask The list of fields to be updated. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass updateCustomClass(CustomClass customClass, FieldMask updateMask) { - UpdateCustomClassRequest request = - UpdateCustomClassRequest.newBuilder() - .setCustomClass(customClass) - .setUpdateMask(updateMask) - .build(); - return updateCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Update a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   UpdateCustomClassRequest request =
-   *       UpdateCustomClassRequest.newBuilder()
-   *           .setCustomClass(CustomClass.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   CustomClass response = adaptationClient.updateCustomClass(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final CustomClass updateCustomClass(UpdateCustomClassRequest request) { - return updateCustomClassCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Update a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   UpdateCustomClassRequest request =
-   *       UpdateCustomClassRequest.newBuilder()
-   *           .setCustomClass(CustomClass.newBuilder().build())
-   *           .setUpdateMask(FieldMask.newBuilder().build())
-   *           .build();
-   *   ApiFuture future =
-   *       adaptationClient.updateCustomClassCallable().futureCall(request);
-   *   // Do something.
-   *   CustomClass response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable updateCustomClassCallable() { - return stub.updateCustomClassCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
-   *   adaptationClient.deleteCustomClass(name);
-   * }
-   * }
- * - * @param name Required. The name of the custom class to delete. Format: - *

`projects/{project}/locations/{location}/customClasses/{custom_class}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteCustomClass(CustomClassName name) { - DeleteCustomClassRequest request = - DeleteCustomClassRequest.newBuilder() - .setName(name == null ? null : name.toString()) - .build(); - deleteCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
-   *   adaptationClient.deleteCustomClass(name);
-   * }
-   * }
- * - * @param name Required. The name of the custom class to delete. Format: - *

`projects/{project}/locations/{location}/customClasses/{custom_class}` - *

Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` - * (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` - * location. To specify a region, use a [regional - * endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or - * `eu` location value. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteCustomClass(String name) { - DeleteCustomClassRequest request = DeleteCustomClassRequest.newBuilder().setName(name).build(); - deleteCustomClass(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   DeleteCustomClassRequest request =
-   *       DeleteCustomClassRequest.newBuilder()
-   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
-   *           .build();
-   *   adaptationClient.deleteCustomClass(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final void deleteCustomClass(DeleteCustomClassRequest request) { - deleteCustomClassCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Delete a custom class. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
-   *   DeleteCustomClassRequest request =
-   *       DeleteCustomClassRequest.newBuilder()
-   *           .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
-   *           .build();
-   *   ApiFuture future = adaptationClient.deleteCustomClassCallable().futureCall(request);
-   *   // Do something.
-   *   future.get();
-   * }
-   * }
- */ - public final UnaryCallable deleteCustomClassCallable() { - return stub.deleteCustomClassCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } - - public static class ListPhraseSetPagedResponse - extends AbstractPagedListResponse< - ListPhraseSetRequest, - ListPhraseSetResponse, - PhraseSet, - ListPhraseSetPage, - ListPhraseSetFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListPhraseSetPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListPhraseSetPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListPhraseSetPagedResponse(ListPhraseSetPage page) { - super(page, ListPhraseSetFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListPhraseSetPage - extends AbstractPage< - ListPhraseSetRequest, ListPhraseSetResponse, PhraseSet, ListPhraseSetPage> { - - private ListPhraseSetPage( - PageContext context, - ListPhraseSetResponse response) { - super(context, response); - } - - private static ListPhraseSetPage createEmptyPage() { - return new ListPhraseSetPage(null, null); - } - - @Override - protected ListPhraseSetPage createPage( - PageContext context, - ListPhraseSetResponse response) { - return new ListPhraseSetPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListPhraseSetFixedSizeCollection - extends AbstractFixedSizeCollection< - ListPhraseSetRequest, - ListPhraseSetResponse, - PhraseSet, - ListPhraseSetPage, - ListPhraseSetFixedSizeCollection> { - - private ListPhraseSetFixedSizeCollection(List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListPhraseSetFixedSizeCollection createEmptyCollection() { - return new ListPhraseSetFixedSizeCollection(null, 0); - } - - @Override - protected ListPhraseSetFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListPhraseSetFixedSizeCollection(pages, collectionSize); - } - } - - public static class ListCustomClassesPagedResponse - extends AbstractPagedListResponse< - ListCustomClassesRequest, - ListCustomClassesResponse, - CustomClass, - ListCustomClassesPage, - ListCustomClassesFixedSizeCollection> { - - public static ApiFuture createAsync( - PageContext context, - ApiFuture futureResponse) { - ApiFuture futurePage = - ListCustomClassesPage.createEmptyPage().createPageAsync(context, futureResponse); - return ApiFutures.transform( - futurePage, - input -> new ListCustomClassesPagedResponse(input), - MoreExecutors.directExecutor()); - } - - private ListCustomClassesPagedResponse(ListCustomClassesPage page) { - super(page, ListCustomClassesFixedSizeCollection.createEmptyCollection()); - } - } - - public static class ListCustomClassesPage - extends AbstractPage< - ListCustomClassesRequest, ListCustomClassesResponse, CustomClass, ListCustomClassesPage> { - - private ListCustomClassesPage( - PageContext context, - ListCustomClassesResponse response) { - super(context, response); - } - - private static ListCustomClassesPage createEmptyPage() { - return new ListCustomClassesPage(null, null); - } - - @Override - protected ListCustomClassesPage createPage( - PageContext context, - ListCustomClassesResponse response) { - return new ListCustomClassesPage(context, response); - } - - @Override - public ApiFuture createPageAsync( - PageContext context, - ApiFuture futureResponse) { - return super.createPageAsync(context, futureResponse); - } - } - - public static class ListCustomClassesFixedSizeCollection - extends AbstractFixedSizeCollection< - ListCustomClassesRequest, - ListCustomClassesResponse, - CustomClass, - ListCustomClassesPage, - ListCustomClassesFixedSizeCollection> { - - private ListCustomClassesFixedSizeCollection( - List pages, int collectionSize) { - super(pages, collectionSize); - } - - private static ListCustomClassesFixedSizeCollection createEmptyCollection() { - return new ListCustomClassesFixedSizeCollection(null, 0); - } - - @Override - protected ListCustomClassesFixedSizeCollection createCollection( - List pages, int collectionSize) { - return new ListCustomClassesFixedSizeCollection(pages, collectionSize); - } - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java deleted file mode 100644 index 2698cc554881..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationSettings.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.speech.v1p1beta1.stub.AdaptationStubSettings; -import com.google.protobuf.Empty; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link AdaptationClient}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (speech.googleapis.com) and default port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of createPhraseSet to 30 seconds: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * AdaptationSettings.Builder adaptationSettingsBuilder = AdaptationSettings.newBuilder();
- * adaptationSettingsBuilder
- *     .createPhraseSetSettings()
- *     .setRetrySettings(
- *         adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * AdaptationSettings adaptationSettings = adaptationSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class AdaptationSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to createPhraseSet. */ - public UnaryCallSettings createPhraseSetSettings() { - return ((AdaptationStubSettings) getStubSettings()).createPhraseSetSettings(); - } - - /** Returns the object with the settings used for calls to getPhraseSet. */ - public UnaryCallSettings getPhraseSetSettings() { - return ((AdaptationStubSettings) getStubSettings()).getPhraseSetSettings(); - } - - /** Returns the object with the settings used for calls to listPhraseSet. */ - public PagedCallSettings - listPhraseSetSettings() { - return ((AdaptationStubSettings) getStubSettings()).listPhraseSetSettings(); - } - - /** Returns the object with the settings used for calls to updatePhraseSet. */ - public UnaryCallSettings updatePhraseSetSettings() { - return ((AdaptationStubSettings) getStubSettings()).updatePhraseSetSettings(); - } - - /** Returns the object with the settings used for calls to deletePhraseSet. */ - public UnaryCallSettings deletePhraseSetSettings() { - return ((AdaptationStubSettings) getStubSettings()).deletePhraseSetSettings(); - } - - /** Returns the object with the settings used for calls to createCustomClass. */ - public UnaryCallSettings createCustomClassSettings() { - return ((AdaptationStubSettings) getStubSettings()).createCustomClassSettings(); - } - - /** Returns the object with the settings used for calls to getCustomClass. */ - public UnaryCallSettings getCustomClassSettings() { - return ((AdaptationStubSettings) getStubSettings()).getCustomClassSettings(); - } - - /** Returns the object with the settings used for calls to listCustomClasses. */ - public PagedCallSettings< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - listCustomClassesSettings() { - return ((AdaptationStubSettings) getStubSettings()).listCustomClassesSettings(); - } - - /** Returns the object with the settings used for calls to updateCustomClass. */ - public UnaryCallSettings updateCustomClassSettings() { - return ((AdaptationStubSettings) getStubSettings()).updateCustomClassSettings(); - } - - /** Returns the object with the settings used for calls to deleteCustomClass. */ - public UnaryCallSettings deleteCustomClassSettings() { - return ((AdaptationStubSettings) getStubSettings()).deleteCustomClassSettings(); - } - - public static final AdaptationSettings create(AdaptationStubSettings stub) throws IOException { - return new AdaptationSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return AdaptationStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return AdaptationStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return AdaptationStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return AdaptationStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return AdaptationStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return AdaptationStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return AdaptationStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return AdaptationStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected AdaptationSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for AdaptationSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(AdaptationStubSettings.newBuilder(clientContext)); - } - - protected Builder(AdaptationSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(AdaptationStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(AdaptationStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(AdaptationStubSettings.newHttpJsonBuilder()); - } - - public AdaptationStubSettings.Builder getStubSettingsBuilder() { - return ((AdaptationStubSettings.Builder) getStubSettings()); - } - - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to createPhraseSet. */ - public UnaryCallSettings.Builder createPhraseSetSettings() { - return getStubSettingsBuilder().createPhraseSetSettings(); - } - - /** Returns the builder for the settings used for calls to getPhraseSet. */ - public UnaryCallSettings.Builder getPhraseSetSettings() { - return getStubSettingsBuilder().getPhraseSetSettings(); - } - - /** Returns the builder for the settings used for calls to listPhraseSet. */ - public PagedCallSettings.Builder< - ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> - listPhraseSetSettings() { - return getStubSettingsBuilder().listPhraseSetSettings(); - } - - /** Returns the builder for the settings used for calls to updatePhraseSet. */ - public UnaryCallSettings.Builder updatePhraseSetSettings() { - return getStubSettingsBuilder().updatePhraseSetSettings(); - } - - /** Returns the builder for the settings used for calls to deletePhraseSet. */ - public UnaryCallSettings.Builder deletePhraseSetSettings() { - return getStubSettingsBuilder().deletePhraseSetSettings(); - } - - /** Returns the builder for the settings used for calls to createCustomClass. */ - public UnaryCallSettings.Builder - createCustomClassSettings() { - return getStubSettingsBuilder().createCustomClassSettings(); - } - - /** Returns the builder for the settings used for calls to getCustomClass. */ - public UnaryCallSettings.Builder getCustomClassSettings() { - return getStubSettingsBuilder().getCustomClassSettings(); - } - - /** Returns the builder for the settings used for calls to listCustomClasses. */ - public PagedCallSettings.Builder< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - listCustomClassesSettings() { - return getStubSettingsBuilder().listCustomClassesSettings(); - } - - /** Returns the builder for the settings used for calls to updateCustomClass. */ - public UnaryCallSettings.Builder - updateCustomClassSettings() { - return getStubSettingsBuilder().updateCustomClassSettings(); - } - - /** Returns the builder for the settings used for calls to deleteCustomClass. */ - public UnaryCallSettings.Builder deleteCustomClassSettings() { - return getStubSettingsBuilder().deleteCustomClassSettings(); - } - - @Override - public AdaptationSettings build() throws IOException { - return new AdaptationSettings(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java deleted file mode 100644 index ee1bf00d4884..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechClient.java +++ /dev/null @@ -1,484 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.httpjson.longrunning.OperationsClient; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1p1beta1.stub.SpeechStub; -import com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Service Description: Service that implements Google Cloud Speech API. - * - *

This class provides the ability to make remote calls to the backing service through method - * calls that map to API methods. Sample code to get started: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (SpeechClient speechClient = SpeechClient.create()) {
- *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
- *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
- *   RecognizeResponse response = speechClient.recognize(config, audio);
- * }
- * }
- * - *

Note: close() needs to be called on the SpeechClient object to clean up resources such as - * threads. In the example above, try-with-resources is used, which automatically calls close(). - * - *

The surface of this class includes several types of Java methods for each of the API's - * methods: - * - *

    - *
  1. A "flattened" method. With this type of method, the fields of the request type have been - * converted into function parameters. It may be the case that not all fields are available as - * parameters, and not every API method will have a flattened method entry point. - *
  2. A "request object" method. This type of method only takes one parameter, a request object, - * which must be constructed before the call. Not every API method will have a request object - * method. - *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API - * callable object, which can be used to initiate calls to the service. - *
- * - *

See the individual methods for example code. - * - *

Many parameters require resource names to be formatted in a particular way. To assist with - * these names, this class includes a format method for each type of name, and additionally a parse - * method to extract the individual identifiers contained within names that are returned. - * - *

This class can be customized by passing in a custom instance of SpeechSettings to create(). - * For example: - * - *

To customize credentials: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SpeechSettings speechSettings =
- *     SpeechSettings.newBuilder()
- *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
- *         .build();
- * SpeechClient speechClient = SpeechClient.create(speechSettings);
- * }
- * - *

To customize the endpoint: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build();
- * SpeechClient speechClient = SpeechClient.create(speechSettings);
- * }
- * - *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over - * the wire: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SpeechSettings speechSettings =
- *     SpeechSettings.newBuilder()
- *         .setTransportChannelProvider(
- *             SpeechSettings.defaultHttpJsonTransportProviderBuilder().build())
- *         .build();
- * SpeechClient speechClient = SpeechClient.create(speechSettings);
- * }
- * - *

Please refer to the GitHub repository's samples for more quickstart code snippets. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class SpeechClient implements BackgroundResource { - private final SpeechSettings settings; - private final SpeechStub stub; - private final OperationsClient httpJsonOperationsClient; - private final com.google.longrunning.OperationsClient operationsClient; - - /** Constructs an instance of SpeechClient with default settings. */ - public static final SpeechClient create() throws IOException { - return create(SpeechSettings.newBuilder().build()); - } - - /** - * Constructs an instance of SpeechClient, using the given settings. The channels are created - * based on the settings passed in, or defaults for any settings that are not set. - */ - public static final SpeechClient create(SpeechSettings settings) throws IOException { - return new SpeechClient(settings); - } - - /** - * Constructs an instance of SpeechClient, using the given stub for making calls. This is for - * advanced usage - prefer using create(SpeechSettings). - */ - public static final SpeechClient create(SpeechStub stub) { - return new SpeechClient(stub); - } - - /** - * Constructs an instance of SpeechClient, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected SpeechClient(SpeechSettings settings) throws IOException { - this.settings = settings; - this.stub = ((SpeechStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = - com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); - this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); - } - - protected SpeechClient(SpeechStub stub) { - this.settings = null; - this.stub = stub; - this.operationsClient = - com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); - this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); - } - - public final SpeechSettings getSettings() { - return settings; - } - - public SpeechStub getStub() { - return stub; - } - - /** - * Returns the OperationsClient that can be used to query the status of a long-running operation - * returned by another API method call. - */ - public final com.google.longrunning.OperationsClient getOperationsClient() { - return operationsClient; - } - - /** - * Returns the OperationsClient that can be used to query the status of a long-running operation - * returned by another API method call. - */ - @BetaApi - public final OperationsClient getHttpJsonOperationsClient() { - return httpJsonOperationsClient; - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs synchronous speech recognition: receive results after all audio has been sent and - * processed. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
-   *   RecognizeResponse response = speechClient.recognize(config, audio);
-   * }
-   * }
- * - * @param config Required. Provides information to the recognizer that specifies how to process - * the request. - * @param audio Required. The audio data to be recognized. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final RecognizeResponse recognize(RecognitionConfig config, RecognitionAudio audio) { - RecognizeRequest request = - RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - return recognize(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs synchronous speech recognition: receive results after all audio has been sent and - * processed. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognizeRequest request =
-   *       RecognizeRequest.newBuilder()
-   *           .setConfig(RecognitionConfig.newBuilder().build())
-   *           .setAudio(RecognitionAudio.newBuilder().build())
-   *           .build();
-   *   RecognizeResponse response = speechClient.recognize(request);
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final RecognizeResponse recognize(RecognizeRequest request) { - return recognizeCallable().call(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs synchronous speech recognition: receive results after all audio has been sent and - * processed. - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognizeRequest request =
-   *       RecognizeRequest.newBuilder()
-   *           .setConfig(RecognitionConfig.newBuilder().build())
-   *           .setAudio(RecognitionAudio.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = speechClient.recognizeCallable().futureCall(request);
-   *   // Do something.
-   *   RecognizeResponse response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable recognizeCallable() { - return stub.recognizeCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
-   *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
-   *   LongRunningRecognizeResponse response =
-   *       speechClient.longRunningRecognizeAsync(config, audio).get();
-   * }
-   * }
- * - * @param config Required. Provides information to the recognizer that specifies how to process - * the request. - * @param audio Required. The audio data to be recognized. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture - longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio) { - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); - return longRunningRecognizeAsync(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   LongRunningRecognizeRequest request =
-   *       LongRunningRecognizeRequest.newBuilder()
-   *           .setConfig(RecognitionConfig.newBuilder().build())
-   *           .setAudio(RecognitionAudio.newBuilder().build())
-   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
-   *           .build();
-   *   LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get();
-   * }
-   * }
- * - * @param request The request object containing all of the parameters for the API call. - * @throws com.google.api.gax.rpc.ApiException if the remote call fails - */ - public final OperationFuture - longRunningRecognizeAsync(LongRunningRecognizeRequest request) { - return longRunningRecognizeOperationCallable().futureCall(request); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   LongRunningRecognizeRequest request =
-   *       LongRunningRecognizeRequest.newBuilder()
-   *           .setConfig(RecognitionConfig.newBuilder().build())
-   *           .setAudio(RecognitionAudio.newBuilder().build())
-   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
-   *           .build();
-   *   OperationFuture future =
-   *       speechClient.longRunningRecognizeOperationCallable().futureCall(request);
-   *   // Do something.
-   *   LongRunningRecognizeResponse response = future.get();
-   * }
-   * }
- */ - public final OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - return stub.longRunningRecognizeOperationCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations - * interface. Returns either an `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. For more information on asynchronous speech - * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   LongRunningRecognizeRequest request =
-   *       LongRunningRecognizeRequest.newBuilder()
-   *           .setConfig(RecognitionConfig.newBuilder().build())
-   *           .setAudio(RecognitionAudio.newBuilder().build())
-   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
-   *           .build();
-   *   ApiFuture future = speechClient.longRunningRecognizeCallable().futureCall(request);
-   *   // Do something.
-   *   Operation response = future.get();
-   * }
-   * }
- */ - public final UnaryCallable - longRunningRecognizeCallable() { - return stub.longRunningRecognizeCallable(); - } - - // AUTO-GENERATED DOCUMENTATION AND METHOD. - /** - * Performs bidirectional streaming speech recognition: receive results while sending audio. This - * method is only available via the gRPC API (not REST). - * - *

Sample code: - * - *

{@code
-   * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
-   * try (SpeechClient speechClient = SpeechClient.create()) {
-   *   BidiStream bidiStream =
-   *       speechClient.streamingRecognizeCallable().call();
-   *   StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build();
-   *   bidiStream.send(request);
-   *   for (StreamingRecognizeResponse response : bidiStream) {
-   *     // Do something when a response is received.
-   *   }
-   * }
-   * }
- */ - public final BidiStreamingCallable - streamingRecognizeCallable() { - return stub.streamingRecognizeCallable(); - } - - @Override - public final void close() { - stub.close(); - } - - @Override - public void shutdown() { - stub.shutdown(); - } - - @Override - public boolean isShutdown() { - return stub.isShutdown(); - } - - @Override - public boolean isTerminated() { - return stub.isTerminated(); - } - - @Override - public void shutdownNow() { - stub.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return stub.awaitTermination(duration, unit); - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java deleted file mode 100644 index b6e6468b14bb..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechSettings.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientSettings; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link SpeechClient}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (speech.googleapis.com) and default port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of recognize to 30 seconds: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder();
- * speechSettingsBuilder
- *     .recognizeSettings()
- *     .setRetrySettings(
- *         speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * SpeechSettings speechSettings = speechSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class SpeechSettings extends ClientSettings { - - /** Returns the object with the settings used for calls to recognize. */ - public UnaryCallSettings recognizeSettings() { - return ((SpeechStubSettings) getStubSettings()).recognizeSettings(); - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings longRunningRecognizeSettings() { - return ((SpeechStubSettings) getStubSettings()).longRunningRecognizeSettings(); - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - public OperationCallSettings< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return ((SpeechStubSettings) getStubSettings()).longRunningRecognizeOperationSettings(); - } - - /** Returns the object with the settings used for calls to streamingRecognize. */ - public StreamingCallSettings - streamingRecognizeSettings() { - return ((SpeechStubSettings) getStubSettings()).streamingRecognizeSettings(); - } - - public static final SpeechSettings create(SpeechStubSettings stub) throws IOException { - return new SpeechSettings.Builder(stub.toBuilder()).build(); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return SpeechStubSettings.defaultExecutorProviderBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return SpeechStubSettings.getDefaultEndpoint(); - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return SpeechStubSettings.getDefaultServiceScopes(); - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return SpeechStubSettings.defaultCredentialsProviderBuilder(); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return SpeechStubSettings.defaultGrpcTransportProviderBuilder(); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return SpeechStubSettings.defaultHttpJsonTransportProviderBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return SpeechStubSettings.defaultTransportChannelProvider(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SpeechStubSettings.defaultApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - @BetaApi - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected SpeechSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - } - - /** Builder for SpeechSettings. */ - public static class Builder extends ClientSettings.Builder { - - protected Builder() throws IOException { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(SpeechStubSettings.newBuilder(clientContext)); - } - - protected Builder(SpeechSettings settings) { - super(settings.getStubSettings().toBuilder()); - } - - protected Builder(SpeechStubSettings.Builder stubSettings) { - super(stubSettings); - } - - private static Builder createDefault() { - return new Builder(SpeechStubSettings.newBuilder()); - } - - @BetaApi - private static Builder createHttpJsonDefault() { - return new Builder(SpeechStubSettings.newHttpJsonBuilder()); - } - - public SpeechStubSettings.Builder getStubSettingsBuilder() { - return ((SpeechStubSettings.Builder) getStubSettings()); - } - - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) { - super.applyToAllUnaryMethods( - getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); - return this; - } - - /** Returns the builder for the settings used for calls to recognize. */ - public UnaryCallSettings.Builder recognizeSettings() { - return getStubSettingsBuilder().recognizeSettings(); - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings.Builder - longRunningRecognizeSettings() { - return getStubSettingsBuilder().longRunningRecognizeSettings(); - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - public OperationCallSettings.Builder< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return getStubSettingsBuilder().longRunningRecognizeOperationSettings(); - } - - /** Returns the builder for the settings used for calls to streamingRecognize. */ - public StreamingCallSettings.Builder - streamingRecognizeSettings() { - return getStubSettingsBuilder().streamingRecognizeSettings(); - } - - @Override - public SpeechSettings build() throws IOException { - return new SpeechSettings(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/gapic_metadata.json b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/gapic_metadata.json deleted file mode 100644 index 304cbe0bf0b4..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/gapic_metadata.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "java", - "protoPackage": "google.cloud.speech.v1p1beta1", - "libraryPackage": "com.google.cloud.speech.v1p1beta1", - "services": { - "Speech": { - "clients": { - "grpc": { - "libraryClient": "SpeechClient", - "rpcs": { - "LongRunningRecognize": { - "methods": ["longRunningRecognizeAsync", "longRunningRecognizeAsync", "longRunningRecognizeOperationCallable", "longRunningRecognizeCallable"] - }, - "Recognize": { - "methods": ["recognize", "recognize", "recognizeCallable"] - }, - "StreamingRecognize": { - "methods": ["streamingRecognizeCallable"] - } - } - } - } - }, - "Adaptation": { - "clients": { - "grpc": { - "libraryClient": "AdaptationClient", - "rpcs": { - "CreateCustomClass": { - "methods": ["createCustomClass", "createCustomClass", "createCustomClass", "createCustomClassCallable"] - }, - "CreatePhraseSet": { - "methods": ["createPhraseSet", "createPhraseSet", "createPhraseSet", "createPhraseSetCallable"] - }, - "DeleteCustomClass": { - "methods": ["deleteCustomClass", "deleteCustomClass", "deleteCustomClass", "deleteCustomClassCallable"] - }, - "DeletePhraseSet": { - "methods": ["deletePhraseSet", "deletePhraseSet", "deletePhraseSet", "deletePhraseSetCallable"] - }, - "GetCustomClass": { - "methods": ["getCustomClass", "getCustomClass", "getCustomClass", "getCustomClassCallable"] - }, - "GetPhraseSet": { - "methods": ["getPhraseSet", "getPhraseSet", "getPhraseSet", "getPhraseSetCallable"] - }, - "ListCustomClasses": { - "methods": ["listCustomClasses", "listCustomClasses", "listCustomClasses", "listCustomClassesPagedCallable", "listCustomClassesCallable"] - }, - "ListPhraseSet": { - "methods": ["listPhraseSet", "listPhraseSet", "listPhraseSet", "listPhraseSetPagedCallable", "listPhraseSetCallable"] - }, - "UpdateCustomClass": { - "methods": ["updateCustomClass", "updateCustomClass", "updateCustomClassCallable"] - }, - "UpdatePhraseSet": { - "methods": ["updatePhraseSet", "updatePhraseSet", "updatePhraseSetCallable"] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java deleted file mode 100644 index e1d58a669454..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/package-info.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -/** - * The interfaces provided are listed below, along with usage samples. - * - *

======================= SpeechClient ======================= - * - *

Service Description: Service that implements Google Cloud Speech API. - * - *

Sample for SpeechClient: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (SpeechClient speechClient = SpeechClient.create()) {
- *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
- *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
- *   RecognizeResponse response = speechClient.recognize(config, audio);
- * }
- * }
- * - *

======================= AdaptationClient ======================= - * - *

Service Description: Service that implements Google Cloud Speech Adaptation API. - * - *

Sample for AdaptationClient: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * try (AdaptationClient adaptationClient = AdaptationClient.create()) {
- *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- *   PhraseSet phraseSet = PhraseSet.newBuilder().build();
- *   String phraseSetId = "phraseSetId959902180";
- *   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
- * }
- * }
- */ -@Generated("by gapic-generator-java") -package com.google.cloud.speech.v1p1beta1; - -import javax.annotation.Generated; diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java deleted file mode 100644 index 85fb550e2264..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStub.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub; - -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; -import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; -import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; -import com.google.cloud.speech.v1p1beta1.PhraseSet; -import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; -import com.google.protobuf.Empty; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Adaptation service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class AdaptationStub implements BackgroundResource { - - public UnaryCallable createPhraseSetCallable() { - throw new UnsupportedOperationException("Not implemented: createPhraseSetCallable()"); - } - - public UnaryCallable getPhraseSetCallable() { - throw new UnsupportedOperationException("Not implemented: getPhraseSetCallable()"); - } - - public UnaryCallable - listPhraseSetPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listPhraseSetPagedCallable()"); - } - - public UnaryCallable listPhraseSetCallable() { - throw new UnsupportedOperationException("Not implemented: listPhraseSetCallable()"); - } - - public UnaryCallable updatePhraseSetCallable() { - throw new UnsupportedOperationException("Not implemented: updatePhraseSetCallable()"); - } - - public UnaryCallable deletePhraseSetCallable() { - throw new UnsupportedOperationException("Not implemented: deletePhraseSetCallable()"); - } - - public UnaryCallable createCustomClassCallable() { - throw new UnsupportedOperationException("Not implemented: createCustomClassCallable()"); - } - - public UnaryCallable getCustomClassCallable() { - throw new UnsupportedOperationException("Not implemented: getCustomClassCallable()"); - } - - public UnaryCallable - listCustomClassesPagedCallable() { - throw new UnsupportedOperationException("Not implemented: listCustomClassesPagedCallable()"); - } - - public UnaryCallable - listCustomClassesCallable() { - throw new UnsupportedOperationException("Not implemented: listCustomClassesCallable()"); - } - - public UnaryCallable updateCustomClassCallable() { - throw new UnsupportedOperationException("Not implemented: updateCustomClassCallable()"); - } - - public UnaryCallable deleteCustomClassCallable() { - throw new UnsupportedOperationException("Not implemented: deleteCustomClassCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java deleted file mode 100644 index cc2dc2efee2b..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/AdaptationStubSettings.java +++ /dev/null @@ -1,670 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub; - -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.core.ApiFunction; -import com.google.api.core.ApiFuture; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiCallContext; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.PageContext; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.PagedListDescriptor; -import com.google.api.gax.rpc.PagedListResponseFactory; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; -import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; -import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; -import com.google.cloud.speech.v1p1beta1.PhraseSet; -import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.protobuf.Empty; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link AdaptationStub}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (speech.googleapis.com) and default port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of createPhraseSet to 30 seconds: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * AdaptationStubSettings.Builder adaptationSettingsBuilder = AdaptationStubSettings.newBuilder();
- * adaptationSettingsBuilder
- *     .createPhraseSetSettings()
- *     .setRetrySettings(
- *         adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * AdaptationStubSettings adaptationSettings = adaptationSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class AdaptationStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - - private final UnaryCallSettings createPhraseSetSettings; - private final UnaryCallSettings getPhraseSetSettings; - private final PagedCallSettings< - ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> - listPhraseSetSettings; - private final UnaryCallSettings updatePhraseSetSettings; - private final UnaryCallSettings deletePhraseSetSettings; - private final UnaryCallSettings createCustomClassSettings; - private final UnaryCallSettings getCustomClassSettings; - private final PagedCallSettings< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - listCustomClassesSettings; - private final UnaryCallSettings updateCustomClassSettings; - private final UnaryCallSettings deleteCustomClassSettings; - - private static final PagedListDescriptor - LIST_PHRASE_SET_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListPhraseSetRequest injectToken(ListPhraseSetRequest payload, String token) { - return ListPhraseSetRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListPhraseSetRequest injectPageSize(ListPhraseSetRequest payload, int pageSize) { - return ListPhraseSetRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListPhraseSetRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListPhraseSetResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListPhraseSetResponse payload) { - return payload.getPhraseSetsList() == null - ? ImmutableList.of() - : payload.getPhraseSetsList(); - } - }; - - private static final PagedListDescriptor< - ListCustomClassesRequest, ListCustomClassesResponse, CustomClass> - LIST_CUSTOM_CLASSES_PAGE_STR_DESC = - new PagedListDescriptor< - ListCustomClassesRequest, ListCustomClassesResponse, CustomClass>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListCustomClassesRequest injectToken( - ListCustomClassesRequest payload, String token) { - return ListCustomClassesRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListCustomClassesRequest injectPageSize( - ListCustomClassesRequest payload, int pageSize) { - return ListCustomClassesRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListCustomClassesRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListCustomClassesResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListCustomClassesResponse payload) { - return payload.getCustomClassesList() == null - ? ImmutableList.of() - : payload.getCustomClassesList(); - } - }; - - private static final PagedListResponseFactory< - ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> - LIST_PHRASE_SET_PAGE_STR_FACT = - new PagedListResponseFactory< - ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListPhraseSetRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_PHRASE_SET_PAGE_STR_DESC, request, context); - return ListPhraseSetPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - LIST_CUSTOM_CLASSES_PAGE_STR_FACT = - new PagedListResponseFactory< - ListCustomClassesRequest, - ListCustomClassesResponse, - ListCustomClassesPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListCustomClassesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext - pageContext = - PageContext.create( - callable, LIST_CUSTOM_CLASSES_PAGE_STR_DESC, request, context); - return ListCustomClassesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - /** Returns the object with the settings used for calls to createPhraseSet. */ - public UnaryCallSettings createPhraseSetSettings() { - return createPhraseSetSettings; - } - - /** Returns the object with the settings used for calls to getPhraseSet. */ - public UnaryCallSettings getPhraseSetSettings() { - return getPhraseSetSettings; - } - - /** Returns the object with the settings used for calls to listPhraseSet. */ - public PagedCallSettings - listPhraseSetSettings() { - return listPhraseSetSettings; - } - - /** Returns the object with the settings used for calls to updatePhraseSet. */ - public UnaryCallSettings updatePhraseSetSettings() { - return updatePhraseSetSettings; - } - - /** Returns the object with the settings used for calls to deletePhraseSet. */ - public UnaryCallSettings deletePhraseSetSettings() { - return deletePhraseSetSettings; - } - - /** Returns the object with the settings used for calls to createCustomClass. */ - public UnaryCallSettings createCustomClassSettings() { - return createCustomClassSettings; - } - - /** Returns the object with the settings used for calls to getCustomClass. */ - public UnaryCallSettings getCustomClassSettings() { - return getCustomClassSettings; - } - - /** Returns the object with the settings used for calls to listCustomClasses. */ - public PagedCallSettings< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - listCustomClassesSettings() { - return listCustomClassesSettings; - } - - /** Returns the object with the settings used for calls to updateCustomClass. */ - public UnaryCallSettings updateCustomClassSettings() { - return updateCustomClassSettings; - } - - /** Returns the object with the settings used for calls to deleteCustomClass. */ - public UnaryCallSettings deleteCustomClassSettings() { - return deleteCustomClassSettings; - } - - public AdaptationStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcAdaptationStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonAdaptationStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "speech.googleapis.com:443"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "speech.mtls.googleapis.com:443"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(AdaptationStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken( - "gapic", GaxProperties.getLibraryVersion(AdaptationStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return AdaptationStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected AdaptationStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - createPhraseSetSettings = settingsBuilder.createPhraseSetSettings().build(); - getPhraseSetSettings = settingsBuilder.getPhraseSetSettings().build(); - listPhraseSetSettings = settingsBuilder.listPhraseSetSettings().build(); - updatePhraseSetSettings = settingsBuilder.updatePhraseSetSettings().build(); - deletePhraseSetSettings = settingsBuilder.deletePhraseSetSettings().build(); - createCustomClassSettings = settingsBuilder.createCustomClassSettings().build(); - getCustomClassSettings = settingsBuilder.getCustomClassSettings().build(); - listCustomClassesSettings = settingsBuilder.listCustomClassesSettings().build(); - updateCustomClassSettings = settingsBuilder.updateCustomClassSettings().build(); - deleteCustomClassSettings = settingsBuilder.deleteCustomClassSettings().build(); - } - - /** Builder for AdaptationStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder - createPhraseSetSettings; - private final UnaryCallSettings.Builder getPhraseSetSettings; - private final PagedCallSettings.Builder< - ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> - listPhraseSetSettings; - private final UnaryCallSettings.Builder - updatePhraseSetSettings; - private final UnaryCallSettings.Builder deletePhraseSetSettings; - private final UnaryCallSettings.Builder - createCustomClassSettings; - private final UnaryCallSettings.Builder - getCustomClassSettings; - private final PagedCallSettings.Builder< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - listCustomClassesSettings; - private final UnaryCallSettings.Builder - updateCustomClassSettings; - private final UnaryCallSettings.Builder - deleteCustomClassSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - createPhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getPhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listPhraseSetSettings = PagedCallSettings.newBuilder(LIST_PHRASE_SET_PAGE_STR_FACT); - updatePhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deletePhraseSetSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listCustomClassesSettings = PagedCallSettings.newBuilder(LIST_CUSTOM_CLASSES_PAGE_STR_FACT); - updateCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteCustomClassSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createPhraseSetSettings, - getPhraseSetSettings, - listPhraseSetSettings, - updatePhraseSetSettings, - deletePhraseSetSettings, - createCustomClassSettings, - getCustomClassSettings, - listCustomClassesSettings, - updateCustomClassSettings, - deleteCustomClassSettings); - initDefaults(this); - } - - protected Builder(AdaptationStubSettings settings) { - super(settings); - - createPhraseSetSettings = settings.createPhraseSetSettings.toBuilder(); - getPhraseSetSettings = settings.getPhraseSetSettings.toBuilder(); - listPhraseSetSettings = settings.listPhraseSetSettings.toBuilder(); - updatePhraseSetSettings = settings.updatePhraseSetSettings.toBuilder(); - deletePhraseSetSettings = settings.deletePhraseSetSettings.toBuilder(); - createCustomClassSettings = settings.createCustomClassSettings.toBuilder(); - getCustomClassSettings = settings.getCustomClassSettings.toBuilder(); - listCustomClassesSettings = settings.listCustomClassesSettings.toBuilder(); - updateCustomClassSettings = settings.updateCustomClassSettings.toBuilder(); - deleteCustomClassSettings = settings.deleteCustomClassSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createPhraseSetSettings, - getPhraseSetSettings, - listPhraseSetSettings, - updatePhraseSetSettings, - deletePhraseSetSettings, - createCustomClassSettings, - getCustomClassSettings, - listCustomClassesSettings, - updateCustomClassSettings, - deleteCustomClassSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .createPhraseSetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getPhraseSetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .listPhraseSetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .updatePhraseSetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .deletePhraseSetSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .createCustomClassSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .getCustomClassSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .listCustomClassesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .updateCustomClassSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - builder - .deleteCustomClassSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); - - return builder; - } - - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to createPhraseSet. */ - public UnaryCallSettings.Builder createPhraseSetSettings() { - return createPhraseSetSettings; - } - - /** Returns the builder for the settings used for calls to getPhraseSet. */ - public UnaryCallSettings.Builder getPhraseSetSettings() { - return getPhraseSetSettings; - } - - /** Returns the builder for the settings used for calls to listPhraseSet. */ - public PagedCallSettings.Builder< - ListPhraseSetRequest, ListPhraseSetResponse, ListPhraseSetPagedResponse> - listPhraseSetSettings() { - return listPhraseSetSettings; - } - - /** Returns the builder for the settings used for calls to updatePhraseSet. */ - public UnaryCallSettings.Builder updatePhraseSetSettings() { - return updatePhraseSetSettings; - } - - /** Returns the builder for the settings used for calls to deletePhraseSet. */ - public UnaryCallSettings.Builder deletePhraseSetSettings() { - return deletePhraseSetSettings; - } - - /** Returns the builder for the settings used for calls to createCustomClass. */ - public UnaryCallSettings.Builder - createCustomClassSettings() { - return createCustomClassSettings; - } - - /** Returns the builder for the settings used for calls to getCustomClass. */ - public UnaryCallSettings.Builder getCustomClassSettings() { - return getCustomClassSettings; - } - - /** Returns the builder for the settings used for calls to listCustomClasses. */ - public PagedCallSettings.Builder< - ListCustomClassesRequest, ListCustomClassesResponse, ListCustomClassesPagedResponse> - listCustomClassesSettings() { - return listCustomClassesSettings; - } - - /** Returns the builder for the settings used for calls to updateCustomClass. */ - public UnaryCallSettings.Builder - updateCustomClassSettings() { - return updateCustomClassSettings; - } - - /** Returns the builder for the settings used for calls to deleteCustomClass. */ - public UnaryCallSettings.Builder deleteCustomClassSettings() { - return deleteCustomClassSettings; - } - - @Override - public AdaptationStubSettings build() throws IOException { - return new AdaptationStubSettings(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java deleted file mode 100644 index 8a8b43cf5078..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the Adaptation service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcAdaptationCallableFactory implements GrpcStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - GrpcCallSettings grpcCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - GrpcCallSettings grpcCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, callSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java deleted file mode 100644 index 526e244c2f61..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcAdaptationStub.java +++ /dev/null @@ -1,477 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub; - -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; -import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; -import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; -import com.google.cloud.speech.v1p1beta1.PhraseSet; -import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; -import com.google.common.collect.ImmutableMap; -import com.google.longrunning.stub.GrpcOperationsStub; -import com.google.protobuf.Empty; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Adaptation service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcAdaptationStub extends AdaptationStub { - private static final MethodDescriptor - createPhraseSetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/CreatePhraseSet") - .setRequestMarshaller( - ProtoUtils.marshaller(CreatePhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - getPhraseSetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/GetPhraseSet") - .setRequestMarshaller(ProtoUtils.marshaller(GetPhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listPhraseSetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/ListPhraseSet") - .setRequestMarshaller( - ProtoUtils.marshaller(ListPhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListPhraseSetResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - updatePhraseSetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/UpdatePhraseSet") - .setRequestMarshaller( - ProtoUtils.marshaller(UpdatePhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(PhraseSet.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - deletePhraseSetMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/DeletePhraseSet") - .setRequestMarshaller( - ProtoUtils.marshaller(DeletePhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - createCustomClassMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/CreateCustomClass") - .setRequestMarshaller( - ProtoUtils.marshaller(CreateCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - getCustomClassMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/GetCustomClass") - .setRequestMarshaller( - ProtoUtils.marshaller(GetCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - listCustomClassesMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/ListCustomClasses") - .setRequestMarshaller( - ProtoUtils.marshaller(ListCustomClassesRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(ListCustomClassesResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - updateCustomClassMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/UpdateCustomClass") - .setRequestMarshaller( - ProtoUtils.marshaller(UpdateCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(CustomClass.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - deleteCustomClassMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/DeleteCustomClass") - .setRequestMarshaller( - ProtoUtils.marshaller(DeleteCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) - .build(); - - private final UnaryCallable createPhraseSetCallable; - private final UnaryCallable getPhraseSetCallable; - private final UnaryCallable listPhraseSetCallable; - private final UnaryCallable - listPhraseSetPagedCallable; - private final UnaryCallable updatePhraseSetCallable; - private final UnaryCallable deletePhraseSetCallable; - private final UnaryCallable createCustomClassCallable; - private final UnaryCallable getCustomClassCallable; - private final UnaryCallable - listCustomClassesCallable; - private final UnaryCallable - listCustomClassesPagedCallable; - private final UnaryCallable updateCustomClassCallable; - private final UnaryCallable deleteCustomClassCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcAdaptationStub create(AdaptationStubSettings settings) - throws IOException { - return new GrpcAdaptationStub(settings, ClientContext.create(settings)); - } - - public static final GrpcAdaptationStub create(ClientContext clientContext) throws IOException { - return new GrpcAdaptationStub(AdaptationStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcAdaptationStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcAdaptationStub( - AdaptationStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcAdaptationStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected GrpcAdaptationStub(AdaptationStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcAdaptationCallableFactory()); - } - - /** - * Constructs an instance of GrpcAdaptationStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected GrpcAdaptationStub( - AdaptationStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings createPhraseSetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createPhraseSetMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings getPhraseSetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getPhraseSetMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings listPhraseSetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listPhraseSetMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings updatePhraseSetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updatePhraseSetMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("phrase_set.name", String.valueOf(request.getPhraseSet().getName())); - return params.build(); - }) - .build(); - GrpcCallSettings deletePhraseSetTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deletePhraseSetMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings createCustomClassTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(createCustomClassMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings getCustomClassTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(getCustomClassMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - GrpcCallSettings - listCustomClassesTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(listCustomClassesMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("parent", String.valueOf(request.getParent())); - return params.build(); - }) - .build(); - GrpcCallSettings updateCustomClassTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(updateCustomClassMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put( - "custom_class.name", String.valueOf(request.getCustomClass().getName())); - return params.build(); - }) - .build(); - GrpcCallSettings deleteCustomClassTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(deleteCustomClassMethodDescriptor) - .setParamsExtractor( - request -> { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("name", String.valueOf(request.getName())); - return params.build(); - }) - .build(); - - this.createPhraseSetCallable = - callableFactory.createUnaryCallable( - createPhraseSetTransportSettings, settings.createPhraseSetSettings(), clientContext); - this.getPhraseSetCallable = - callableFactory.createUnaryCallable( - getPhraseSetTransportSettings, settings.getPhraseSetSettings(), clientContext); - this.listPhraseSetCallable = - callableFactory.createUnaryCallable( - listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); - this.listPhraseSetPagedCallable = - callableFactory.createPagedCallable( - listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); - this.updatePhraseSetCallable = - callableFactory.createUnaryCallable( - updatePhraseSetTransportSettings, settings.updatePhraseSetSettings(), clientContext); - this.deletePhraseSetCallable = - callableFactory.createUnaryCallable( - deletePhraseSetTransportSettings, settings.deletePhraseSetSettings(), clientContext); - this.createCustomClassCallable = - callableFactory.createUnaryCallable( - createCustomClassTransportSettings, - settings.createCustomClassSettings(), - clientContext); - this.getCustomClassCallable = - callableFactory.createUnaryCallable( - getCustomClassTransportSettings, settings.getCustomClassSettings(), clientContext); - this.listCustomClassesCallable = - callableFactory.createUnaryCallable( - listCustomClassesTransportSettings, - settings.listCustomClassesSettings(), - clientContext); - this.listCustomClassesPagedCallable = - callableFactory.createPagedCallable( - listCustomClassesTransportSettings, - settings.listCustomClassesSettings(), - clientContext); - this.updateCustomClassCallable = - callableFactory.createUnaryCallable( - updateCustomClassTransportSettings, - settings.updateCustomClassSettings(), - clientContext); - this.deleteCustomClassCallable = - callableFactory.createUnaryCallable( - deleteCustomClassTransportSettings, - settings.deleteCustomClassSettings(), - clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable createPhraseSetCallable() { - return createPhraseSetCallable; - } - - @Override - public UnaryCallable getPhraseSetCallable() { - return getPhraseSetCallable; - } - - @Override - public UnaryCallable listPhraseSetCallable() { - return listPhraseSetCallable; - } - - @Override - public UnaryCallable - listPhraseSetPagedCallable() { - return listPhraseSetPagedCallable; - } - - @Override - public UnaryCallable updatePhraseSetCallable() { - return updatePhraseSetCallable; - } - - @Override - public UnaryCallable deletePhraseSetCallable() { - return deletePhraseSetCallable; - } - - @Override - public UnaryCallable createCustomClassCallable() { - return createCustomClassCallable; - } - - @Override - public UnaryCallable getCustomClassCallable() { - return getCustomClassCallable; - } - - @Override - public UnaryCallable - listCustomClassesCallable() { - return listCustomClassesCallable; - } - - @Override - public UnaryCallable - listCustomClassesPagedCallable() { - return listCustomClassesPagedCallable; - } - - @Override - public UnaryCallable updateCustomClassCallable() { - return updateCustomClassCallable; - } - - @Override - public UnaryCallable deleteCustomClassCallable() { - return deleteCustomClassCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java deleted file mode 100644 index 8b7dc082d62f..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechCallableFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcCallableFactory; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.ClientStreamingCallable; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC callable factory implementation for the Speech service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcSpeechCallableFactory implements GrpcStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - GrpcCallSettings grpcCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - GrpcCallSettings grpcCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - GrpcCallSettings grpcCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, callSettings, clientContext, operationsStub); - } - - @Override - public - BidiStreamingCallable createBidiStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } - - @Override - public - ClientStreamingCallable createClientStreamingCallable( - GrpcCallSettings grpcCallSettings, - StreamingCallSettings callSettings, - ClientContext clientContext) { - return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, callSettings, clientContext); - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java deleted file mode 100644 index b265cdb79674..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/GrpcSpeechStub.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.grpc.GrpcCallSettings; -import com.google.api.gax.grpc.GrpcStubCallableFactory; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.GrpcOperationsStub; -import io.grpc.MethodDescriptor; -import io.grpc.protobuf.ProtoUtils; -import java.io.IOException; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * gRPC stub implementation for the Speech service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class GrpcSpeechStub extends SpeechStub { - private static final MethodDescriptor - recognizeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/Recognize") - .setRequestMarshaller(ProtoUtils.marshaller(RecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(RecognizeResponse.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - longRunningRecognizeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.UNARY) - .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/LongRunningRecognize") - .setRequestMarshaller( - ProtoUtils.marshaller(LongRunningRecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) - .build(); - - private static final MethodDescriptor - streamingRecognizeMethodDescriptor = - MethodDescriptor.newBuilder() - .setType(MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/StreamingRecognize") - .setRequestMarshaller( - ProtoUtils.marshaller(StreamingRecognizeRequest.getDefaultInstance())) - .setResponseMarshaller( - ProtoUtils.marshaller(StreamingRecognizeResponse.getDefaultInstance())) - .build(); - - private final UnaryCallable recognizeCallable; - private final UnaryCallable longRunningRecognizeCallable; - private final OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable; - private final BidiStreamingCallable - streamingRecognizeCallable; - - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final GrpcStubCallableFactory callableFactory; - - public static final GrpcSpeechStub create(SpeechStubSettings settings) throws IOException { - return new GrpcSpeechStub(settings, ClientContext.create(settings)); - } - - public static final GrpcSpeechStub create(ClientContext clientContext) throws IOException { - return new GrpcSpeechStub(SpeechStubSettings.newBuilder().build(), clientContext); - } - - public static final GrpcSpeechStub create( - ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { - return new GrpcSpeechStub( - SpeechStubSettings.newBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new GrpcSpeechCallableFactory()); - } - - /** - * Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ - protected GrpcSpeechStub( - SpeechStubSettings settings, - ClientContext clientContext, - GrpcStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); - - GrpcCallSettings recognizeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(recognizeMethodDescriptor) - .build(); - GrpcCallSettings longRunningRecognizeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(longRunningRecognizeMethodDescriptor) - .build(); - GrpcCallSettings - streamingRecognizeTransportSettings = - GrpcCallSettings.newBuilder() - .setMethodDescriptor(streamingRecognizeMethodDescriptor) - .build(); - - this.recognizeCallable = - callableFactory.createUnaryCallable( - recognizeTransportSettings, settings.recognizeSettings(), clientContext); - this.longRunningRecognizeCallable = - callableFactory.createUnaryCallable( - longRunningRecognizeTransportSettings, - settings.longRunningRecognizeSettings(), - clientContext); - this.longRunningRecognizeOperationCallable = - callableFactory.createOperationCallable( - longRunningRecognizeTransportSettings, - settings.longRunningRecognizeOperationSettings(), - clientContext, - operationsStub); - this.streamingRecognizeCallable = - callableFactory.createBidiStreamingCallable( - streamingRecognizeTransportSettings, - settings.streamingRecognizeSettings(), - clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - public GrpcOperationsStub getOperationsStub() { - return operationsStub; - } - - @Override - public UnaryCallable recognizeCallable() { - return recognizeCallable; - } - - @Override - public UnaryCallable longRunningRecognizeCallable() { - return longRunningRecognizeCallable; - } - - @Override - public OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - return longRunningRecognizeOperationCallable; - } - - @Override - public BidiStreamingCallable - streamingRecognizeCallable() { - return streamingRecognizeCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationCallableFactory.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationCallableFactory.java deleted file mode 100644 index 85c896189cc1..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Adaptation service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonAdaptationCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationStub.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationStub.java deleted file mode 100644 index 0f5e1743cfdb..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonAdaptationStub.java +++ /dev/null @@ -1,695 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub; - -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; -import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; -import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; -import com.google.cloud.speech.v1p1beta1.PhraseSet; -import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; -import com.google.protobuf.Empty; -import com.google.protobuf.TypeRegistry; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Adaptation service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonAdaptationStub extends AdaptationStub { - private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build(); - - private static final ApiMethodDescriptor - createPhraseSetMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/CreatePhraseSet") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PhraseSet.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getPhraseSetMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/GetPhraseSet") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PhraseSet.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listPhraseSetMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/ListPhraseSet") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListPhraseSetResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - updatePhraseSetMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/UpdatePhraseSet") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1p1beta1/{phraseSet.name=projects/*/locations/*/phraseSets/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "phraseSet.name", request.getPhraseSet().getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("phraseSet", request.getPhraseSet(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(PhraseSet.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - deletePhraseSetMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/DeletePhraseSet") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - createCustomClassMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/CreateCustomClass") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1p1beta1/{parent=projects/*/locations/*}/customClasses", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().clearParent().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(CustomClass.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - getCustomClassMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/GetCustomClass") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(CustomClass.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - listCustomClassesMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/ListCustomClasses") - .setHttpMethod("GET") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1p1beta1/{parent=projects/*/locations/*}/customClasses", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "parent", request.getParent()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "pageSize", request.getPageSize()); - serializer.putQueryParam(fields, "pageToken", request.getPageToken()); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(ListCustomClassesResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - updateCustomClassMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/UpdateCustomClass") - .setHttpMethod("PATCH") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1p1beta1/{customClass.name=projects/*/locations/*/customClasses/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam( - fields, "customClass.name", request.getCustomClass().getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("customClass", request.getCustomClass(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(CustomClass.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - deleteCustomClassMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1p1beta1.Adaptation/DeleteCustomClass") - .setHttpMethod("DELETE") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - serializer.putPathParam(fields, "name", request.getName()); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor(request -> null) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Empty.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private final UnaryCallable createPhraseSetCallable; - private final UnaryCallable getPhraseSetCallable; - private final UnaryCallable listPhraseSetCallable; - private final UnaryCallable - listPhraseSetPagedCallable; - private final UnaryCallable updatePhraseSetCallable; - private final UnaryCallable deletePhraseSetCallable; - private final UnaryCallable createCustomClassCallable; - private final UnaryCallable getCustomClassCallable; - private final UnaryCallable - listCustomClassesCallable; - private final UnaryCallable - listCustomClassesPagedCallable; - private final UnaryCallable updateCustomClassCallable; - private final UnaryCallable deleteCustomClassCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonAdaptationStub create(AdaptationStubSettings settings) - throws IOException { - return new HttpJsonAdaptationStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonAdaptationStub create(ClientContext clientContext) - throws IOException { - return new HttpJsonAdaptationStub( - AdaptationStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonAdaptationStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonAdaptationStub( - AdaptationStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonAdaptationStub, using the given settings. This is protected - * so that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected HttpJsonAdaptationStub(AdaptationStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonAdaptationCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonAdaptationStub, using the given settings. This is protected - * so that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected HttpJsonAdaptationStub( - AdaptationStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - - HttpJsonCallSettings createPhraseSetTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createPhraseSetMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getPhraseSetTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getPhraseSetMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - listPhraseSetTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listPhraseSetMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings updatePhraseSetTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updatePhraseSetMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deletePhraseSetTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deletePhraseSetMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings createCustomClassTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(createCustomClassMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings getCustomClassTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(getCustomClassMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - listCustomClassesTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(listCustomClassesMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings updateCustomClassTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(updateCustomClassMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings deleteCustomClassTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(deleteCustomClassMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.createPhraseSetCallable = - callableFactory.createUnaryCallable( - createPhraseSetTransportSettings, settings.createPhraseSetSettings(), clientContext); - this.getPhraseSetCallable = - callableFactory.createUnaryCallable( - getPhraseSetTransportSettings, settings.getPhraseSetSettings(), clientContext); - this.listPhraseSetCallable = - callableFactory.createUnaryCallable( - listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); - this.listPhraseSetPagedCallable = - callableFactory.createPagedCallable( - listPhraseSetTransportSettings, settings.listPhraseSetSettings(), clientContext); - this.updatePhraseSetCallable = - callableFactory.createUnaryCallable( - updatePhraseSetTransportSettings, settings.updatePhraseSetSettings(), clientContext); - this.deletePhraseSetCallable = - callableFactory.createUnaryCallable( - deletePhraseSetTransportSettings, settings.deletePhraseSetSettings(), clientContext); - this.createCustomClassCallable = - callableFactory.createUnaryCallable( - createCustomClassTransportSettings, - settings.createCustomClassSettings(), - clientContext); - this.getCustomClassCallable = - callableFactory.createUnaryCallable( - getCustomClassTransportSettings, settings.getCustomClassSettings(), clientContext); - this.listCustomClassesCallable = - callableFactory.createUnaryCallable( - listCustomClassesTransportSettings, - settings.listCustomClassesSettings(), - clientContext); - this.listCustomClassesPagedCallable = - callableFactory.createPagedCallable( - listCustomClassesTransportSettings, - settings.listCustomClassesSettings(), - clientContext); - this.updateCustomClassCallable = - callableFactory.createUnaryCallable( - updateCustomClassTransportSettings, - settings.updateCustomClassSettings(), - clientContext); - this.deleteCustomClassCallable = - callableFactory.createUnaryCallable( - deleteCustomClassTransportSettings, - settings.deleteCustomClassSettings(), - clientContext); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(createPhraseSetMethodDescriptor); - methodDescriptors.add(getPhraseSetMethodDescriptor); - methodDescriptors.add(listPhraseSetMethodDescriptor); - methodDescriptors.add(updatePhraseSetMethodDescriptor); - methodDescriptors.add(deletePhraseSetMethodDescriptor); - methodDescriptors.add(createCustomClassMethodDescriptor); - methodDescriptors.add(getCustomClassMethodDescriptor); - methodDescriptors.add(listCustomClassesMethodDescriptor); - methodDescriptors.add(updateCustomClassMethodDescriptor); - methodDescriptors.add(deleteCustomClassMethodDescriptor); - return methodDescriptors; - } - - @Override - public UnaryCallable createPhraseSetCallable() { - return createPhraseSetCallable; - } - - @Override - public UnaryCallable getPhraseSetCallable() { - return getPhraseSetCallable; - } - - @Override - public UnaryCallable listPhraseSetCallable() { - return listPhraseSetCallable; - } - - @Override - public UnaryCallable - listPhraseSetPagedCallable() { - return listPhraseSetPagedCallable; - } - - @Override - public UnaryCallable updatePhraseSetCallable() { - return updatePhraseSetCallable; - } - - @Override - public UnaryCallable deletePhraseSetCallable() { - return deletePhraseSetCallable; - } - - @Override - public UnaryCallable createCustomClassCallable() { - return createCustomClassCallable; - } - - @Override - public UnaryCallable getCustomClassCallable() { - return getCustomClassCallable; - } - - @Override - public UnaryCallable - listCustomClassesCallable() { - return listCustomClassesCallable; - } - - @Override - public UnaryCallable - listCustomClassesPagedCallable() { - return listCustomClassesPagedCallable; - } - - @Override - public UnaryCallable updateCustomClassCallable() { - return updateCustomClassCallable; - } - - @Override - public UnaryCallable deleteCustomClassCallable() { - return deleteCustomClassCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechCallableFactory.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechCallableFactory.java deleted file mode 100644 index 008215d4f8b4..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechCallableFactory.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonCallableFactory; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; -import com.google.api.gax.rpc.BatchingCallSettings; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.PagedCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallSettings; -import com.google.api.gax.rpc.ServerStreamingCallable; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.longrunning.Operation; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST callable factory implementation for the Speech service API. - * - *

This class is for advanced usage. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonSpeechCallableFactory - implements HttpJsonStubCallableFactory { - - @Override - public UnaryCallable createUnaryCallable( - HttpJsonCallSettings httpJsonCallSettings, - UnaryCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createUnaryCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public - UnaryCallable createPagedCallable( - HttpJsonCallSettings httpJsonCallSettings, - PagedCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createPagedCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @Override - public UnaryCallable createBatchingCallable( - HttpJsonCallSettings httpJsonCallSettings, - BatchingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createBatchingCallable( - httpJsonCallSettings, callSettings, clientContext); - } - - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") - @Override - public - OperationCallable createOperationCallable( - HttpJsonCallSettings httpJsonCallSettings, - OperationCallSettings callSettings, - ClientContext clientContext, - OperationsStub operationsStub) { - UnaryCallable innerCallable = - HttpJsonCallableFactory.createBaseUnaryCallable( - httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); - HttpJsonOperationSnapshotCallable initialCallable = - new HttpJsonOperationSnapshotCallable( - innerCallable, - httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); - return HttpJsonCallableFactory.createOperationCallable( - callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); - } - - @Override - public - ServerStreamingCallable createServerStreamingCallable( - HttpJsonCallSettings httpJsonCallSettings, - ServerStreamingCallSettings callSettings, - ClientContext clientContext) { - return HttpJsonCallableFactory.createServerStreamingCallable( - httpJsonCallSettings, callSettings, clientContext); - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechStub.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechStub.java deleted file mode 100644 index bd3f8465a503..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/HttpJsonSpeechStub.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.core.InternalApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.core.BackgroundResourceAggregation; -import com.google.api.gax.httpjson.ApiMethodDescriptor; -import com.google.api.gax.httpjson.HttpJsonCallSettings; -import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; -import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; -import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; -import com.google.api.gax.httpjson.ProtoMessageResponseParser; -import com.google.api.gax.httpjson.ProtoRestSerializer; -import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.longrunning.Operation; -import com.google.protobuf.TypeRegistry; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.TimeUnit; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * REST stub implementation for the Speech service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public class HttpJsonSpeechStub extends SpeechStub { - private static final TypeRegistry typeRegistry = - TypeRegistry.newBuilder() - .add(LongRunningRecognizeResponse.getDescriptor()) - .add(LongRunningRecognizeMetadata.getDescriptor()) - .build(); - - private static final ApiMethodDescriptor - recognizeMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/Recognize") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1p1beta1/speech:recognize", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(RecognizeResponse.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .build(); - - private static final ApiMethodDescriptor - longRunningRecognizeMethodDescriptor = - ApiMethodDescriptor.newBuilder() - .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/LongRunningRecognize") - .setHttpMethod("POST") - .setType(ApiMethodDescriptor.MethodType.UNARY) - .setRequestFormatter( - ProtoMessageRequestFormatter.newBuilder() - .setPath( - "/v1p1beta1/speech:longrunningrecognize", - request -> { - Map fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setQueryParamsExtractor( - request -> { - Map> fields = new HashMap<>(); - ProtoRestSerializer serializer = - ProtoRestSerializer.create(); - return fields; - }) - .setRequestBodyExtractor( - request -> - ProtoRestSerializer.create() - .toBody("*", request.toBuilder().build(), false)) - .build()) - .setResponseParser( - ProtoMessageResponseParser.newBuilder() - .setDefaultInstance(Operation.getDefaultInstance()) - .setDefaultTypeRegistry(typeRegistry) - .build()) - .setOperationSnapshotFactory( - (LongRunningRecognizeRequest request, Operation response) -> - HttpJsonOperationSnapshot.create(response)) - .build(); - - private final UnaryCallable recognizeCallable; - private final UnaryCallable longRunningRecognizeCallable; - private final OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable; - - private final BackgroundResource backgroundResources; - private final HttpJsonOperationsStub httpJsonOperationsStub; - private final HttpJsonStubCallableFactory callableFactory; - - public static final HttpJsonSpeechStub create(SpeechStubSettings settings) throws IOException { - return new HttpJsonSpeechStub(settings, ClientContext.create(settings)); - } - - public static final HttpJsonSpeechStub create(ClientContext clientContext) throws IOException { - return new HttpJsonSpeechStub(SpeechStubSettings.newHttpJsonBuilder().build(), clientContext); - } - - public static final HttpJsonSpeechStub create( - ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { - return new HttpJsonSpeechStub( - SpeechStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); - } - - /** - * Constructs an instance of HttpJsonSpeechStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext) - throws IOException { - this(settings, clientContext, new HttpJsonSpeechCallableFactory()); - } - - /** - * Constructs an instance of HttpJsonSpeechStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ - protected HttpJsonSpeechStub( - SpeechStubSettings settings, - ClientContext clientContext, - HttpJsonStubCallableFactory callableFactory) - throws IOException { - this.callableFactory = callableFactory; - this.httpJsonOperationsStub = - HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); - - HttpJsonCallSettings recognizeTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(recognizeMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - HttpJsonCallSettings - longRunningRecognizeTransportSettings = - HttpJsonCallSettings.newBuilder() - .setMethodDescriptor(longRunningRecognizeMethodDescriptor) - .setTypeRegistry(typeRegistry) - .build(); - - this.recognizeCallable = - callableFactory.createUnaryCallable( - recognizeTransportSettings, settings.recognizeSettings(), clientContext); - this.longRunningRecognizeCallable = - callableFactory.createUnaryCallable( - longRunningRecognizeTransportSettings, - settings.longRunningRecognizeSettings(), - clientContext); - this.longRunningRecognizeOperationCallable = - callableFactory.createOperationCallable( - longRunningRecognizeTransportSettings, - settings.longRunningRecognizeOperationSettings(), - clientContext, - httpJsonOperationsStub); - - this.backgroundResources = - new BackgroundResourceAggregation(clientContext.getBackgroundResources()); - } - - @InternalApi - public static List getMethodDescriptors() { - List methodDescriptors = new ArrayList<>(); - methodDescriptors.add(recognizeMethodDescriptor); - methodDescriptors.add(longRunningRecognizeMethodDescriptor); - return methodDescriptors; - } - - public HttpJsonOperationsStub getHttpJsonOperationsStub() { - return httpJsonOperationsStub; - } - - @Override - public UnaryCallable recognizeCallable() { - return recognizeCallable; - } - - @Override - public UnaryCallable longRunningRecognizeCallable() { - return longRunningRecognizeCallable; - } - - @Override - public OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - return longRunningRecognizeOperationCallable; - } - - @Override - public final void close() { - try { - backgroundResources.close(); - } catch (RuntimeException e) { - throw e; - } catch (Exception e) { - throw new IllegalStateException("Failed to close resource", e); - } - } - - @Override - public void shutdown() { - backgroundResources.shutdown(); - } - - @Override - public boolean isShutdown() { - return backgroundResources.isShutdown(); - } - - @Override - public boolean isTerminated() { - return backgroundResources.isTerminated(); - } - - @Override - public void shutdownNow() { - backgroundResources.shutdownNow(); - } - - @Override - public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { - return backgroundResources.awaitTermination(duration, unit); - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java deleted file mode 100644 index 2adbabc73a2f..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStub.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub; - -import com.google.api.core.BetaApi; -import com.google.api.gax.core.BackgroundResource; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.OperationCallable; -import com.google.api.gax.rpc.UnaryCallable; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; -import com.google.longrunning.Operation; -import com.google.longrunning.stub.OperationsStub; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Base stub class for the Speech service API. - * - *

This class is for advanced usage and reflects the underlying API directly. - */ -@BetaApi -@Generated("by gapic-generator-java") -public abstract class SpeechStub implements BackgroundResource { - - public OperationsStub getOperationsStub() { - return null; - } - - public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { - return null; - } - - public UnaryCallable recognizeCallable() { - throw new UnsupportedOperationException("Not implemented: recognizeCallable()"); - } - - public OperationCallable< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationCallable() { - throw new UnsupportedOperationException( - "Not implemented: longRunningRecognizeOperationCallable()"); - } - - public UnaryCallable longRunningRecognizeCallable() { - throw new UnsupportedOperationException("Not implemented: longRunningRecognizeCallable()"); - } - - public BidiStreamingCallable - streamingRecognizeCallable() { - throw new UnsupportedOperationException("Not implemented: streamingRecognizeCallable()"); - } - - @Override - public abstract void close(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStubSettings.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStubSettings.java deleted file mode 100644 index c8187b4bd3b9..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/main/java/com/google/cloud/speech/v1p1beta1/stub/SpeechStubSettings.java +++ /dev/null @@ -1,441 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub; - -import com.google.api.core.ApiFunction; -import com.google.api.core.BetaApi; -import com.google.api.gax.core.GaxProperties; -import com.google.api.gax.core.GoogleCredentialsProvider; -import com.google.api.gax.core.InstantiatingExecutorProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.GrpcTransportChannel; -import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; -import com.google.api.gax.grpc.ProtoOperationTransformers; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.HttpJsonTransportChannel; -import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; -import com.google.api.gax.longrunning.OperationSnapshot; -import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; -import com.google.api.gax.retrying.RetrySettings; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ClientContext; -import com.google.api.gax.rpc.OperationCallSettings; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.StreamingCallSettings; -import com.google.api.gax.rpc.StubSettings; -import com.google.api.gax.rpc.TransportChannelProvider; -import com.google.api.gax.rpc.UnaryCallSettings; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Lists; -import com.google.longrunning.Operation; -import java.io.IOException; -import java.util.List; -import javax.annotation.Generated; -import org.threeten.bp.Duration; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -/** - * Settings class to configure an instance of {@link SpeechStub}. - * - *

The default instance has everything set to sensible defaults: - * - *

    - *
  • The default service address (speech.googleapis.com) and default port (443) are used. - *
  • Credentials are acquired automatically through Application Default Credentials. - *
  • Retries are configured for idempotent methods but not for non-idempotent methods. - *
- * - *

The builder of this class is recursive, so contained classes are themselves builders. When - * build() is called, the tree of builders is called to create the complete settings object. - * - *

For example, to set the total timeout of recognize to 30 seconds: - * - *

{@code
- * // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
- * SpeechStubSettings.Builder speechSettingsBuilder = SpeechStubSettings.newBuilder();
- * speechSettingsBuilder
- *     .recognizeSettings()
- *     .setRetrySettings(
- *         speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder()
- *             .setTotalTimeout(Duration.ofSeconds(30))
- *             .build());
- * SpeechStubSettings speechSettings = speechSettingsBuilder.build();
- * }
- */ -@BetaApi -@Generated("by gapic-generator-java") -public class SpeechStubSettings extends StubSettings { - /** The default scopes of the service. */ - private static final ImmutableList DEFAULT_SERVICE_SCOPES = - ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); - - private final UnaryCallSettings recognizeSettings; - private final UnaryCallSettings - longRunningRecognizeSettings; - private final OperationCallSettings< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings; - private final StreamingCallSettings - streamingRecognizeSettings; - - /** Returns the object with the settings used for calls to recognize. */ - public UnaryCallSettings recognizeSettings() { - return recognizeSettings; - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings longRunningRecognizeSettings() { - return longRunningRecognizeSettings; - } - - /** Returns the object with the settings used for calls to longRunningRecognize. */ - public OperationCallSettings< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return longRunningRecognizeOperationSettings; - } - - /** Returns the object with the settings used for calls to streamingRecognize. */ - public StreamingCallSettings - streamingRecognizeSettings() { - return streamingRecognizeSettings; - } - - public SpeechStub createStub() throws IOException { - if (getTransportChannelProvider() - .getTransportName() - .equals(GrpcTransportChannel.getGrpcTransportName())) { - return GrpcSpeechStub.create(this); - } - if (getTransportChannelProvider() - .getTransportName() - .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { - return HttpJsonSpeechStub.create(this); - } - throw new UnsupportedOperationException( - String.format( - "Transport not supported: %s", getTransportChannelProvider().getTransportName())); - } - - /** Returns a builder for the default ExecutorProvider for this service. */ - public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { - return InstantiatingExecutorProvider.newBuilder(); - } - - /** Returns the default service endpoint. */ - public static String getDefaultEndpoint() { - return "speech.googleapis.com:443"; - } - - /** Returns the default mTLS service endpoint. */ - public static String getDefaultMtlsEndpoint() { - return "speech.mtls.googleapis.com:443"; - } - - /** Returns the default service scopes. */ - public static List getDefaultServiceScopes() { - return DEFAULT_SERVICE_SCOPES; - } - - /** Returns a builder for the default credentials for this service. */ - public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { - return GoogleCredentialsProvider.newBuilder() - .setScopesToApply(DEFAULT_SERVICE_SCOPES) - .setUseJwtAccessWithScope(true); - } - - /** Returns a builder for the default gRPC ChannelProvider for this service. */ - public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { - return InstantiatingGrpcChannelProvider.newBuilder() - .setMaxInboundMessageSize(Integer.MAX_VALUE); - } - - /** Returns a builder for the default REST ChannelProvider for this service. */ - @BetaApi - public static InstantiatingHttpJsonChannelProvider.Builder - defaultHttpJsonTransportProviderBuilder() { - return InstantiatingHttpJsonChannelProvider.newBuilder(); - } - - public static TransportChannelProvider defaultTransportChannelProvider() { - return defaultGrpcTransportProviderBuilder().build(); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SpeechStubSettings.class)) - .setTransportToken( - GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); - } - - @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { - return ApiClientHeaderProvider.newBuilder() - .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SpeechStubSettings.class)) - .setTransportToken( - GaxHttpJsonProperties.getHttpJsonTokenName(), - GaxHttpJsonProperties.getHttpJsonVersion()); - } - - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { - return SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); - } - - /** Returns a new gRPC builder for this class. */ - public static Builder newBuilder() { - return Builder.createDefault(); - } - - /** Returns a new REST builder for this class. */ - public static Builder newHttpJsonBuilder() { - return Builder.createHttpJsonDefault(); - } - - /** Returns a new builder for this class. */ - public static Builder newBuilder(ClientContext clientContext) { - return new Builder(clientContext); - } - - /** Returns a builder containing all the values of this settings class. */ - public Builder toBuilder() { - return new Builder(this); - } - - protected SpeechStubSettings(Builder settingsBuilder) throws IOException { - super(settingsBuilder); - - recognizeSettings = settingsBuilder.recognizeSettings().build(); - longRunningRecognizeSettings = settingsBuilder.longRunningRecognizeSettings().build(); - longRunningRecognizeOperationSettings = - settingsBuilder.longRunningRecognizeOperationSettings().build(); - streamingRecognizeSettings = settingsBuilder.streamingRecognizeSettings().build(); - } - - /** Builder for SpeechStubSettings. */ - public static class Builder extends StubSettings.Builder { - private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder recognizeSettings; - private final UnaryCallSettings.Builder - longRunningRecognizeSettings; - private final OperationCallSettings.Builder< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings; - private final StreamingCallSettings.Builder< - StreamingRecognizeRequest, StreamingRecognizeResponse> - streamingRecognizeSettings; - private static final ImmutableMap> - RETRYABLE_CODE_DEFINITIONS; - - static { - ImmutableMap.Builder> definitions = - ImmutableMap.builder(); - definitions.put( - "retry_policy_0_codes", - ImmutableSet.copyOf( - Lists.newArrayList( - StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); - RETRYABLE_CODE_DEFINITIONS = definitions.build(); - } - - private static final ImmutableMap RETRY_PARAM_DEFINITIONS; - - static { - ImmutableMap.Builder definitions = ImmutableMap.builder(); - RetrySettings settings = null; - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(5000000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000000L)) - .setTotalTimeout(Duration.ofMillis(5000000L)) - .build(); - definitions.put("retry_policy_0_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(5000000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(5000000L)) - .setTotalTimeout(Duration.ofMillis(5000000L)) - .build(); - definitions.put("no_retry_1_params", settings); - RETRY_PARAM_DEFINITIONS = definitions.build(); - } - - protected Builder() { - this(((ClientContext) null)); - } - - protected Builder(ClientContext clientContext) { - super(clientContext); - - recognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - longRunningRecognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - longRunningRecognizeOperationSettings = OperationCallSettings.newBuilder(); - streamingRecognizeSettings = StreamingCallSettings.newBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - recognizeSettings, longRunningRecognizeSettings); - initDefaults(this); - } - - protected Builder(SpeechStubSettings settings) { - super(settings); - - recognizeSettings = settings.recognizeSettings.toBuilder(); - longRunningRecognizeSettings = settings.longRunningRecognizeSettings.toBuilder(); - longRunningRecognizeOperationSettings = - settings.longRunningRecognizeOperationSettings.toBuilder(); - streamingRecognizeSettings = settings.streamingRecognizeSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - recognizeSettings, longRunningRecognizeSettings); - } - - private static Builder createDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultTransportChannelProvider()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder createHttpJsonDefault() { - Builder builder = new Builder(((ClientContext) null)); - - builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); - builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); - builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); - builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); - builder.setSwitchToMtlsEndpointAllowed(true); - - return initDefaults(builder); - } - - private static Builder initDefaults(Builder builder) { - builder - .recognizeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); - - builder - .longRunningRecognizeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); - - builder - .longRunningRecognizeOperationSettings() - .setInitialCallSettings( - UnaryCallSettings - .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) - .build()) - .setResponseTransformer( - ProtoOperationTransformers.ResponseTransformer.create( - LongRunningRecognizeResponse.class)) - .setMetadataTransformer( - ProtoOperationTransformers.MetadataTransformer.create( - LongRunningRecognizeMetadata.class)) - .setPollingAlgorithm( - OperationTimedPollAlgorithm.create( - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(5000L)) - .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(45000L)) - .setInitialRpcTimeout(Duration.ZERO) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ZERO) - .setTotalTimeout(Duration.ofMillis(300000L)) - .build())); - - return builder; - } - - /** - * Applies the given settings updater function to all of the unary API methods in this service. - * - *

Note: This method does not support applying settings to streaming methods. - */ - public Builder applyToAllUnaryMethods( - ApiFunction, Void> settingsUpdater) { - super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); - return this; - } - - public ImmutableList> unaryMethodSettingsBuilders() { - return unaryMethodSettingsBuilders; - } - - /** Returns the builder for the settings used for calls to recognize. */ - public UnaryCallSettings.Builder recognizeSettings() { - return recognizeSettings; - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - public UnaryCallSettings.Builder - longRunningRecognizeSettings() { - return longRunningRecognizeSettings; - } - - /** Returns the builder for the settings used for calls to longRunningRecognize. */ - @BetaApi( - "The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallSettings.Builder< - LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> - longRunningRecognizeOperationSettings() { - return longRunningRecognizeOperationSettings; - } - - /** Returns the builder for the settings used for calls to streamingRecognize. */ - public StreamingCallSettings.Builder - streamingRecognizeSettings() { - return streamingRecognizeSettings; - } - - @Override - public SpeechStubSettings build() throws IOException { - return new SpeechStubSettings(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientHttpJsonTest.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientHttpJsonTest.java deleted file mode 100644 index 0b485e3a8bbc..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientHttpJsonTest.java +++ /dev/null @@ -1,940 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.cloud.speech.v1p1beta1.stub.HttpJsonAdaptationStub; -import com.google.common.collect.Lists; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class AdaptationClientHttpJsonTest { - private static MockHttpService mockService; - private static AdaptationClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonAdaptationStub.getMethodDescriptors(), AdaptationSettings.getDefaultEndpoint()); - AdaptationSettings settings = - AdaptationSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - AdaptationSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = AdaptationClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void createPhraseSetTest() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - - PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createPhraseSetExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createPhraseSetTest2() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-5833/locations/location-5833"; - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - - PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createPhraseSetExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "projects/project-5833/locations/location-5833"; - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getPhraseSetTest() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockService.addResponse(expectedResponse); - - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - - PhraseSet actualResponse = client.getPhraseSet(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getPhraseSetExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - client.getPhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getPhraseSetTest2() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; - - PhraseSet actualResponse = client.getPhraseSet(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getPhraseSetExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; - client.getPhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listPhraseSetTest() throws Exception { - PhraseSet responsesElement = PhraseSet.newBuilder().build(); - ListPhraseSetResponse expectedResponse = - ListPhraseSetResponse.newBuilder() - .setNextPageToken("") - .addAllPhraseSets(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listPhraseSetExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listPhraseSet(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listPhraseSetTest2() throws Exception { - PhraseSet responsesElement = PhraseSet.newBuilder().build(); - ListPhraseSetResponse expectedResponse = - ListPhraseSetResponse.newBuilder() - .setNextPageToken("") - .addAllPhraseSets(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-5833/locations/location-5833"; - - ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listPhraseSetExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "projects/project-5833/locations/location-5833"; - client.listPhraseSet(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updatePhraseSetTest() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockService.addResponse(expectedResponse); - - PhraseSet phraseSet = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - PhraseSet actualResponse = client.updatePhraseSet(phraseSet, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updatePhraseSetExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - PhraseSet phraseSet = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updatePhraseSet(phraseSet, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deletePhraseSetTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - - client.deletePhraseSet(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deletePhraseSetExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - client.deletePhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deletePhraseSetTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; - - client.deletePhraseSet(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deletePhraseSetExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-458/locations/location-458/phraseSets/phraseSet-458"; - client.deletePhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createCustomClassTest() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - - CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createCustomClassExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - client.createCustomClass(parent, customClass, customClassId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createCustomClassTest2() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-5833/locations/location-5833"; - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - - CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void createCustomClassExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "projects/project-5833/locations/location-5833"; - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - client.createCustomClass(parent, customClass, customClassId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getCustomClassTest() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - - CustomClass actualResponse = client.getCustomClass(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getCustomClassExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - client.getCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getCustomClassTest2() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; - - CustomClass actualResponse = client.getCustomClass(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void getCustomClassExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; - client.getCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listCustomClassesTest() throws Exception { - CustomClass responsesElement = CustomClass.newBuilder().build(); - ListCustomClassesResponse expectedResponse = - ListCustomClassesResponse.newBuilder() - .setNextPageToken("") - .addAllCustomClasses(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listCustomClassesExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listCustomClasses(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listCustomClassesTest2() throws Exception { - CustomClass responsesElement = CustomClass.newBuilder().build(); - ListCustomClassesResponse expectedResponse = - ListCustomClassesResponse.newBuilder() - .setNextPageToken("") - .addAllCustomClasses(Arrays.asList(responsesElement)) - .build(); - mockService.addResponse(expectedResponse); - - String parent = "projects/project-5833/locations/location-5833"; - - ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void listCustomClassesExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String parent = "projects/project-5833/locations/location-5833"; - client.listCustomClasses(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateCustomClassTest() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockService.addResponse(expectedResponse); - - CustomClass customClass = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - CustomClass actualResponse = client.updateCustomClass(customClass, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void updateCustomClassExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - CustomClass customClass = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateCustomClass(customClass, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteCustomClassTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - - client.deleteCustomClass(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteCustomClassExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - client.deleteCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteCustomClassTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockService.addResponse(expectedResponse); - - String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; - - client.deleteCustomClass(name); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void deleteCustomClassExceptionTest2() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - String name = "projects/project-4379/locations/location-4379/customClasses/customClasse-4379"; - client.deleteCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java deleted file mode 100644 index 91bc9ae371e7..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/AdaptationClientTest.java +++ /dev/null @@ -1,826 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListCustomClassesPagedResponse; -import static com.google.cloud.speech.v1p1beta1.AdaptationClient.ListPhraseSetPagedResponse; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.common.collect.Lists; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import com.google.protobuf.FieldMask; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class AdaptationClientTest { - private static MockAdaptation mockAdaptation; - private static MockServiceHelper mockServiceHelper; - private LocalChannelProvider channelProvider; - private AdaptationClient client; - - @BeforeClass - public static void startStaticServer() { - mockAdaptation = new MockAdaptation(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockAdaptation)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - AdaptationSettings settings = - AdaptationSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = AdaptationClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void createPhraseSetTest() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockAdaptation.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - - PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreatePhraseSetRequest actualRequest = ((CreatePhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); - Assert.assertEquals(phraseSetId, actualRequest.getPhraseSetId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createPhraseSetExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createPhraseSetTest2() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockAdaptation.addResponse(expectedResponse); - - String parent = "parent-995424086"; - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - - PhraseSet actualResponse = client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreatePhraseSetRequest actualRequest = ((CreatePhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); - Assert.assertEquals(phraseSetId, actualRequest.getPhraseSetId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createPhraseSetExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String parent = "parent-995424086"; - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - client.createPhraseSet(parent, phraseSet, phraseSetId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getPhraseSetTest() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockAdaptation.addResponse(expectedResponse); - - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - - PhraseSet actualResponse = client.getPhraseSet(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetPhraseSetRequest actualRequest = ((GetPhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getPhraseSetExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - client.getPhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getPhraseSetTest2() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockAdaptation.addResponse(expectedResponse); - - String name = "name3373707"; - - PhraseSet actualResponse = client.getPhraseSet(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetPhraseSetRequest actualRequest = ((GetPhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getPhraseSetExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String name = "name3373707"; - client.getPhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listPhraseSetTest() throws Exception { - PhraseSet responsesElement = PhraseSet.newBuilder().build(); - ListPhraseSetResponse expectedResponse = - ListPhraseSetResponse.newBuilder() - .setNextPageToken("") - .addAllPhraseSets(Arrays.asList(responsesElement)) - .build(); - mockAdaptation.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListPhraseSetRequest actualRequest = ((ListPhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listPhraseSetExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listPhraseSet(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listPhraseSetTest2() throws Exception { - PhraseSet responsesElement = PhraseSet.newBuilder().build(); - ListPhraseSetResponse expectedResponse = - ListPhraseSetResponse.newBuilder() - .setNextPageToken("") - .addAllPhraseSets(Arrays.asList(responsesElement)) - .build(); - mockAdaptation.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - ListPhraseSetPagedResponse pagedListResponse = client.listPhraseSet(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getPhraseSetsList().get(0), resources.get(0)); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListPhraseSetRequest actualRequest = ((ListPhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listPhraseSetExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String parent = "parent-995424086"; - client.listPhraseSet(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updatePhraseSetTest() throws Exception { - PhraseSet expectedResponse = - PhraseSet.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .addAllPhrases(new ArrayList()) - .setBoost(93922211) - .build(); - mockAdaptation.addResponse(expectedResponse); - - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - PhraseSet actualResponse = client.updatePhraseSet(phraseSet, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdatePhraseSetRequest actualRequest = ((UpdatePhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(phraseSet, actualRequest.getPhraseSet()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updatePhraseSetExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updatePhraseSet(phraseSet, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deletePhraseSetTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockAdaptation.addResponse(expectedResponse); - - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - - client.deletePhraseSet(name); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeletePhraseSetRequest actualRequest = ((DeletePhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deletePhraseSetExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - client.deletePhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deletePhraseSetTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockAdaptation.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deletePhraseSet(name); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeletePhraseSetRequest actualRequest = ((DeletePhraseSetRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deletePhraseSetExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String name = "name3373707"; - client.deletePhraseSet(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createCustomClassTest() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockAdaptation.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - - CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateCustomClassRequest actualRequest = ((CreateCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertEquals(customClass, actualRequest.getCustomClass()); - Assert.assertEquals(customClassId, actualRequest.getCustomClassId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createCustomClassExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - client.createCustomClass(parent, customClass, customClassId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void createCustomClassTest2() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockAdaptation.addResponse(expectedResponse); - - String parent = "parent-995424086"; - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - - CustomClass actualResponse = client.createCustomClass(parent, customClass, customClassId); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - CreateCustomClassRequest actualRequest = ((CreateCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertEquals(customClass, actualRequest.getCustomClass()); - Assert.assertEquals(customClassId, actualRequest.getCustomClassId()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void createCustomClassExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String parent = "parent-995424086"; - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - client.createCustomClass(parent, customClass, customClassId); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getCustomClassTest() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockAdaptation.addResponse(expectedResponse); - - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - - CustomClass actualResponse = client.getCustomClass(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetCustomClassRequest actualRequest = ((GetCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getCustomClassExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - client.getCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void getCustomClassTest2() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockAdaptation.addResponse(expectedResponse); - - String name = "name3373707"; - - CustomClass actualResponse = client.getCustomClass(name); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - GetCustomClassRequest actualRequest = ((GetCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void getCustomClassExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String name = "name3373707"; - client.getCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listCustomClassesTest() throws Exception { - CustomClass responsesElement = CustomClass.newBuilder().build(); - ListCustomClassesResponse expectedResponse = - ListCustomClassesResponse.newBuilder() - .setNextPageToken("") - .addAllCustomClasses(Arrays.asList(responsesElement)) - .build(); - mockAdaptation.addResponse(expectedResponse); - - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - - ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListCustomClassesRequest actualRequest = ((ListCustomClassesRequest) actualRequests.get(0)); - - Assert.assertEquals(parent.toString(), actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listCustomClassesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - client.listCustomClasses(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void listCustomClassesTest2() throws Exception { - CustomClass responsesElement = CustomClass.newBuilder().build(); - ListCustomClassesResponse expectedResponse = - ListCustomClassesResponse.newBuilder() - .setNextPageToken("") - .addAllCustomClasses(Arrays.asList(responsesElement)) - .build(); - mockAdaptation.addResponse(expectedResponse); - - String parent = "parent-995424086"; - - ListCustomClassesPagedResponse pagedListResponse = client.listCustomClasses(parent); - - List resources = Lists.newArrayList(pagedListResponse.iterateAll()); - - Assert.assertEquals(1, resources.size()); - Assert.assertEquals(expectedResponse.getCustomClassesList().get(0), resources.get(0)); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - ListCustomClassesRequest actualRequest = ((ListCustomClassesRequest) actualRequests.get(0)); - - Assert.assertEquals(parent, actualRequest.getParent()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void listCustomClassesExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String parent = "parent-995424086"; - client.listCustomClasses(parent); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void updateCustomClassTest() throws Exception { - CustomClass expectedResponse = - CustomClass.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .setCustomClassId("customClassId1871032322") - .addAllItems(new ArrayList()) - .build(); - mockAdaptation.addResponse(expectedResponse); - - CustomClass customClass = CustomClass.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - - CustomClass actualResponse = client.updateCustomClass(customClass, updateMask); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - UpdateCustomClassRequest actualRequest = ((UpdateCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(customClass, actualRequest.getCustomClass()); - Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void updateCustomClassExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - CustomClass customClass = CustomClass.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateCustomClass(customClass, updateMask); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteCustomClassTest() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockAdaptation.addResponse(expectedResponse); - - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - - client.deleteCustomClass(name); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteCustomClassRequest actualRequest = ((DeleteCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(name.toString(), actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteCustomClassExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - client.deleteCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void deleteCustomClassTest2() throws Exception { - Empty expectedResponse = Empty.newBuilder().build(); - mockAdaptation.addResponse(expectedResponse); - - String name = "name3373707"; - - client.deleteCustomClass(name); - - List actualRequests = mockAdaptation.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - DeleteCustomClassRequest actualRequest = ((DeleteCustomClassRequest) actualRequests.get(0)); - - Assert.assertEquals(name, actualRequest.getName()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void deleteCustomClassExceptionTest2() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockAdaptation.addException(exception); - - try { - String name = "name3373707"; - client.deleteCustomClass(name); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java deleted file mode 100644 index 6126bd88d543..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptation.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockAdaptation implements MockGrpcService { - private final MockAdaptationImpl serviceImpl; - - public MockAdaptation() { - serviceImpl = new MockAdaptationImpl(); - } - - @Override - public List getRequests() { - return serviceImpl.getRequests(); - } - - @Override - public void addResponse(AbstractMessage response) { - serviceImpl.addResponse(response); - } - - @Override - public void addException(Exception exception) { - serviceImpl.addException(exception); - } - - @Override - public ServerServiceDefinition getServiceDefinition() { - return serviceImpl.bindService(); - } - - @Override - public void reset() { - serviceImpl.reset(); - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java deleted file mode 100644 index 33a5d0e237e4..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockAdaptationImpl.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.core.BetaApi; -import com.google.cloud.speech.v1p1beta1.AdaptationGrpc.AdaptationImplBase; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Empty; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockAdaptationImpl extends AdaptationImplBase { - private List requests; - private Queue responses; - - public MockAdaptationImpl() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - public List getRequests() { - return requests; - } - - public void addResponse(AbstractMessage response) { - responses.add(response); - } - - public void setResponses(List responses) { - this.responses = new LinkedList(responses); - } - - public void addException(Exception exception) { - responses.add(exception); - } - - public void reset() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - @Override - public void createPhraseSet( - CreatePhraseSetRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PhraseSet) { - requests.add(request); - responseObserver.onNext(((PhraseSet) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method CreatePhraseSet, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PhraseSet.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getPhraseSet( - GetPhraseSetRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PhraseSet) { - requests.add(request); - responseObserver.onNext(((PhraseSet) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetPhraseSet, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PhraseSet.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listPhraseSet( - ListPhraseSetRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListPhraseSetResponse) { - requests.add(request); - responseObserver.onNext(((ListPhraseSetResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListPhraseSet, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListPhraseSetResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updatePhraseSet( - UpdatePhraseSetRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof PhraseSet) { - requests.add(request); - responseObserver.onNext(((PhraseSet) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method UpdatePhraseSet, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - PhraseSet.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deletePhraseSet( - DeletePhraseSetRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method DeletePhraseSet, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void createCustomClass( - CreateCustomClassRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof CustomClass) { - requests.add(request); - responseObserver.onNext(((CustomClass) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method CreateCustomClass, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - CustomClass.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void getCustomClass( - GetCustomClassRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof CustomClass) { - requests.add(request); - responseObserver.onNext(((CustomClass) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method GetCustomClass, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - CustomClass.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void listCustomClasses( - ListCustomClassesRequest request, - StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof ListCustomClassesResponse) { - requests.add(request); - responseObserver.onNext(((ListCustomClassesResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method ListCustomClasses, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - ListCustomClassesResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void updateCustomClass( - UpdateCustomClassRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof CustomClass) { - requests.add(request); - responseObserver.onNext(((CustomClass) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method UpdateCustomClass, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - CustomClass.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void deleteCustomClass( - DeleteCustomClassRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Empty) { - requests.add(request); - responseObserver.onNext(((Empty) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method DeleteCustomClass, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Empty.class.getName(), - Exception.class.getName()))); - } - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java deleted file mode 100644 index 559055355ecd..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeech.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.core.BetaApi; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.protobuf.AbstractMessage; -import io.grpc.ServerServiceDefinition; -import java.util.List; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockSpeech implements MockGrpcService { - private final MockSpeechImpl serviceImpl; - - public MockSpeech() { - serviceImpl = new MockSpeechImpl(); - } - - @Override - public List getRequests() { - return serviceImpl.getRequests(); - } - - @Override - public void addResponse(AbstractMessage response) { - serviceImpl.addResponse(response); - } - - @Override - public void addException(Exception exception) { - serviceImpl.addException(exception); - } - - @Override - public ServerServiceDefinition getServiceDefinition() { - return serviceImpl.bindService(); - } - - @Override - public void reset() { - serviceImpl.reset(); - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java deleted file mode 100644 index e5f058a3132a..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/MockSpeechImpl.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.core.BetaApi; -import com.google.cloud.speech.v1p1beta1.SpeechGrpc.SpeechImplBase; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import io.grpc.stub.StreamObserver; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Queue; -import javax.annotation.Generated; - -@BetaApi -@Generated("by gapic-generator-java") -public class MockSpeechImpl extends SpeechImplBase { - private List requests; - private Queue responses; - - public MockSpeechImpl() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - public List getRequests() { - return requests; - } - - public void addResponse(AbstractMessage response) { - responses.add(response); - } - - public void setResponses(List responses) { - this.responses = new LinkedList(responses); - } - - public void addException(Exception exception) { - responses.add(exception); - } - - public void reset() { - requests = new ArrayList<>(); - responses = new LinkedList<>(); - } - - @Override - public void recognize( - RecognizeRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof RecognizeResponse) { - requests.add(request); - responseObserver.onNext(((RecognizeResponse) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method Recognize, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - RecognizeResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void longRunningRecognize( - LongRunningRecognizeRequest request, StreamObserver responseObserver) { - Object response = responses.poll(); - if (response instanceof Operation) { - requests.add(request); - responseObserver.onNext(((Operation) response)); - responseObserver.onCompleted(); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method LongRunningRecognize, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - Operation.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public StreamObserver streamingRecognize( - final StreamObserver responseObserver) { - StreamObserver requestObserver = - new StreamObserver() { - @Override - public void onNext(StreamingRecognizeRequest value) { - requests.add(value); - final Object response = responses.remove(); - if (response instanceof StreamingRecognizeResponse) { - responseObserver.onNext(((StreamingRecognizeResponse) response)); - } else if (response instanceof Exception) { - responseObserver.onError(((Exception) response)); - } else { - responseObserver.onError( - new IllegalArgumentException( - String.format( - "Unrecognized response type %s for method StreamingRecognize, expected %s or %s", - response == null ? "null" : response.getClass().getName(), - StreamingRecognizeResponse.class.getName(), - Exception.class.getName()))); - } - } - - @Override - public void onError(Throwable t) { - responseObserver.onError(t); - } - - @Override - public void onCompleted() { - responseObserver.onCompleted(); - } - }; - return requestObserver; - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientHttpJsonTest.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientHttpJsonTest.java deleted file mode 100644 index 565f69611631..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientHttpJsonTest.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.httpjson.GaxHttpJsonProperties; -import com.google.api.gax.httpjson.testing.MockHttpService; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiException; -import com.google.api.gax.rpc.ApiExceptionFactory; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.api.gax.rpc.testing.FakeStatusCode; -import com.google.cloud.speech.v1p1beta1.stub.HttpJsonSpeechStub; -import com.google.longrunning.Operation; -import com.google.protobuf.Any; -import com.google.protobuf.Duration; -import com.google.rpc.Status; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ExecutionException; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class SpeechClientHttpJsonTest { - private static MockHttpService mockService; - private static SpeechClient client; - - @BeforeClass - public static void startStaticServer() throws IOException { - mockService = - new MockHttpService( - HttpJsonSpeechStub.getMethodDescriptors(), SpeechSettings.getDefaultEndpoint()); - SpeechSettings settings = - SpeechSettings.newHttpJsonBuilder() - .setTransportChannelProvider( - SpeechSettings.defaultHttpJsonTransportProviderBuilder() - .setHttpTransport(mockService) - .build()) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SpeechClient.create(settings); - } - - @AfterClass - public static void stopServer() { - client.close(); - } - - @Before - public void setUp() {} - - @After - public void tearDown() throws Exception { - mockService.reset(); - } - - @Test - public void recognizeTest() throws Exception { - RecognizeResponse expectedResponse = - RecognizeResponse.newBuilder() - .addAllResults(new ArrayList()) - .setTotalBilledTime(Duration.newBuilder().build()) - .build(); - mockService.addResponse(expectedResponse); - - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - - RecognizeResponse actualResponse = client.recognize(config, audio); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void recognizeExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - client.recognize(config, audio); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void longRunningRecognizeTest() throws Exception { - LongRunningRecognizeResponse expectedResponse = - LongRunningRecognizeResponse.newBuilder() - .addAllResults(new ArrayList()) - .setTotalBilledTime(Duration.newBuilder().build()) - .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) - .setOutputError(Status.newBuilder().build()) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("longRunningRecognizeTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockService.addResponse(resultOperation); - - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - - LongRunningRecognizeResponse actualResponse = - client.longRunningRecognizeAsync(config, audio).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockService.getRequestPaths(); - Assert.assertEquals(1, actualRequests.size()); - - String apiClientHeaderKey = - mockService - .getRequestHeaders() - .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) - .iterator() - .next(); - Assert.assertTrue( - GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() - .matcher(apiClientHeaderKey) - .matches()); - } - - @Test - public void longRunningRecognizeExceptionTest() throws Exception { - ApiException exception = - ApiExceptionFactory.createException( - new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); - mockService.addException(exception); - - try { - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - client.longRunningRecognizeAsync(config, audio).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - } - } - - @Test - public void streamingRecognizeUnsupportedMethodTest() throws Exception { - // The streamingRecognize() method is not supported in REST transport. - // This empty test is generated for technical reasons. - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java b/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java deleted file mode 100644 index 47c54e81eed9..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/google-cloud-speech/src/test/java/com/google/cloud/speech/v1p1beta1/SpeechClientTest.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.gax.core.NoCredentialsProvider; -import com.google.api.gax.grpc.GaxGrpcProperties; -import com.google.api.gax.grpc.testing.LocalChannelProvider; -import com.google.api.gax.grpc.testing.MockGrpcService; -import com.google.api.gax.grpc.testing.MockServiceHelper; -import com.google.api.gax.grpc.testing.MockStreamObserver; -import com.google.api.gax.rpc.ApiClientHeaderProvider; -import com.google.api.gax.rpc.ApiStreamObserver; -import com.google.api.gax.rpc.BidiStreamingCallable; -import com.google.api.gax.rpc.InvalidArgumentException; -import com.google.api.gax.rpc.StatusCode; -import com.google.longrunning.Operation; -import com.google.protobuf.AbstractMessage; -import com.google.protobuf.Any; -import com.google.protobuf.Duration; -import com.google.rpc.Status; -import io.grpc.StatusRuntimeException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.UUID; -import java.util.concurrent.ExecutionException; -import javax.annotation.Generated; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -@Generated("by gapic-generator-java") -public class SpeechClientTest { - private static MockServiceHelper mockServiceHelper; - private static MockSpeech mockSpeech; - private LocalChannelProvider channelProvider; - private SpeechClient client; - - @BeforeClass - public static void startStaticServer() { - mockSpeech = new MockSpeech(); - mockServiceHelper = - new MockServiceHelper( - UUID.randomUUID().toString(), Arrays.asList(mockSpeech)); - mockServiceHelper.start(); - } - - @AfterClass - public static void stopServer() { - mockServiceHelper.stop(); - } - - @Before - public void setUp() throws IOException { - mockServiceHelper.reset(); - channelProvider = mockServiceHelper.createChannelProvider(); - SpeechSettings settings = - SpeechSettings.newBuilder() - .setTransportChannelProvider(channelProvider) - .setCredentialsProvider(NoCredentialsProvider.create()) - .build(); - client = SpeechClient.create(settings); - } - - @After - public void tearDown() throws Exception { - client.close(); - } - - @Test - public void recognizeTest() throws Exception { - RecognizeResponse expectedResponse = - RecognizeResponse.newBuilder() - .addAllResults(new ArrayList()) - .setTotalBilledTime(Duration.newBuilder().build()) - .build(); - mockSpeech.addResponse(expectedResponse); - - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - - RecognizeResponse actualResponse = client.recognize(config, audio); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSpeech.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - RecognizeRequest actualRequest = ((RecognizeRequest) actualRequests.get(0)); - - Assert.assertEquals(config, actualRequest.getConfig()); - Assert.assertEquals(audio, actualRequest.getAudio()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void recognizeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSpeech.addException(exception); - - try { - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - client.recognize(config, audio); - Assert.fail("No exception raised"); - } catch (InvalidArgumentException e) { - // Expected exception. - } - } - - @Test - public void longRunningRecognizeTest() throws Exception { - LongRunningRecognizeResponse expectedResponse = - LongRunningRecognizeResponse.newBuilder() - .addAllResults(new ArrayList()) - .setTotalBilledTime(Duration.newBuilder().build()) - .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) - .setOutputError(Status.newBuilder().build()) - .build(); - Operation resultOperation = - Operation.newBuilder() - .setName("longRunningRecognizeTest") - .setDone(true) - .setResponse(Any.pack(expectedResponse)) - .build(); - mockSpeech.addResponse(resultOperation); - - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - - LongRunningRecognizeResponse actualResponse = - client.longRunningRecognizeAsync(config, audio).get(); - Assert.assertEquals(expectedResponse, actualResponse); - - List actualRequests = mockSpeech.getRequests(); - Assert.assertEquals(1, actualRequests.size()); - LongRunningRecognizeRequest actualRequest = - ((LongRunningRecognizeRequest) actualRequests.get(0)); - - Assert.assertEquals(config, actualRequest.getConfig()); - Assert.assertEquals(audio, actualRequest.getAudio()); - Assert.assertTrue( - channelProvider.isHeaderSent( - ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), - GaxGrpcProperties.getDefaultApiClientHeaderPattern())); - } - - @Test - public void longRunningRecognizeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSpeech.addException(exception); - - try { - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - client.longRunningRecognizeAsync(config, audio).get(); - Assert.fail("No exception raised"); - } catch (ExecutionException e) { - Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } - - @Test - public void streamingRecognizeTest() throws Exception { - StreamingRecognizeResponse expectedResponse = - StreamingRecognizeResponse.newBuilder() - .setError(Status.newBuilder().build()) - .addAllResults(new ArrayList()) - .setTotalBilledTime(Duration.newBuilder().build()) - .build(); - mockSpeech.addResponse(expectedResponse); - StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.streamingRecognizeCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - requestObserver.onCompleted(); - - List actualResponses = responseObserver.future().get(); - Assert.assertEquals(1, actualResponses.size()); - Assert.assertEquals(expectedResponse, actualResponses.get(0)); - } - - @Test - public void streamingRecognizeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); - mockSpeech.addException(exception); - StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); - - MockStreamObserver responseObserver = new MockStreamObserver<>(); - - BidiStreamingCallable callable = - client.streamingRecognizeCallable(); - ApiStreamObserver requestObserver = - callable.bidiStreamingCall(responseObserver); - - requestObserver.onNext(request); - - try { - List actualResponses = responseObserver.future().get(); - Assert.fail("No exception thrown"); - } catch (ExecutionException e) { - Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); - Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); - } - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java b/owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java deleted file mode 100644 index e41d203e7109..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/AdaptationGrpc.java +++ /dev/null @@ -1,1085 +0,0 @@ -package com.google.cloud.speech.v1p1beta1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - *
- * Service that implements Google Cloud Speech Adaptation API.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class AdaptationGrpc { - - private AdaptationGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.speech.v1p1beta1.Adaptation"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getCreatePhraseSetMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreatePhraseSet", - requestType = com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.class, - responseType = com.google.cloud.speech.v1p1beta1.PhraseSet.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreatePhraseSetMethod() { - io.grpc.MethodDescriptor getCreatePhraseSetMethod; - if ((getCreatePhraseSetMethod = AdaptationGrpc.getCreatePhraseSetMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getCreatePhraseSetMethod = AdaptationGrpc.getCreatePhraseSetMethod) == null) { - AdaptationGrpc.getCreatePhraseSetMethod = getCreatePhraseSetMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreatePhraseSet")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("CreatePhraseSet")) - .build(); - } - } - } - return getCreatePhraseSetMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetPhraseSetMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetPhraseSet", - requestType = com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.class, - responseType = com.google.cloud.speech.v1p1beta1.PhraseSet.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetPhraseSetMethod() { - io.grpc.MethodDescriptor getGetPhraseSetMethod; - if ((getGetPhraseSetMethod = AdaptationGrpc.getGetPhraseSetMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getGetPhraseSetMethod = AdaptationGrpc.getGetPhraseSetMethod) == null) { - AdaptationGrpc.getGetPhraseSetMethod = getGetPhraseSetMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetPhraseSet")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("GetPhraseSet")) - .build(); - } - } - } - return getGetPhraseSetMethod; - } - - private static volatile io.grpc.MethodDescriptor getListPhraseSetMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListPhraseSet", - requestType = com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.class, - responseType = com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListPhraseSetMethod() { - io.grpc.MethodDescriptor getListPhraseSetMethod; - if ((getListPhraseSetMethod = AdaptationGrpc.getListPhraseSetMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getListPhraseSetMethod = AdaptationGrpc.getListPhraseSetMethod) == null) { - AdaptationGrpc.getListPhraseSetMethod = getListPhraseSetMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListPhraseSet")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("ListPhraseSet")) - .build(); - } - } - } - return getListPhraseSetMethod; - } - - private static volatile io.grpc.MethodDescriptor getUpdatePhraseSetMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdatePhraseSet", - requestType = com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.class, - responseType = com.google.cloud.speech.v1p1beta1.PhraseSet.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getUpdatePhraseSetMethod() { - io.grpc.MethodDescriptor getUpdatePhraseSetMethod; - if ((getUpdatePhraseSetMethod = AdaptationGrpc.getUpdatePhraseSetMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getUpdatePhraseSetMethod = AdaptationGrpc.getUpdatePhraseSetMethod) == null) { - AdaptationGrpc.getUpdatePhraseSetMethod = getUpdatePhraseSetMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdatePhraseSet")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("UpdatePhraseSet")) - .build(); - } - } - } - return getUpdatePhraseSetMethod; - } - - private static volatile io.grpc.MethodDescriptor getDeletePhraseSetMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeletePhraseSet", - requestType = com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDeletePhraseSetMethod() { - io.grpc.MethodDescriptor getDeletePhraseSetMethod; - if ((getDeletePhraseSetMethod = AdaptationGrpc.getDeletePhraseSetMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getDeletePhraseSetMethod = AdaptationGrpc.getDeletePhraseSetMethod) == null) { - AdaptationGrpc.getDeletePhraseSetMethod = getDeletePhraseSetMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeletePhraseSet")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("DeletePhraseSet")) - .build(); - } - } - } - return getDeletePhraseSetMethod; - } - - private static volatile io.grpc.MethodDescriptor getCreateCustomClassMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "CreateCustomClass", - requestType = com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.class, - responseType = com.google.cloud.speech.v1p1beta1.CustomClass.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getCreateCustomClassMethod() { - io.grpc.MethodDescriptor getCreateCustomClassMethod; - if ((getCreateCustomClassMethod = AdaptationGrpc.getCreateCustomClassMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getCreateCustomClassMethod = AdaptationGrpc.getCreateCustomClassMethod) == null) { - AdaptationGrpc.getCreateCustomClassMethod = getCreateCustomClassMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCustomClass")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("CreateCustomClass")) - .build(); - } - } - } - return getCreateCustomClassMethod; - } - - private static volatile io.grpc.MethodDescriptor getGetCustomClassMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "GetCustomClass", - requestType = com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.class, - responseType = com.google.cloud.speech.v1p1beta1.CustomClass.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getGetCustomClassMethod() { - io.grpc.MethodDescriptor getGetCustomClassMethod; - if ((getGetCustomClassMethod = AdaptationGrpc.getGetCustomClassMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getGetCustomClassMethod = AdaptationGrpc.getGetCustomClassMethod) == null) { - AdaptationGrpc.getGetCustomClassMethod = getGetCustomClassMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCustomClass")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("GetCustomClass")) - .build(); - } - } - } - return getGetCustomClassMethod; - } - - private static volatile io.grpc.MethodDescriptor getListCustomClassesMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "ListCustomClasses", - requestType = com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.class, - responseType = com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getListCustomClassesMethod() { - io.grpc.MethodDescriptor getListCustomClassesMethod; - if ((getListCustomClassesMethod = AdaptationGrpc.getListCustomClassesMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getListCustomClassesMethod = AdaptationGrpc.getListCustomClassesMethod) == null) { - AdaptationGrpc.getListCustomClassesMethod = getListCustomClassesMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCustomClasses")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("ListCustomClasses")) - .build(); - } - } - } - return getListCustomClassesMethod; - } - - private static volatile io.grpc.MethodDescriptor getUpdateCustomClassMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "UpdateCustomClass", - requestType = com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.class, - responseType = com.google.cloud.speech.v1p1beta1.CustomClass.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getUpdateCustomClassMethod() { - io.grpc.MethodDescriptor getUpdateCustomClassMethod; - if ((getUpdateCustomClassMethod = AdaptationGrpc.getUpdateCustomClassMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getUpdateCustomClassMethod = AdaptationGrpc.getUpdateCustomClassMethod) == null) { - AdaptationGrpc.getUpdateCustomClassMethod = getUpdateCustomClassMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCustomClass")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("UpdateCustomClass")) - .build(); - } - } - } - return getUpdateCustomClassMethod; - } - - private static volatile io.grpc.MethodDescriptor getDeleteCustomClassMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "DeleteCustomClass", - requestType = com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.class, - responseType = com.google.protobuf.Empty.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getDeleteCustomClassMethod() { - io.grpc.MethodDescriptor getDeleteCustomClassMethod; - if ((getDeleteCustomClassMethod = AdaptationGrpc.getDeleteCustomClassMethod) == null) { - synchronized (AdaptationGrpc.class) { - if ((getDeleteCustomClassMethod = AdaptationGrpc.getDeleteCustomClassMethod) == null) { - AdaptationGrpc.getDeleteCustomClassMethod = getDeleteCustomClassMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCustomClass")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.protobuf.Empty.getDefaultInstance())) - .setSchemaDescriptor(new AdaptationMethodDescriptorSupplier("DeleteCustomClass")) - .build(); - } - } - } - return getDeleteCustomClassMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static AdaptationStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public AdaptationStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AdaptationStub(channel, callOptions); - } - }; - return AdaptationStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static AdaptationBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public AdaptationBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AdaptationBlockingStub(channel, callOptions); - } - }; - return AdaptationBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static AdaptationFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public AdaptationFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AdaptationFutureStub(channel, callOptions); - } - }; - return AdaptationFutureStub.newStub(factory, channel); - } - - /** - *
-   * Service that implements Google Cloud Speech Adaptation API.
-   * 
- */ - public static abstract class AdaptationImplBase implements io.grpc.BindableService { - - /** - *
-     * Create a set of phrase hints. Each item in the set can be a single word or
-     * a multi-word phrase. The items in the PhraseSet are favored by the
-     * recognition model when you send a call that includes the PhraseSet.
-     * 
- */ - public void createPhraseSet(com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreatePhraseSetMethod(), responseObserver); - } - - /** - *
-     * Get a phrase set.
-     * 
- */ - public void getPhraseSet(com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetPhraseSetMethod(), responseObserver); - } - - /** - *
-     * List phrase sets.
-     * 
- */ - public void listPhraseSet(com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListPhraseSetMethod(), responseObserver); - } - - /** - *
-     * Update a phrase set.
-     * 
- */ - public void updatePhraseSet(com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdatePhraseSetMethod(), responseObserver); - } - - /** - *
-     * Delete a phrase set.
-     * 
- */ - public void deletePhraseSet(com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeletePhraseSetMethod(), responseObserver); - } - - /** - *
-     * Create a custom class.
-     * 
- */ - public void createCustomClass(com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateCustomClassMethod(), responseObserver); - } - - /** - *
-     * Get a custom class.
-     * 
- */ - public void getCustomClass(com.google.cloud.speech.v1p1beta1.GetCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetCustomClassMethod(), responseObserver); - } - - /** - *
-     * List custom classes.
-     * 
- */ - public void listCustomClasses(com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListCustomClassesMethod(), responseObserver); - } - - /** - *
-     * Update a custom class.
-     * 
- */ - public void updateCustomClass(com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateCustomClassMethod(), responseObserver); - } - - /** - *
-     * Delete a custom class.
-     * 
- */ - public void deleteCustomClass(com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteCustomClassMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getCreatePhraseSetMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest, - com.google.cloud.speech.v1p1beta1.PhraseSet>( - this, METHODID_CREATE_PHRASE_SET))) - .addMethod( - getGetPhraseSetMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest, - com.google.cloud.speech.v1p1beta1.PhraseSet>( - this, METHODID_GET_PHRASE_SET))) - .addMethod( - getListPhraseSetMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest, - com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse>( - this, METHODID_LIST_PHRASE_SET))) - .addMethod( - getUpdatePhraseSetMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest, - com.google.cloud.speech.v1p1beta1.PhraseSet>( - this, METHODID_UPDATE_PHRASE_SET))) - .addMethod( - getDeletePhraseSetMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_PHRASE_SET))) - .addMethod( - getCreateCustomClassMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest, - com.google.cloud.speech.v1p1beta1.CustomClass>( - this, METHODID_CREATE_CUSTOM_CLASS))) - .addMethod( - getGetCustomClassMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.GetCustomClassRequest, - com.google.cloud.speech.v1p1beta1.CustomClass>( - this, METHODID_GET_CUSTOM_CLASS))) - .addMethod( - getListCustomClassesMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest, - com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse>( - this, METHODID_LIST_CUSTOM_CLASSES))) - .addMethod( - getUpdateCustomClassMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest, - com.google.cloud.speech.v1p1beta1.CustomClass>( - this, METHODID_UPDATE_CUSTOM_CLASS))) - .addMethod( - getDeleteCustomClassMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest, - com.google.protobuf.Empty>( - this, METHODID_DELETE_CUSTOM_CLASS))) - .build(); - } - } - - /** - *
-   * Service that implements Google Cloud Speech Adaptation API.
-   * 
- */ - public static final class AdaptationStub extends io.grpc.stub.AbstractAsyncStub { - private AdaptationStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected AdaptationStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AdaptationStub(channel, callOptions); - } - - /** - *
-     * Create a set of phrase hints. Each item in the set can be a single word or
-     * a multi-word phrase. The items in the PhraseSet are favored by the
-     * recognition model when you send a call that includes the PhraseSet.
-     * 
- */ - public void createPhraseSet(com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreatePhraseSetMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Get a phrase set.
-     * 
- */ - public void getPhraseSet(com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetPhraseSetMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * List phrase sets.
-     * 
- */ - public void listPhraseSet(com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListPhraseSetMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Update a phrase set.
-     * 
- */ - public void updatePhraseSet(com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdatePhraseSetMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Delete a phrase set.
-     * 
- */ - public void deletePhraseSet(com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeletePhraseSetMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Create a custom class.
-     * 
- */ - public void createCustomClass(com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getCreateCustomClassMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Get a custom class.
-     * 
- */ - public void getCustomClass(com.google.cloud.speech.v1p1beta1.GetCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getGetCustomClassMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * List custom classes.
-     * 
- */ - public void listCustomClasses(com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getListCustomClassesMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Update a custom class.
-     * 
- */ - public void updateCustomClass(com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getUpdateCustomClassMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Delete a custom class.
-     * 
- */ - public void deleteCustomClass(com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getDeleteCustomClassMethod(), getCallOptions()), request, responseObserver); - } - } - - /** - *
-   * Service that implements Google Cloud Speech Adaptation API.
-   * 
- */ - public static final class AdaptationBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private AdaptationBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected AdaptationBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AdaptationBlockingStub(channel, callOptions); - } - - /** - *
-     * Create a set of phrase hints. Each item in the set can be a single word or
-     * a multi-word phrase. The items in the PhraseSet are favored by the
-     * recognition model when you send a call that includes the PhraseSet.
-     * 
- */ - public com.google.cloud.speech.v1p1beta1.PhraseSet createPhraseSet(com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreatePhraseSetMethod(), getCallOptions(), request); - } - - /** - *
-     * Get a phrase set.
-     * 
- */ - public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet(com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetPhraseSetMethod(), getCallOptions(), request); - } - - /** - *
-     * List phrase sets.
-     * 
- */ - public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse listPhraseSet(com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListPhraseSetMethod(), getCallOptions(), request); - } - - /** - *
-     * Update a phrase set.
-     * 
- */ - public com.google.cloud.speech.v1p1beta1.PhraseSet updatePhraseSet(com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdatePhraseSetMethod(), getCallOptions(), request); - } - - /** - *
-     * Delete a phrase set.
-     * 
- */ - public com.google.protobuf.Empty deletePhraseSet(com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeletePhraseSetMethod(), getCallOptions(), request); - } - - /** - *
-     * Create a custom class.
-     * 
- */ - public com.google.cloud.speech.v1p1beta1.CustomClass createCustomClass(com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getCreateCustomClassMethod(), getCallOptions(), request); - } - - /** - *
-     * Get a custom class.
-     * 
- */ - public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass(com.google.cloud.speech.v1p1beta1.GetCustomClassRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getGetCustomClassMethod(), getCallOptions(), request); - } - - /** - *
-     * List custom classes.
-     * 
- */ - public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse listCustomClasses(com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getListCustomClassesMethod(), getCallOptions(), request); - } - - /** - *
-     * Update a custom class.
-     * 
- */ - public com.google.cloud.speech.v1p1beta1.CustomClass updateCustomClass(com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getUpdateCustomClassMethod(), getCallOptions(), request); - } - - /** - *
-     * Delete a custom class.
-     * 
- */ - public com.google.protobuf.Empty deleteCustomClass(com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getDeleteCustomClassMethod(), getCallOptions(), request); - } - } - - /** - *
-   * Service that implements Google Cloud Speech Adaptation API.
-   * 
- */ - public static final class AdaptationFutureStub extends io.grpc.stub.AbstractFutureStub { - private AdaptationFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected AdaptationFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new AdaptationFutureStub(channel, callOptions); - } - - /** - *
-     * Create a set of phrase hints. Each item in the set can be a single word or
-     * a multi-word phrase. The items in the PhraseSet are favored by the
-     * recognition model when you send a call that includes the PhraseSet.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture createPhraseSet( - com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreatePhraseSetMethod(), getCallOptions()), request); - } - - /** - *
-     * Get a phrase set.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture getPhraseSet( - com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetPhraseSetMethod(), getCallOptions()), request); - } - - /** - *
-     * List phrase sets.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture listPhraseSet( - com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListPhraseSetMethod(), getCallOptions()), request); - } - - /** - *
-     * Update a phrase set.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture updatePhraseSet( - com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdatePhraseSetMethod(), getCallOptions()), request); - } - - /** - *
-     * Delete a phrase set.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture deletePhraseSet( - com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeletePhraseSetMethod(), getCallOptions()), request); - } - - /** - *
-     * Create a custom class.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture createCustomClass( - com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getCreateCustomClassMethod(), getCallOptions()), request); - } - - /** - *
-     * Get a custom class.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture getCustomClass( - com.google.cloud.speech.v1p1beta1.GetCustomClassRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getGetCustomClassMethod(), getCallOptions()), request); - } - - /** - *
-     * List custom classes.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture listCustomClasses( - com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getListCustomClassesMethod(), getCallOptions()), request); - } - - /** - *
-     * Update a custom class.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture updateCustomClass( - com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getUpdateCustomClassMethod(), getCallOptions()), request); - } - - /** - *
-     * Delete a custom class.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture deleteCustomClass( - com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getDeleteCustomClassMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_CREATE_PHRASE_SET = 0; - private static final int METHODID_GET_PHRASE_SET = 1; - private static final int METHODID_LIST_PHRASE_SET = 2; - private static final int METHODID_UPDATE_PHRASE_SET = 3; - private static final int METHODID_DELETE_PHRASE_SET = 4; - private static final int METHODID_CREATE_CUSTOM_CLASS = 5; - private static final int METHODID_GET_CUSTOM_CLASS = 6; - private static final int METHODID_LIST_CUSTOM_CLASSES = 7; - private static final int METHODID_UPDATE_CUSTOM_CLASS = 8; - private static final int METHODID_DELETE_CUSTOM_CLASS = 9; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final AdaptationImplBase serviceImpl; - private final int methodId; - - MethodHandlers(AdaptationImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_CREATE_PHRASE_SET: - serviceImpl.createPhraseSet((com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_PHRASE_SET: - serviceImpl.getPhraseSet((com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_PHRASE_SET: - serviceImpl.listPhraseSet((com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UPDATE_PHRASE_SET: - serviceImpl.updatePhraseSet((com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_PHRASE_SET: - serviceImpl.deletePhraseSet((com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_CREATE_CUSTOM_CLASS: - serviceImpl.createCustomClass((com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_GET_CUSTOM_CLASS: - serviceImpl.getCustomClass((com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LIST_CUSTOM_CLASSES: - serviceImpl.listCustomClasses((com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_UPDATE_CUSTOM_CLASS: - serviceImpl.updateCustomClass((com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_DELETE_CUSTOM_CLASS: - serviceImpl.deleteCustomClass((com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - default: - throw new AssertionError(); - } - } - } - - private static abstract class AdaptationBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - AdaptationBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Adaptation"); - } - } - - private static final class AdaptationFileDescriptorSupplier - extends AdaptationBaseDescriptorSupplier { - AdaptationFileDescriptorSupplier() {} - } - - private static final class AdaptationMethodDescriptorSupplier - extends AdaptationBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - AdaptationMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (AdaptationGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new AdaptationFileDescriptorSupplier()) - .addMethod(getCreatePhraseSetMethod()) - .addMethod(getGetPhraseSetMethod()) - .addMethod(getListPhraseSetMethod()) - .addMethod(getUpdatePhraseSetMethod()) - .addMethod(getDeletePhraseSetMethod()) - .addMethod(getCreateCustomClassMethod()) - .addMethod(getGetCustomClassMethod()) - .addMethod(getListCustomClassesMethod()) - .addMethod(getUpdateCustomClassMethod()) - .addMethod(getDeleteCustomClassMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java b/owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java deleted file mode 100644 index 5879fdc4465f..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/grpc-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechGrpc.java +++ /dev/null @@ -1,479 +0,0 @@ -package com.google.cloud.speech.v1p1beta1; - -import static io.grpc.MethodDescriptor.generateFullMethodName; - -/** - *
- * Service that implements Google Cloud Speech API.
- * 
- */ -@javax.annotation.Generated( - value = "by gRPC proto compiler", - comments = "Source: google/cloud/speech/v1p1beta1/cloud_speech.proto") -@io.grpc.stub.annotations.GrpcGenerated -public final class SpeechGrpc { - - private SpeechGrpc() {} - - public static final String SERVICE_NAME = "google.cloud.speech.v1p1beta1.Speech"; - - // Static method descriptors that strictly reflect the proto. - private static volatile io.grpc.MethodDescriptor getRecognizeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "Recognize", - requestType = com.google.cloud.speech.v1p1beta1.RecognizeRequest.class, - responseType = com.google.cloud.speech.v1p1beta1.RecognizeResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getRecognizeMethod() { - io.grpc.MethodDescriptor getRecognizeMethod; - if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getRecognizeMethod = SpeechGrpc.getRecognizeMethod) == null) { - SpeechGrpc.getRecognizeMethod = getRecognizeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Recognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.RecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.RecognizeResponse.getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("Recognize")) - .build(); - } - } - } - return getRecognizeMethod; - } - - private static volatile io.grpc.MethodDescriptor getLongRunningRecognizeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "LongRunningRecognize", - requestType = com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.class, - responseType = com.google.longrunning.Operation.class, - methodType = io.grpc.MethodDescriptor.MethodType.UNARY) - public static io.grpc.MethodDescriptor getLongRunningRecognizeMethod() { - io.grpc.MethodDescriptor getLongRunningRecognizeMethod; - if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getLongRunningRecognizeMethod = SpeechGrpc.getLongRunningRecognizeMethod) == null) { - SpeechGrpc.getLongRunningRecognizeMethod = getLongRunningRecognizeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.UNARY) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "LongRunningRecognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.longrunning.Operation.getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("LongRunningRecognize")) - .build(); - } - } - } - return getLongRunningRecognizeMethod; - } - - private static volatile io.grpc.MethodDescriptor getStreamingRecognizeMethod; - - @io.grpc.stub.annotations.RpcMethod( - fullMethodName = SERVICE_NAME + '/' + "StreamingRecognize", - requestType = com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.class, - responseType = com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.class, - methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - public static io.grpc.MethodDescriptor getStreamingRecognizeMethod() { - io.grpc.MethodDescriptor getStreamingRecognizeMethod; - if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { - synchronized (SpeechGrpc.class) { - if ((getStreamingRecognizeMethod = SpeechGrpc.getStreamingRecognizeMethod) == null) { - SpeechGrpc.getStreamingRecognizeMethod = getStreamingRecognizeMethod = - io.grpc.MethodDescriptor.newBuilder() - .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) - .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamingRecognize")) - .setSampledToLocalTracing(true) - .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.getDefaultInstance())) - .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.getDefaultInstance())) - .setSchemaDescriptor(new SpeechMethodDescriptorSupplier("StreamingRecognize")) - .build(); - } - } - } - return getStreamingRecognizeMethod; - } - - /** - * Creates a new async stub that supports all call types for the service - */ - public static SpeechStub newStub(io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SpeechStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechStub(channel, callOptions); - } - }; - return SpeechStub.newStub(factory, channel); - } - - /** - * Creates a new blocking-style stub that supports unary and streaming output calls on the service - */ - public static SpeechBlockingStub newBlockingStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SpeechBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechBlockingStub(channel, callOptions); - } - }; - return SpeechBlockingStub.newStub(factory, channel); - } - - /** - * Creates a new ListenableFuture-style stub that supports unary calls on the service - */ - public static SpeechFutureStub newFutureStub( - io.grpc.Channel channel) { - io.grpc.stub.AbstractStub.StubFactory factory = - new io.grpc.stub.AbstractStub.StubFactory() { - @java.lang.Override - public SpeechFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechFutureStub(channel, callOptions); - } - }; - return SpeechFutureStub.newStub(factory, channel); - } - - /** - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static abstract class SpeechImplBase implements io.grpc.BindableService { - - /** - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public void recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRecognizeMethod(), responseObserver); - } - - /** - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public void longRunningRecognize(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getLongRunningRecognizeMethod(), responseObserver); - } - - /** - *
-     * Performs bidirectional streaming speech recognition: receive results while
-     * sending audio. This method is only available via the gRPC API (not REST).
-     * 
- */ - public io.grpc.stub.StreamObserver streamingRecognize( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamingRecognizeMethod(), responseObserver); - } - - @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { - return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) - .addMethod( - getRecognizeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.RecognizeRequest, - com.google.cloud.speech.v1p1beta1.RecognizeResponse>( - this, METHODID_RECOGNIZE))) - .addMethod( - getLongRunningRecognizeMethod(), - io.grpc.stub.ServerCalls.asyncUnaryCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest, - com.google.longrunning.Operation>( - this, METHODID_LONG_RUNNING_RECOGNIZE))) - .addMethod( - getStreamingRecognizeMethod(), - io.grpc.stub.ServerCalls.asyncBidiStreamingCall( - new MethodHandlers< - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest, - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse>( - this, METHODID_STREAMING_RECOGNIZE))) - .build(); - } - } - - /** - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechStub extends io.grpc.stub.AbstractAsyncStub { - private SpeechStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechStub(channel, callOptions); - } - - /** - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public void recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getRecognizeMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public void longRunningRecognize(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest request, - io.grpc.stub.StreamObserver responseObserver) { - io.grpc.stub.ClientCalls.asyncUnaryCall( - getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), request, responseObserver); - } - - /** - *
-     * Performs bidirectional streaming speech recognition: receive results while
-     * sending audio. This method is only available via the gRPC API (not REST).
-     * 
- */ - public io.grpc.stub.StreamObserver streamingRecognize( - io.grpc.stub.StreamObserver responseObserver) { - return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( - getChannel().newCall(getStreamingRecognizeMethod(), getCallOptions()), responseObserver); - } - } - - /** - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechBlockingStub extends io.grpc.stub.AbstractBlockingStub { - private SpeechBlockingStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechBlockingStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechBlockingStub(channel, callOptions); - } - - /** - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public com.google.cloud.speech.v1p1beta1.RecognizeResponse recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getRecognizeMethod(), getCallOptions(), request); - } - - /** - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public com.google.longrunning.Operation longRunningRecognize(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest request) { - return io.grpc.stub.ClientCalls.blockingUnaryCall( - getChannel(), getLongRunningRecognizeMethod(), getCallOptions(), request); - } - } - - /** - *
-   * Service that implements Google Cloud Speech API.
-   * 
- */ - public static final class SpeechFutureStub extends io.grpc.stub.AbstractFutureStub { - private SpeechFutureStub( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - super(channel, callOptions); - } - - @java.lang.Override - protected SpeechFutureStub build( - io.grpc.Channel channel, io.grpc.CallOptions callOptions) { - return new SpeechFutureStub(channel, callOptions); - } - - /** - *
-     * Performs synchronous speech recognition: receive results after all audio
-     * has been sent and processed.
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture recognize( - com.google.cloud.speech.v1p1beta1.RecognizeRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getRecognizeMethod(), getCallOptions()), request); - } - - /** - *
-     * Performs asynchronous speech recognition: receive results via the
-     * google.longrunning.Operations interface. Returns either an
-     * `Operation.error` or an `Operation.response` which contains
-     * a `LongRunningRecognizeResponse` message.
-     * For more information on asynchronous speech recognition, see the
-     * [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize).
-     * 
- */ - public com.google.common.util.concurrent.ListenableFuture longRunningRecognize( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest request) { - return io.grpc.stub.ClientCalls.futureUnaryCall( - getChannel().newCall(getLongRunningRecognizeMethod(), getCallOptions()), request); - } - } - - private static final int METHODID_RECOGNIZE = 0; - private static final int METHODID_LONG_RUNNING_RECOGNIZE = 1; - private static final int METHODID_STREAMING_RECOGNIZE = 2; - - private static final class MethodHandlers implements - io.grpc.stub.ServerCalls.UnaryMethod, - io.grpc.stub.ServerCalls.ServerStreamingMethod, - io.grpc.stub.ServerCalls.ClientStreamingMethod, - io.grpc.stub.ServerCalls.BidiStreamingMethod { - private final SpeechImplBase serviceImpl; - private final int methodId; - - MethodHandlers(SpeechImplBase serviceImpl, int methodId) { - this.serviceImpl = serviceImpl; - this.methodId = methodId; - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_RECOGNIZE: - serviceImpl.recognize((com.google.cloud.speech.v1p1beta1.RecognizeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - case METHODID_LONG_RUNNING_RECOGNIZE: - serviceImpl.longRunningRecognize((com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) request, - (io.grpc.stub.StreamObserver) responseObserver); - break; - default: - throw new AssertionError(); - } - } - - @java.lang.Override - @java.lang.SuppressWarnings("unchecked") - public io.grpc.stub.StreamObserver invoke( - io.grpc.stub.StreamObserver responseObserver) { - switch (methodId) { - case METHODID_STREAMING_RECOGNIZE: - return (io.grpc.stub.StreamObserver) serviceImpl.streamingRecognize( - (io.grpc.stub.StreamObserver) responseObserver); - default: - throw new AssertionError(); - } - } - } - - private static abstract class SpeechBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { - SpeechBaseDescriptorSupplier() {} - - @java.lang.Override - public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.getDescriptor(); - } - - @java.lang.Override - public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { - return getFileDescriptor().findServiceByName("Speech"); - } - } - - private static final class SpeechFileDescriptorSupplier - extends SpeechBaseDescriptorSupplier { - SpeechFileDescriptorSupplier() {} - } - - private static final class SpeechMethodDescriptorSupplier - extends SpeechBaseDescriptorSupplier - implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { - private final String methodName; - - SpeechMethodDescriptorSupplier(String methodName) { - this.methodName = methodName; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { - return getServiceDescriptor().findMethodByName(methodName); - } - } - - private static volatile io.grpc.ServiceDescriptor serviceDescriptor; - - public static io.grpc.ServiceDescriptor getServiceDescriptor() { - io.grpc.ServiceDescriptor result = serviceDescriptor; - if (result == null) { - synchronized (SpeechGrpc.class) { - result = serviceDescriptor; - if (result == null) { - serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) - .setSchemaDescriptor(new SpeechFileDescriptorSupplier()) - .addMethod(getRecognizeMethod()) - .addMethod(getLongRunningRecognizeMethod()) - .addMethod(getStreamingRecognizeMethod()) - .build(); - } - } - } - return result; - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java deleted file mode 100644 index 8abd54116fdb..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequest.java +++ /dev/null @@ -1,1060 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Message sent by the client for the `CreateCustomClass` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.CreateCustomClassRequest} - */ -public final class CreateCustomClassRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) - CreateCustomClassRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use CreateCustomClassRequest.newBuilder() to construct. - private CreateCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CreateCustomClassRequest() { - parent_ = ""; - customClassId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CreateCustomClassRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CreateCustomClassRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - customClassId_ = s; - break; - } - case 26: { - com.google.cloud.speech.v1p1beta1.CustomClass.Builder subBuilder = null; - if (customClass_ != null) { - subBuilder = customClass_.toBuilder(); - } - customClass_ = input.readMessage(com.google.cloud.speech.v1p1beta1.CustomClass.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(customClass_); - customClass_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - *
-   * Required. The parent resource where this custom class will be created. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - *
-   * Required. The parent resource where this custom class will be created. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CUSTOM_CLASS_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object customClassId_; - /** - *
-   * Required. The ID to use for the custom class, which will become the final
-   * component of the custom class' resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClassId. - */ - @java.lang.Override - public java.lang.String getCustomClassId() { - java.lang.Object ref = customClassId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - customClassId_ = s; - return s; - } - } - /** - *
-   * Required. The ID to use for the custom class, which will become the final
-   * component of the custom class' resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for customClassId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCustomClassIdBytes() { - java.lang.Object ref = customClassId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - customClassId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CUSTOM_CLASS_FIELD_NUMBER = 3; - private com.google.cloud.speech.v1p1beta1.CustomClass customClass_; - /** - *
-   * Required. The custom class to create.
-   * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the customClass field is set. - */ - @java.lang.Override - public boolean hasCustomClass() { - return customClass_ != null; - } - /** - *
-   * Required. The custom class to create.
-   * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClass. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass() { - return customClass_ == null ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() : customClass_; - } - /** - *
-   * Required. The custom class to create.
-   * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder() { - return getCustomClass(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, customClassId_); - } - if (customClass_ != null) { - output.writeMessage(3, getCustomClass()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, customClassId_); - } - if (customClass_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getCustomClass()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest other = (com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) obj; - - if (!getParent() - .equals(other.getParent())) return false; - if (!getCustomClassId() - .equals(other.getCustomClassId())) return false; - if (hasCustomClass() != other.hasCustomClass()) return false; - if (hasCustomClass()) { - if (!getCustomClass() - .equals(other.getCustomClass())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + CUSTOM_CLASS_ID_FIELD_NUMBER; - hash = (53 * hash) + getCustomClassId().hashCode(); - if (hasCustomClass()) { - hash = (37 * hash) + CUSTOM_CLASS_FIELD_NUMBER; - hash = (53 * hash) + getCustomClass().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `CreateCustomClass` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.CreateCustomClassRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) - com.google.cloud.speech.v1p1beta1.CreateCustomClassRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - customClassId_ = ""; - - if (customClassBuilder_ == null) { - customClass_ = null; - } else { - customClass_ = null; - customClassBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest build() { - com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest result = new com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest(this); - result.parent_ = parent_; - result.customClassId_ = customClassId_; - if (customClassBuilder_ == null) { - result.customClass_ = customClass_; - } else { - result.customClass_ = customClassBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (!other.getCustomClassId().isEmpty()) { - customClassId_ = other.customClassId_; - onChanged(); - } - if (other.hasCustomClass()) { - mergeCustomClass(other.getCustomClass()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
-     * Required. The parent resource where this custom class will be created. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The parent resource where this custom class will be created. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The parent resource where this custom class will be created. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The parent resource where this custom class will be created. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
-     * Required. The parent resource where this custom class will be created. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private java.lang.Object customClassId_ = ""; - /** - *
-     * Required. The ID to use for the custom class, which will become the final
-     * component of the custom class' resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClassId. - */ - public java.lang.String getCustomClassId() { - java.lang.Object ref = customClassId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - customClassId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The ID to use for the custom class, which will become the final
-     * component of the custom class' resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for customClassId. - */ - public com.google.protobuf.ByteString - getCustomClassIdBytes() { - java.lang.Object ref = customClassId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - customClassId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The ID to use for the custom class, which will become the final
-     * component of the custom class' resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param value The customClassId to set. - * @return This builder for chaining. - */ - public Builder setCustomClassId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - customClassId_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The ID to use for the custom class, which will become the final
-     * component of the custom class' resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return This builder for chaining. - */ - public Builder clearCustomClassId() { - - customClassId_ = getDefaultInstance().getCustomClassId(); - onChanged(); - return this; - } - /** - *
-     * Required. The ID to use for the custom class, which will become the final
-     * component of the custom class' resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param value The bytes for customClassId to set. - * @return This builder for chaining. - */ - public Builder setCustomClassIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - customClassId_ = value; - onChanged(); - return this; - } - - private com.google.cloud.speech.v1p1beta1.CustomClass customClass_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> customClassBuilder_; - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the customClass field is set. - */ - public boolean hasCustomClass() { - return customClassBuilder_ != null || customClass_ != null; - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClass. - */ - public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass() { - if (customClassBuilder_ == null) { - return customClass_ == null ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() : customClass_; - } else { - return customClassBuilder_.getMessage(); - } - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setCustomClass(com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - customClass_ = value; - onChanged(); - } else { - customClassBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setCustomClass( - com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { - if (customClassBuilder_ == null) { - customClass_ = builderForValue.build(); - onChanged(); - } else { - customClassBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeCustomClass(com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassBuilder_ == null) { - if (customClass_ != null) { - customClass_ = - com.google.cloud.speech.v1p1beta1.CustomClass.newBuilder(customClass_).mergeFrom(value).buildPartial(); - } else { - customClass_ = value; - } - onChanged(); - } else { - customClassBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearCustomClass() { - if (customClassBuilder_ == null) { - customClass_ = null; - onChanged(); - } else { - customClass_ = null; - customClassBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassBuilder() { - - onChanged(); - return getCustomClassFieldBuilder().getBuilder(); - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder() { - if (customClassBuilder_ != null) { - return customClassBuilder_.getMessageOrBuilder(); - } else { - return customClass_ == null ? - com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() : customClass_; - } - } - /** - *
-     * Required. The custom class to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> - getCustomClassFieldBuilder() { - if (customClassBuilder_ == null) { - customClassBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( - getCustomClass(), - getParentForChildren(), - isClean()); - customClass_ = null; - } - return customClassBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) - private static final com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreateCustomClassRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreateCustomClassRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java deleted file mode 100644 index a042d191704a..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreateCustomClassRequestOrBuilder.java +++ /dev/null @@ -1,94 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface CreateCustomClassRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.CreateCustomClassRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The parent resource where this custom class will be created. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
-   * Required. The parent resource where this custom class will be created. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - - /** - *
-   * Required. The ID to use for the custom class, which will become the final
-   * component of the custom class' resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClassId. - */ - java.lang.String getCustomClassId(); - /** - *
-   * Required. The ID to use for the custom class, which will become the final
-   * component of the custom class' resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string custom_class_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for customClassId. - */ - com.google.protobuf.ByteString - getCustomClassIdBytes(); - - /** - *
-   * Required. The custom class to create.
-   * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the customClass field is set. - */ - boolean hasCustomClass(); - /** - *
-   * Required. The custom class to create.
-   * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClass. - */ - com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass(); - /** - *
-   * Required. The custom class to create.
-   * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java deleted file mode 100644 index c4450fceb5eb..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequest.java +++ /dev/null @@ -1,1060 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Message sent by the client for the `CreatePhraseSet` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} - */ -public final class CreatePhraseSetRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) - CreatePhraseSetRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use CreatePhraseSetRequest.newBuilder() to construct. - private CreatePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CreatePhraseSetRequest() { - parent_ = ""; - phraseSetId_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CreatePhraseSetRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CreatePhraseSetRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - phraseSetId_ = s; - break; - } - case 26: { - com.google.cloud.speech.v1p1beta1.PhraseSet.Builder subBuilder = null; - if (phraseSet_ != null) { - subBuilder = phraseSet_.toBuilder(); - } - phraseSet_ = input.readMessage(com.google.cloud.speech.v1p1beta1.PhraseSet.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(phraseSet_); - phraseSet_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - *
-   * Required. The parent resource where this phrase set will be created. Format:
-   * `projects/{project}/locations/{location}/phraseSets`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - *
-   * Required. The parent resource where this phrase set will be created. Format:
-   * `projects/{project}/locations/{location}/phraseSets`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PHRASE_SET_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object phraseSetId_; - /** - *
-   * Required. The ID to use for the phrase set, which will become the final
-   * component of the phrase set's resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSetId. - */ - @java.lang.Override - public java.lang.String getPhraseSetId() { - java.lang.Object ref = phraseSetId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - phraseSetId_ = s; - return s; - } - } - /** - *
-   * Required. The ID to use for the phrase set, which will become the final
-   * component of the phrase set's resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for phraseSetId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPhraseSetIdBytes() { - java.lang.Object ref = phraseSetId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - phraseSetId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PHRASE_SET_FIELD_NUMBER = 3; - private com.google.cloud.speech.v1p1beta1.PhraseSet phraseSet_; - /** - *
-   * Required. The phrase set to create.
-   * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the phraseSet field is set. - */ - @java.lang.Override - public boolean hasPhraseSet() { - return phraseSet_ != null; - } - /** - *
-   * Required. The phrase set to create.
-   * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSet. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet() { - return phraseSet_ == null ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() : phraseSet_; - } - /** - *
-   * Required. The phrase set to create.
-   * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder() { - return getPhraseSet(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(phraseSetId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, phraseSetId_); - } - if (phraseSet_ != null) { - output.writeMessage(3, getPhraseSet()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(phraseSetId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, phraseSetId_); - } - if (phraseSet_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getPhraseSet()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest other = (com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) obj; - - if (!getParent() - .equals(other.getParent())) return false; - if (!getPhraseSetId() - .equals(other.getPhraseSetId())) return false; - if (hasPhraseSet() != other.hasPhraseSet()) return false; - if (hasPhraseSet()) { - if (!getPhraseSet() - .equals(other.getPhraseSet())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PHRASE_SET_ID_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSetId().hashCode(); - if (hasPhraseSet()) { - hash = (37 * hash) + PHRASE_SET_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSet().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `CreatePhraseSet` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.CreatePhraseSetRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) - com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - phraseSetId_ = ""; - - if (phraseSetBuilder_ == null) { - phraseSet_ = null; - } else { - phraseSet_ = null; - phraseSetBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest build() { - com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest result = new com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest(this); - result.parent_ = parent_; - result.phraseSetId_ = phraseSetId_; - if (phraseSetBuilder_ == null) { - result.phraseSet_ = phraseSet_; - } else { - result.phraseSet_ = phraseSetBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (!other.getPhraseSetId().isEmpty()) { - phraseSetId_ = other.phraseSetId_; - onChanged(); - } - if (other.hasPhraseSet()) { - mergePhraseSet(other.getPhraseSet()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
-     * Required. The parent resource where this phrase set will be created. Format:
-     * `projects/{project}/locations/{location}/phraseSets`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The parent resource where this phrase set will be created. Format:
-     * `projects/{project}/locations/{location}/phraseSets`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The parent resource where this phrase set will be created. Format:
-     * `projects/{project}/locations/{location}/phraseSets`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The parent resource where this phrase set will be created. Format:
-     * `projects/{project}/locations/{location}/phraseSets`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
-     * Required. The parent resource where this phrase set will be created. Format:
-     * `projects/{project}/locations/{location}/phraseSets`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private java.lang.Object phraseSetId_ = ""; - /** - *
-     * Required. The ID to use for the phrase set, which will become the final
-     * component of the phrase set's resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSetId. - */ - public java.lang.String getPhraseSetId() { - java.lang.Object ref = phraseSetId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - phraseSetId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The ID to use for the phrase set, which will become the final
-     * component of the phrase set's resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for phraseSetId. - */ - public com.google.protobuf.ByteString - getPhraseSetIdBytes() { - java.lang.Object ref = phraseSetId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - phraseSetId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The ID to use for the phrase set, which will become the final
-     * component of the phrase set's resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param value The phraseSetId to set. - * @return This builder for chaining. - */ - public Builder setPhraseSetId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - phraseSetId_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The ID to use for the phrase set, which will become the final
-     * component of the phrase set's resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return This builder for chaining. - */ - public Builder clearPhraseSetId() { - - phraseSetId_ = getDefaultInstance().getPhraseSetId(); - onChanged(); - return this; - } - /** - *
-     * Required. The ID to use for the phrase set, which will become the final
-     * component of the phrase set's resource name.
-     * This value should restrict to letters, numbers, and hyphens, with the first
-     * character a letter, the last a letter or a number, and be 4-63 characters.
-     * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param value The bytes for phraseSetId to set. - * @return This builder for chaining. - */ - public Builder setPhraseSetIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - phraseSetId_ = value; - onChanged(); - return this; - } - - private com.google.cloud.speech.v1p1beta1.PhraseSet phraseSet_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> phraseSetBuilder_; - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the phraseSet field is set. - */ - public boolean hasPhraseSet() { - return phraseSetBuilder_ != null || phraseSet_ != null; - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSet. - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet() { - if (phraseSetBuilder_ == null) { - return phraseSet_ == null ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() : phraseSet_; - } else { - return phraseSetBuilder_.getMessage(); - } - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setPhraseSet(com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - phraseSet_ = value; - onChanged(); - } else { - phraseSetBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setPhraseSet( - com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { - if (phraseSetBuilder_ == null) { - phraseSet_ = builderForValue.build(); - onChanged(); - } else { - phraseSetBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergePhraseSet(com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetBuilder_ == null) { - if (phraseSet_ != null) { - phraseSet_ = - com.google.cloud.speech.v1p1beta1.PhraseSet.newBuilder(phraseSet_).mergeFrom(value).buildPartial(); - } else { - phraseSet_ = value; - } - onChanged(); - } else { - phraseSetBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearPhraseSet() { - if (phraseSetBuilder_ == null) { - phraseSet_ = null; - onChanged(); - } else { - phraseSet_ = null; - phraseSetBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder getPhraseSetBuilder() { - - onChanged(); - return getPhraseSetFieldBuilder().getBuilder(); - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder() { - if (phraseSetBuilder_ != null) { - return phraseSetBuilder_.getMessageOrBuilder(); - } else { - return phraseSet_ == null ? - com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() : phraseSet_; - } - } - /** - *
-     * Required. The phrase set to create.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> - getPhraseSetFieldBuilder() { - if (phraseSetBuilder_ == null) { - phraseSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder>( - getPhraseSet(), - getParentForChildren(), - isClean()); - phraseSet_ = null; - } - return phraseSetBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) - private static final com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CreatePhraseSetRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CreatePhraseSetRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java deleted file mode 100644 index e21aaa6f933a..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CreatePhraseSetRequestOrBuilder.java +++ /dev/null @@ -1,94 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface CreatePhraseSetRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.CreatePhraseSetRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The parent resource where this phrase set will be created. Format:
-   * `projects/{project}/locations/{location}/phraseSets`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
-   * Required. The parent resource where this phrase set will be created. Format:
-   * `projects/{project}/locations/{location}/phraseSets`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - - /** - *
-   * Required. The ID to use for the phrase set, which will become the final
-   * component of the phrase set's resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSetId. - */ - java.lang.String getPhraseSetId(); - /** - *
-   * Required. The ID to use for the phrase set, which will become the final
-   * component of the phrase set's resource name.
-   * This value should restrict to letters, numbers, and hyphens, with the first
-   * character a letter, the last a letter or a number, and be 4-63 characters.
-   * 
- * - * string phrase_set_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for phraseSetId. - */ - com.google.protobuf.ByteString - getPhraseSetIdBytes(); - - /** - *
-   * Required. The phrase set to create.
-   * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the phraseSet field is set. - */ - boolean hasPhraseSet(); - /** - *
-   * Required. The phrase set to create.
-   * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSet. - */ - com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet(); - /** - *
-   * Required. The phrase set to create.
-   * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java deleted file mode 100644 index 5ffa435fe8f2..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClass.java +++ /dev/null @@ -1,1829 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * A set of words or phrases that represents a common concept likely to appear
- * in your audio, for example a list of passenger ship names. CustomClass items
- * can be substituted into placeholders that you set in PhraseSet phrases.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.CustomClass} - */ -public final class CustomClass extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.CustomClass) - CustomClassOrBuilder { -private static final long serialVersionUID = 0L; - // Use CustomClass.newBuilder() to construct. - private CustomClass(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private CustomClass() { - name_ = ""; - customClassId_ = ""; - items_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new CustomClass(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private CustomClass( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - customClassId_ = s; - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - items_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - items_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - items_ = java.util.Collections.unmodifiableList(items_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.CustomClass.class, com.google.cloud.speech.v1p1beta1.CustomClass.Builder.class); - } - - public interface ClassItemOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * The class item's value.
-     * 
- * - * string value = 1; - * @return The value. - */ - java.lang.String getValue(); - /** - *
-     * The class item's value.
-     * 
- * - * string value = 1; - * @return The bytes for value. - */ - com.google.protobuf.ByteString - getValueBytes(); - } - /** - *
-   * An item of the class.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.CustomClass.ClassItem} - */ - public static final class ClassItem extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) - ClassItemOrBuilder { - private static final long serialVersionUID = 0L; - // Use ClassItem.newBuilder() to construct. - private ClassItem(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ClassItem() { - value_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ClassItem(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ClassItem( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - value_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.class, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private volatile java.lang.Object value_; - /** - *
-     * The class item's value.
-     * 
- * - * string value = 1; - * @return The value. - */ - @java.lang.Override - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } - } - /** - *
-     * The class item's value.
-     * 
- * - * string value = 1; - * @return The bytes for value. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem other = (com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem) obj; - - if (!getValue() - .equals(other.getValue())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * An item of the class.
-     * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.CustomClass.ClassItem} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.class, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - value_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem build() { - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem buildPartial() { - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem result = new com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem(this); - result.value_ = value_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem other) { - if (other == com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.getDefaultInstance()) return this; - if (!other.getValue().isEmpty()) { - value_ = other.value_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object value_ = ""; - /** - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * @return The value. - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * @return The bytes for value. - */ - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - /** - *
-       * The class item's value.
-       * 
- * - * string value = 1; - * @param value The bytes for value to set. - * @return This builder for chaining. - */ - public Builder setValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - value_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.CustomClass.ClassItem) - private static final com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem(); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ClassItem parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ClassItem(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * The resource name of the custom class.
-   * 
- * - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * The resource name of the custom class.
-   * 
- * - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CUSTOM_CLASS_ID_FIELD_NUMBER = 2; - private volatile java.lang.Object customClassId_; - /** - *
-   * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass. Case sensitive.
-   * 
- * - * string custom_class_id = 2; - * @return The customClassId. - */ - @java.lang.Override - public java.lang.String getCustomClassId() { - java.lang.Object ref = customClassId_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - customClassId_ = s; - return s; - } - } - /** - *
-   * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass. Case sensitive.
-   * 
- * - * string custom_class_id = 2; - * @return The bytes for customClassId. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getCustomClassIdBytes() { - java.lang.Object ref = customClassId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - customClassId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ITEMS_FIELD_NUMBER = 3; - private java.util.List items_; - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public java.util.List getItemsList() { - return items_; - } - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public java.util.List - getItemsOrBuilderList() { - return items_; - } - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public int getItemsCount() { - return items_.size(); - } - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getItems(int index) { - return items_.get(index); - } - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( - int index) { - return items_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, customClassId_); - } - for (int i = 0; i < items_.size(); i++) { - output.writeMessage(3, items_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(customClassId_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, customClassId_); - } - for (int i = 0; i < items_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, items_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.CustomClass)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.CustomClass other = (com.google.cloud.speech.v1p1beta1.CustomClass) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getCustomClassId() - .equals(other.getCustomClassId())) return false; - if (!getItemsList() - .equals(other.getItemsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (37 * hash) + CUSTOM_CLASS_ID_FIELD_NUMBER; - hash = (53 * hash) + getCustomClassId().hashCode(); - if (getItemsCount() > 0) { - hash = (37 * hash) + ITEMS_FIELD_NUMBER; - hash = (53 * hash) + getItemsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.CustomClass parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.CustomClass prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * A set of words or phrases that represents a common concept likely to appear
-   * in your audio, for example a list of passenger ship names. CustomClass items
-   * can be substituted into placeholders that you set in PhraseSet phrases.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.CustomClass} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.CustomClass) - com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.CustomClass.class, com.google.cloud.speech.v1p1beta1.CustomClass.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.CustomClass.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getItemsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - customClassId_ = ""; - - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - itemsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass build() { - com.google.cloud.speech.v1p1beta1.CustomClass result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass buildPartial() { - com.google.cloud.speech.v1p1beta1.CustomClass result = new com.google.cloud.speech.v1p1beta1.CustomClass(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - result.customClassId_ = customClassId_; - if (itemsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - items_ = java.util.Collections.unmodifiableList(items_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.items_ = items_; - } else { - result.items_ = itemsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.CustomClass) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.CustomClass)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.CustomClass other) { - if (other == com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (!other.getCustomClassId().isEmpty()) { - customClassId_ = other.customClassId_; - onChanged(); - } - if (itemsBuilder_ == null) { - if (!other.items_.isEmpty()) { - if (items_.isEmpty()) { - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureItemsIsMutable(); - items_.addAll(other.items_); - } - onChanged(); - } - } else { - if (!other.items_.isEmpty()) { - if (itemsBuilder_.isEmpty()) { - itemsBuilder_.dispose(); - itemsBuilder_ = null; - items_ = other.items_; - bitField0_ = (bitField0_ & ~0x00000001); - itemsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getItemsFieldBuilder() : null; - } else { - itemsBuilder_.addAllMessages(other.items_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.CustomClass parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.CustomClass) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * The resource name of the custom class.
-     * 
- * - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.lang.Object customClassId_ = ""; - /** - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass. Case sensitive.
-     * 
- * - * string custom_class_id = 2; - * @return The customClassId. - */ - public java.lang.String getCustomClassId() { - java.lang.Object ref = customClassId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - customClassId_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass. Case sensitive.
-     * 
- * - * string custom_class_id = 2; - * @return The bytes for customClassId. - */ - public com.google.protobuf.ByteString - getCustomClassIdBytes() { - java.lang.Object ref = customClassId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - customClassId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass. Case sensitive.
-     * 
- * - * string custom_class_id = 2; - * @param value The customClassId to set. - * @return This builder for chaining. - */ - public Builder setCustomClassId( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - customClassId_ = value; - onChanged(); - return this; - } - /** - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass. Case sensitive.
-     * 
- * - * string custom_class_id = 2; - * @return This builder for chaining. - */ - public Builder clearCustomClassId() { - - customClassId_ = getDefaultInstance().getCustomClassId(); - onChanged(); - return this; - } - /** - *
-     * If this custom class is a resource, the custom_class_id is the resource id
-     * of the CustomClass. Case sensitive.
-     * 
- * - * string custom_class_id = 2; - * @param value The bytes for customClassId to set. - * @return This builder for chaining. - */ - public Builder setCustomClassIdBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - customClassId_ = value; - onChanged(); - return this; - } - - private java.util.List items_ = - java.util.Collections.emptyList(); - private void ensureItemsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - items_ = new java.util.ArrayList(items_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder> itemsBuilder_; - - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public java.util.List getItemsList() { - if (itemsBuilder_ == null) { - return java.util.Collections.unmodifiableList(items_); - } else { - return itemsBuilder_.getMessageList(); - } - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public int getItemsCount() { - if (itemsBuilder_ == null) { - return items_.size(); - } else { - return itemsBuilder_.getCount(); - } - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getItems(int index) { - if (itemsBuilder_ == null) { - return items_.get(index); - } else { - return itemsBuilder_.getMessage(index); - } - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder setItems( - int index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.set(index, value); - onChanged(); - } else { - itemsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder setItems( - int index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.set(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder addItems(com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(value); - onChanged(); - } else { - itemsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder addItems( - int index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem value) { - if (itemsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureItemsIsMutable(); - items_.add(index, value); - onChanged(); - } else { - itemsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder addItems( - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder addItems( - int index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder builderForValue) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.add(index, builderForValue.build()); - onChanged(); - } else { - itemsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder addAllItems( - java.lang.Iterable values) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, items_); - onChanged(); - } else { - itemsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder clearItems() { - if (itemsBuilder_ == null) { - items_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - itemsBuilder_.clear(); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public Builder removeItems(int index) { - if (itemsBuilder_ == null) { - ensureItemsIsMutable(); - items_.remove(index); - onChanged(); - } else { - itemsBuilder_.remove(index); - } - return this; - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder getItemsBuilder( - int index) { - return getItemsFieldBuilder().getBuilder(index); - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( - int index) { - if (itemsBuilder_ == null) { - return items_.get(index); } else { - return itemsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public java.util.List - getItemsOrBuilderList() { - if (itemsBuilder_ != null) { - return itemsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(items_); - } - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder addItemsBuilder() { - return getItemsFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.getDefaultInstance()); - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder addItemsBuilder( - int index) { - return getItemsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.getDefaultInstance()); - } - /** - *
-     * A collection of class items.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - public java.util.List - getItemsBuilderList() { - return getItemsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder> - getItemsFieldBuilder() { - if (itemsBuilder_ == null) { - itemsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem.Builder, com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder>( - items_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - items_ = null; - } - return itemsBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.CustomClass) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.CustomClass) - private static final com.google.cloud.speech.v1p1beta1.CustomClass DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.CustomClass(); - } - - public static com.google.cloud.speech.v1p1beta1.CustomClass getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public CustomClass parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new CustomClass(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java deleted file mode 100644 index cf53d502e2b5..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassName.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class CustomClassName implements ResourceName { - private static final PathTemplate PROJECT_LOCATION_CUSTOM_CLASS = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/customClasses/{custom_class}"); - private volatile Map fieldValuesMap; - private final String project; - private final String location; - private final String customClass; - - @Deprecated - protected CustomClassName() { - project = null; - location = null; - customClass = null; - } - - private CustomClassName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - customClass = Preconditions.checkNotNull(builder.getCustomClass()); - } - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getCustomClass() { - return customClass; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static CustomClassName of(String project, String location, String customClass) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setCustomClass(customClass) - .build(); - } - - public static String format(String project, String location, String customClass) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setCustomClass(customClass) - .build() - .toString(); - } - - public static CustomClassName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_LOCATION_CUSTOM_CLASS.validatedMatch( - formattedString, "CustomClassName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("custom_class")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (CustomClassName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION_CUSTOM_CLASS.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (location != null) { - fieldMapBuilder.put("location", location); - } - if (customClass != null) { - fieldMapBuilder.put("custom_class", customClass); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_LOCATION_CUSTOM_CLASS.instantiate( - "project", project, "location", location, "custom_class", customClass); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - CustomClassName that = ((CustomClassName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.location, that.location) - && Objects.equals(this.customClass, that.customClass); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - h *= 1000003; - h ^= Objects.hashCode(customClass); - return h; - } - - /** Builder for projects/{project}/locations/{location}/customClasses/{custom_class}. */ - public static class Builder { - private String project; - private String location; - private String customClass; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getCustomClass() { - return customClass; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - public Builder setCustomClass(String customClass) { - this.customClass = customClass; - return this; - } - - private Builder(CustomClassName customClassName) { - this.project = customClassName.project; - this.location = customClassName.location; - this.customClass = customClassName.customClass; - } - - public CustomClassName build() { - return new CustomClassName(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java deleted file mode 100644 index 5a2383a9cef5..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/CustomClassOrBuilder.java +++ /dev/null @@ -1,95 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface CustomClassOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.CustomClass) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The resource name of the custom class.
-   * 
- * - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * The resource name of the custom class.
-   * 
- * - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-   * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass. Case sensitive.
-   * 
- * - * string custom_class_id = 2; - * @return The customClassId. - */ - java.lang.String getCustomClassId(); - /** - *
-   * If this custom class is a resource, the custom_class_id is the resource id
-   * of the CustomClass. Case sensitive.
-   * 
- * - * string custom_class_id = 2; - * @return The bytes for customClassId. - */ - com.google.protobuf.ByteString - getCustomClassIdBytes(); - - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - java.util.List - getItemsList(); - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItem getItems(int index); - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - int getItemsCount(); - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - java.util.List - getItemsOrBuilderList(); - /** - *
-   * A collection of class items.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass.ClassItem items = 3; - */ - com.google.cloud.speech.v1p1beta1.CustomClass.ClassItemOrBuilder getItemsOrBuilder( - int index); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java deleted file mode 100644 index 8ee08778b649..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequest.java +++ /dev/null @@ -1,637 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Message sent by the client for the `DeleteCustomClass` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} - */ -public final class DeleteCustomClassRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) - DeleteCustomClassRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeleteCustomClassRequest.newBuilder() to construct. - private DeleteCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeleteCustomClassRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeleteCustomClassRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeleteCustomClassRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * Required. The name of the custom class to delete. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * Required. The name of the custom class to delete. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest other = (com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `DeleteCustomClass` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.DeleteCustomClassRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) - com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest build() { - com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest result = new com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
-     * Required. The name of the custom class to delete. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The name of the custom class to delete. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The name of the custom class to delete. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The name of the custom class to delete. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * Required. The name of the custom class to delete. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) - private static final com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeleteCustomClassRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeleteCustomClassRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java deleted file mode 100644 index 477f46c0e2f8..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeleteCustomClassRequestOrBuilder.java +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface DeleteCustomClassRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.DeleteCustomClassRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The name of the custom class to delete. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * Required. The name of the custom class to delete. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java deleted file mode 100644 index 998916bf5c15..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequest.java +++ /dev/null @@ -1,602 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Message sent by the client for the `DeletePhraseSet` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} - */ -public final class DeletePhraseSetRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) - DeletePhraseSetRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use DeletePhraseSetRequest.newBuilder() to construct. - private DeletePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private DeletePhraseSetRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new DeletePhraseSetRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private DeletePhraseSetRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * Required. The name of the phrase set to delete. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * Required. The name of the phrase set to delete. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest other = (com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `DeletePhraseSet` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.DeletePhraseSetRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) - com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest build() { - com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest result = new com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
-     * Required. The name of the phrase set to delete. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The name of the phrase set to delete. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The name of the phrase set to delete. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The name of the phrase set to delete. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * Required. The name of the phrase set to delete. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) - private static final com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DeletePhraseSetRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new DeletePhraseSetRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java deleted file mode 100644 index 246c425ca97f..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/DeletePhraseSetRequestOrBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface DeletePhraseSetRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.DeletePhraseSetRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The name of the phrase set to delete. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * Required. The name of the phrase set to delete. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java deleted file mode 100644 index 9d6b0d7907f8..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequest.java +++ /dev/null @@ -1,602 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Message sent by the client for the `GetCustomClass` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.GetCustomClassRequest} - */ -public final class GetCustomClassRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.GetCustomClassRequest) - GetCustomClassRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use GetCustomClassRequest.newBuilder() to construct. - private GetCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GetCustomClassRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GetCustomClassRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GetCustomClassRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * Required. The name of the custom class to retrieve. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * Required. The name of the custom class to retrieve. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.GetCustomClassRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.GetCustomClassRequest other = (com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.GetCustomClassRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `GetCustomClass` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.GetCustomClassRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.GetCustomClassRequest) - com.google.cloud.speech.v1p1beta1.GetCustomClassRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.GetCustomClassRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.GetCustomClassRequest build() { - com.google.cloud.speech.v1p1beta1.GetCustomClassRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.GetCustomClassRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.GetCustomClassRequest result = new com.google.cloud.speech.v1p1beta1.GetCustomClassRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.GetCustomClassRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.GetCustomClassRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.GetCustomClassRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.GetCustomClassRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.GetCustomClassRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
-     * Required. The name of the custom class to retrieve. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The name of the custom class to retrieve. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The name of the custom class to retrieve. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The name of the custom class to retrieve. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * Required. The name of the custom class to retrieve. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.GetCustomClassRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.GetCustomClassRequest) - private static final com.google.cloud.speech.v1p1beta1.GetCustomClassRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.GetCustomClassRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.GetCustomClassRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetCustomClassRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetCustomClassRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.GetCustomClassRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java deleted file mode 100644 index 721b97fda97f..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetCustomClassRequestOrBuilder.java +++ /dev/null @@ -1,31 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface GetCustomClassRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.GetCustomClassRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The name of the custom class to retrieve. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * Required. The name of the custom class to retrieve. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java deleted file mode 100644 index e479df0420af..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequest.java +++ /dev/null @@ -1,637 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Message sent by the client for the `GetPhraseSet` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.GetPhraseSetRequest} - */ -public final class GetPhraseSetRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) - GetPhraseSetRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use GetPhraseSetRequest.newBuilder() to construct. - private GetPhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private GetPhraseSetRequest() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new GetPhraseSetRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private GetPhraseSetRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.Builder.class); - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * Required. The name of the phrase set to retrieve. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * Required. The name of the phrase set to retrieve. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest other = (com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `GetPhraseSet` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.GetPhraseSetRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) - com.google.cloud.speech.v1p1beta1.GetPhraseSetRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest build() { - com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest result = new com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest(this); - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object name_ = ""; - /** - *
-     * Required. The name of the phrase set to retrieve. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The name of the phrase set to retrieve. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The name of the phrase set to retrieve. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The name of the phrase set to retrieve. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * Required. The name of the phrase set to retrieve. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) - private static final com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public GetPhraseSetRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new GetPhraseSetRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java deleted file mode 100644 index b5ad6ae0036f..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/GetPhraseSetRequestOrBuilder.java +++ /dev/null @@ -1,41 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface GetPhraseSetRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.GetPhraseSetRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The name of the phrase set to retrieve. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * Required. The name of the phrase set to retrieve. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java deleted file mode 100644 index 6a67c3edf078..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequest.java +++ /dev/null @@ -1,916 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Message sent by the client for the `ListCustomClasses` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.ListCustomClassesRequest} - */ -public final class ListCustomClassesRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) - ListCustomClassesRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListCustomClassesRequest.newBuilder() to construct. - private ListCustomClassesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListCustomClassesRequest() { - parent_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListCustomClassesRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListCustomClassesRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 16: { - - pageSize_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.class, com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - *
-   * Required. The parent, which owns this collection of custom classes. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - *
-   * Required. The parent, which owns this collection of custom classes. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; - /** - *
-   * The maximum number of custom classes to return. The service may return
-   * fewer than this value. If unspecified, at most 50 custom classes will be
-   * returned. The maximum value is 1000; values above 1000 will be coerced to
-   * 1000.
-   * 
- * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - *
-   * A page token, received from a previous `ListCustomClass` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListCustomClass` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - *
-   * A page token, received from a previous `ListCustomClass` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListCustomClass` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest other = (com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) obj; - - if (!getParent() - .equals(other.getParent())) return false; - if (getPageSize() - != other.getPageSize()) return false; - if (!getPageToken() - .equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `ListCustomClasses` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.ListCustomClassesRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) - com.google.cloud.speech.v1p1beta1.ListCustomClassesRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.class, com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest build() { - com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest result = new com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest(this); - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
-     * Required. The parent, which owns this collection of custom classes. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The parent, which owns this collection of custom classes. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The parent, which owns this collection of custom classes. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The parent, which owns this collection of custom classes. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
-     * Required. The parent, which owns this collection of custom classes. Format:
-     * `projects/{project}/locations/{location}/customClasses`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private int pageSize_ ; - /** - *
-     * The maximum number of custom classes to return. The service may return
-     * fewer than this value. If unspecified, at most 50 custom classes will be
-     * returned. The maximum value is 1000; values above 1000 will be coerced to
-     * 1000.
-     * 
- * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - *
-     * The maximum number of custom classes to return. The service may return
-     * fewer than this value. If unspecified, at most 50 custom classes will be
-     * returned. The maximum value is 1000; values above 1000 will be coerced to
-     * 1000.
-     * 
- * - * int32 page_size = 2; - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - *
-     * The maximum number of custom classes to return. The service may return
-     * fewer than this value. If unspecified, at most 50 custom classes will be
-     * returned. The maximum value is 1000; values above 1000 will be coerced to
-     * 1000.
-     * 
- * - * int32 page_size = 2; - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - *
-     * A page token, received from a previous `ListCustomClass` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListCustomClass` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * A page token, received from a previous `ListCustomClass` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListCustomClass` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * A page token, received from a previous `ListCustomClass` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListCustomClass` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - *
-     * A page token, received from a previous `ListCustomClass` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListCustomClass` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - *
-     * A page token, received from a previous `ListCustomClass` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListCustomClass` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) - private static final com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListCustomClassesRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListCustomClassesRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java deleted file mode 100644 index e83c2e601a5a..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesRequestOrBuilder.java +++ /dev/null @@ -1,80 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface ListCustomClassesRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.ListCustomClassesRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The parent, which owns this collection of custom classes. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
-   * Required. The parent, which owns this collection of custom classes. Format:
-   * `projects/{project}/locations/{location}/customClasses`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - - /** - *
-   * The maximum number of custom classes to return. The service may return
-   * fewer than this value. If unspecified, at most 50 custom classes will be
-   * returned. The maximum value is 1000; values above 1000 will be coerced to
-   * 1000.
-   * 
- * - * int32 page_size = 2; - * @return The pageSize. - */ - int getPageSize(); - - /** - *
-   * A page token, received from a previous `ListCustomClass` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListCustomClass` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - *
-   * A page token, received from a previous `ListCustomClass` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListCustomClass` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java deleted file mode 100644 index ebef3078cb54..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponse.java +++ /dev/null @@ -1,1045 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Message returned to the client by the `ListCustomClasses` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.ListCustomClassesResponse} - */ -public final class ListCustomClassesResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) - ListCustomClassesResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListCustomClassesResponse.newBuilder() to construct. - private ListCustomClassesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListCustomClassesResponse() { - customClasses_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListCustomClassesResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListCustomClassesResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - customClasses_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - customClasses_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.CustomClass.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - customClasses_ = java.util.Collections.unmodifiableList(customClasses_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.class, com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.Builder.class); - } - - public static final int CUSTOM_CLASSES_FIELD_NUMBER = 1; - private java.util.List customClasses_; - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - @java.lang.Override - public java.util.List getCustomClassesList() { - return customClasses_; - } - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - @java.lang.Override - public java.util.List - getCustomClassesOrBuilderList() { - return customClasses_; - } - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - @java.lang.Override - public int getCustomClassesCount() { - return customClasses_.size(); - } - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { - return customClasses_.get(index); - } - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index) { - return customClasses_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < customClasses_.size(); i++) { - output.writeMessage(1, customClasses_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < customClasses_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, customClasses_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse other = (com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse) obj; - - if (!getCustomClassesList() - .equals(other.getCustomClassesList())) return false; - if (!getNextPageToken() - .equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getCustomClassesCount() > 0) { - hash = (37 * hash) + CUSTOM_CLASSES_FIELD_NUMBER; - hash = (53 * hash) + getCustomClassesList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message returned to the client by the `ListCustomClasses` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.ListCustomClassesResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) - com.google.cloud.speech.v1p1beta1.ListCustomClassesResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.class, com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getCustomClassesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (customClassesBuilder_ == null) { - customClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - customClassesBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse build() { - com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse buildPartial() { - com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse result = new com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse(this); - int from_bitField0_ = bitField0_; - if (customClassesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - customClasses_ = java.util.Collections.unmodifiableList(customClasses_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.customClasses_ = customClasses_; - } else { - result.customClasses_ = customClassesBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse other) { - if (other == com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse.getDefaultInstance()) return this; - if (customClassesBuilder_ == null) { - if (!other.customClasses_.isEmpty()) { - if (customClasses_.isEmpty()) { - customClasses_ = other.customClasses_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCustomClassesIsMutable(); - customClasses_.addAll(other.customClasses_); - } - onChanged(); - } - } else { - if (!other.customClasses_.isEmpty()) { - if (customClassesBuilder_.isEmpty()) { - customClassesBuilder_.dispose(); - customClassesBuilder_ = null; - customClasses_ = other.customClasses_; - bitField0_ = (bitField0_ & ~0x00000001); - customClassesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getCustomClassesFieldBuilder() : null; - } else { - customClassesBuilder_.addAllMessages(other.customClasses_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List customClasses_ = - java.util.Collections.emptyList(); - private void ensureCustomClassesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - customClasses_ = new java.util.ArrayList(customClasses_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> customClassesBuilder_; - - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public java.util.List getCustomClassesList() { - if (customClassesBuilder_ == null) { - return java.util.Collections.unmodifiableList(customClasses_); - } else { - return customClassesBuilder_.getMessageList(); - } - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public int getCustomClassesCount() { - if (customClassesBuilder_ == null) { - return customClasses_.size(); - } else { - return customClassesBuilder_.getCount(); - } - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { - if (customClassesBuilder_ == null) { - return customClasses_.get(index); - } else { - return customClassesBuilder_.getMessage(index); - } - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public Builder setCustomClasses( - int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.set(index, value); - onChanged(); - } else { - customClassesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public Builder setCustomClasses( - int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.set(index, builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public Builder addCustomClasses(com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.add(value); - onChanged(); - } else { - customClassesBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public Builder addCustomClasses( - int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.add(index, value); - onChanged(); - } else { - customClassesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public Builder addCustomClasses( - com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.add(builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public Builder addCustomClasses( - int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.add(index, builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public Builder addAllCustomClasses( - java.lang.Iterable values) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, customClasses_); - onChanged(); - } else { - customClassesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public Builder clearCustomClasses() { - if (customClassesBuilder_ == null) { - customClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - customClassesBuilder_.clear(); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public Builder removeCustomClasses(int index) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.remove(index); - onChanged(); - } else { - customClassesBuilder_.remove(index); - } - return this; - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassesBuilder( - int index) { - return getCustomClassesFieldBuilder().getBuilder(index); - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index) { - if (customClassesBuilder_ == null) { - return customClasses_.get(index); } else { - return customClassesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public java.util.List - getCustomClassesOrBuilderList() { - if (customClassesBuilder_ != null) { - return customClassesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(customClasses_); - } - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder() { - return getCustomClassesFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()); - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder( - int index) { - return getCustomClassesFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()); - } - /** - *
-     * The custom classes.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - public java.util.List - getCustomClassesBuilderList() { - return getCustomClassesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> - getCustomClassesFieldBuilder() { - if (customClassesBuilder_ == null) { - customClassesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( - customClasses_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - customClasses_ = null; - } - return customClassesBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) - private static final com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse(); - } - - public static com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListCustomClassesResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListCustomClassesResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java deleted file mode 100644 index bb845e9819e6..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListCustomClassesResponseOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface ListCustomClassesResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.ListCustomClassesResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - java.util.List - getCustomClassesList(); - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index); - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - int getCustomClassesCount(); - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - java.util.List - getCustomClassesOrBuilderList(); - /** - *
-   * The custom classes.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 1; - */ - com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index); - - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java deleted file mode 100644 index 57facef81cd3..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequest.java +++ /dev/null @@ -1,916 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Message sent by the client for the `ListPhraseSet` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.ListPhraseSetRequest} - */ -public final class ListPhraseSetRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) - ListPhraseSetRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListPhraseSetRequest.newBuilder() to construct. - private ListPhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListPhraseSetRequest() { - parent_ = ""; - pageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListPhraseSetRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListPhraseSetRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - parent_ = s; - break; - } - case 16: { - - pageSize_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - pageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.Builder.class); - } - - public static final int PARENT_FIELD_NUMBER = 1; - private volatile java.lang.Object parent_; - /** - *
-   * Required. The parent, which owns this collection of phrase set. Format:
-   * `projects/{project}/locations/{location}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - @java.lang.Override - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } - } - /** - *
-   * Required. The parent, which owns this collection of phrase set. Format:
-   * `projects/{project}/locations/{location}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PAGE_SIZE_FIELD_NUMBER = 2; - private int pageSize_; - /** - *
-   * The maximum number of phrase sets to return. The service may return
-   * fewer than this value. If unspecified, at most 50 phrase sets will be
-   * returned. The maximum value is 1000; values above 1000 will be coerced to
-   * 1000.
-   * 
- * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - - public static final int PAGE_TOKEN_FIELD_NUMBER = 3; - private volatile java.lang.Object pageToken_; - /** - *
-   * A page token, received from a previous `ListPhraseSet` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListPhraseSet` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The pageToken. - */ - @java.lang.Override - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } - } - /** - *
-   * A page token, received from a previous `ListPhraseSet` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListPhraseSet` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The bytes for pageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); - } - if (pageSize_ != 0) { - output.writeInt32(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); - } - if (pageSize_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, pageSize_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest other = (com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) obj; - - if (!getParent() - .equals(other.getParent())) return false; - if (getPageSize() - != other.getPageSize()) return false; - if (!getPageToken() - .equals(other.getPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PARENT_FIELD_NUMBER; - hash = (53 * hash) + getParent().hashCode(); - hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; - hash = (53 * hash) + getPageSize(); - hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `ListPhraseSet` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.ListPhraseSetRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) - com.google.cloud.speech.v1p1beta1.ListPhraseSetRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - parent_ = ""; - - pageSize_ = 0; - - pageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest build() { - com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest result = new com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest(this); - result.parent_ = parent_; - result.pageSize_ = pageSize_; - result.pageToken_ = pageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest.getDefaultInstance()) return this; - if (!other.getParent().isEmpty()) { - parent_ = other.parent_; - onChanged(); - } - if (other.getPageSize() != 0) { - setPageSize(other.getPageSize()); - } - if (!other.getPageToken().isEmpty()) { - pageToken_ = other.pageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object parent_ = ""; - /** - *
-     * Required. The parent, which owns this collection of phrase set. Format:
-     * `projects/{project}/locations/{location}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - public java.lang.String getParent() { - java.lang.Object ref = parent_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - parent_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The parent, which owns this collection of phrase set. Format:
-     * `projects/{project}/locations/{location}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - public com.google.protobuf.ByteString - getParentBytes() { - java.lang.Object ref = parent_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - parent_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The parent, which owns this collection of phrase set. Format:
-     * `projects/{project}/locations/{location}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The parent to set. - * @return This builder for chaining. - */ - public Builder setParent( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - parent_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The parent, which owns this collection of phrase set. Format:
-     * `projects/{project}/locations/{location}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearParent() { - - parent_ = getDefaultInstance().getParent(); - onChanged(); - return this; - } - /** - *
-     * Required. The parent, which owns this collection of phrase set. Format:
-     * `projects/{project}/locations/{location}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @param value The bytes for parent to set. - * @return This builder for chaining. - */ - public Builder setParentBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - parent_ = value; - onChanged(); - return this; - } - - private int pageSize_ ; - /** - *
-     * The maximum number of phrase sets to return. The service may return
-     * fewer than this value. If unspecified, at most 50 phrase sets will be
-     * returned. The maximum value is 1000; values above 1000 will be coerced to
-     * 1000.
-     * 
- * - * int32 page_size = 2; - * @return The pageSize. - */ - @java.lang.Override - public int getPageSize() { - return pageSize_; - } - /** - *
-     * The maximum number of phrase sets to return. The service may return
-     * fewer than this value. If unspecified, at most 50 phrase sets will be
-     * returned. The maximum value is 1000; values above 1000 will be coerced to
-     * 1000.
-     * 
- * - * int32 page_size = 2; - * @param value The pageSize to set. - * @return This builder for chaining. - */ - public Builder setPageSize(int value) { - - pageSize_ = value; - onChanged(); - return this; - } - /** - *
-     * The maximum number of phrase sets to return. The service may return
-     * fewer than this value. If unspecified, at most 50 phrase sets will be
-     * returned. The maximum value is 1000; values above 1000 will be coerced to
-     * 1000.
-     * 
- * - * int32 page_size = 2; - * @return This builder for chaining. - */ - public Builder clearPageSize() { - - pageSize_ = 0; - onChanged(); - return this; - } - - private java.lang.Object pageToken_ = ""; - /** - *
-     * A page token, received from a previous `ListPhraseSet` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListPhraseSet` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @return The pageToken. - */ - public java.lang.String getPageToken() { - java.lang.Object ref = pageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - pageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * A page token, received from a previous `ListPhraseSet` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListPhraseSet` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @return The bytes for pageToken. - */ - public com.google.protobuf.ByteString - getPageTokenBytes() { - java.lang.Object ref = pageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - pageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * A page token, received from a previous `ListPhraseSet` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListPhraseSet` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @param value The pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - pageToken_ = value; - onChanged(); - return this; - } - /** - *
-     * A page token, received from a previous `ListPhraseSet` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListPhraseSet` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @return This builder for chaining. - */ - public Builder clearPageToken() { - - pageToken_ = getDefaultInstance().getPageToken(); - onChanged(); - return this; - } - /** - *
-     * A page token, received from a previous `ListPhraseSet` call.
-     * Provide this to retrieve the subsequent page.
-     * When paginating, all other parameters provided to `ListPhraseSet` must
-     * match the call that provided the page token.
-     * 
- * - * string page_token = 3; - * @param value The bytes for pageToken to set. - * @return This builder for chaining. - */ - public Builder setPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - pageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) - private static final com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListPhraseSetRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListPhraseSetRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java deleted file mode 100644 index 1f93fa365224..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetRequestOrBuilder.java +++ /dev/null @@ -1,80 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface ListPhraseSetRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.ListPhraseSetRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The parent, which owns this collection of phrase set. Format:
-   * `projects/{project}/locations/{location}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The parent. - */ - java.lang.String getParent(); - /** - *
-   * Required. The parent, which owns this collection of phrase set. Format:
-   * `projects/{project}/locations/{location}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } - * @return The bytes for parent. - */ - com.google.protobuf.ByteString - getParentBytes(); - - /** - *
-   * The maximum number of phrase sets to return. The service may return
-   * fewer than this value. If unspecified, at most 50 phrase sets will be
-   * returned. The maximum value is 1000; values above 1000 will be coerced to
-   * 1000.
-   * 
- * - * int32 page_size = 2; - * @return The pageSize. - */ - int getPageSize(); - - /** - *
-   * A page token, received from a previous `ListPhraseSet` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListPhraseSet` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The pageToken. - */ - java.lang.String getPageToken(); - /** - *
-   * A page token, received from a previous `ListPhraseSet` call.
-   * Provide this to retrieve the subsequent page.
-   * When paginating, all other parameters provided to `ListPhraseSet` must
-   * match the call that provided the page token.
-   * 
- * - * string page_token = 3; - * @return The bytes for pageToken. - */ - com.google.protobuf.ByteString - getPageTokenBytes(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java deleted file mode 100644 index 5a8f05764335..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponse.java +++ /dev/null @@ -1,1045 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Message returned to the client by the `ListPhraseSet` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.ListPhraseSetResponse} - */ -public final class ListPhraseSetResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) - ListPhraseSetResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use ListPhraseSetResponse.newBuilder() to construct. - private ListPhraseSetResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private ListPhraseSetResponse() { - phraseSets_ = java.util.Collections.emptyList(); - nextPageToken_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new ListPhraseSetResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private ListPhraseSetResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - phraseSets_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phraseSets_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.PhraseSet.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - nextPageToken_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.class, com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.Builder.class); - } - - public static final int PHRASE_SETS_FIELD_NUMBER = 1; - private java.util.List phraseSets_; - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public java.util.List getPhraseSetsList() { - return phraseSets_; - } - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public java.util.List - getPhraseSetsOrBuilderList() { - return phraseSets_; - } - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public int getPhraseSetsCount() { - return phraseSets_.size(); - } - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index) { - return phraseSets_.get(index); - } - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder( - int index) { - return phraseSets_.get(index); - } - - public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; - private volatile java.lang.Object nextPageToken_; - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The nextPageToken. - */ - @java.lang.Override - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } - } - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < phraseSets_.size(); i++) { - output.writeMessage(1, phraseSets_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < phraseSets_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, phraseSets_.get(i)); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse other = (com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse) obj; - - if (!getPhraseSetsList() - .equals(other.getPhraseSetsList())) return false; - if (!getNextPageToken() - .equals(other.getNextPageToken())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPhraseSetsCount() > 0) { - hash = (37 * hash) + PHRASE_SETS_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSetsList().hashCode(); - } - hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; - hash = (53 * hash) + getNextPageToken().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message returned to the client by the `ListPhraseSet` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.ListPhraseSetResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) - com.google.cloud.speech.v1p1beta1.ListPhraseSetResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.class, com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getPhraseSetsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (phraseSetsBuilder_ == null) { - phraseSets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - phraseSetsBuilder_.clear(); - } - nextPageToken_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse build() { - com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse buildPartial() { - com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse result = new com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse(this); - int from_bitField0_ = bitField0_; - if (phraseSetsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phraseSets_ = phraseSets_; - } else { - result.phraseSets_ = phraseSetsBuilder_.build(); - } - result.nextPageToken_ = nextPageToken_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse other) { - if (other == com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse.getDefaultInstance()) return this; - if (phraseSetsBuilder_ == null) { - if (!other.phraseSets_.isEmpty()) { - if (phraseSets_.isEmpty()) { - phraseSets_ = other.phraseSets_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhraseSetsIsMutable(); - phraseSets_.addAll(other.phraseSets_); - } - onChanged(); - } - } else { - if (!other.phraseSets_.isEmpty()) { - if (phraseSetsBuilder_.isEmpty()) { - phraseSetsBuilder_.dispose(); - phraseSetsBuilder_ = null; - phraseSets_ = other.phraseSets_; - bitField0_ = (bitField0_ & ~0x00000001); - phraseSetsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPhraseSetsFieldBuilder() : null; - } else { - phraseSetsBuilder_.addAllMessages(other.phraseSets_); - } - } - } - if (!other.getNextPageToken().isEmpty()) { - nextPageToken_ = other.nextPageToken_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List phraseSets_ = - java.util.Collections.emptyList(); - private void ensurePhraseSetsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - phraseSets_ = new java.util.ArrayList(phraseSets_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> phraseSetsBuilder_; - - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public java.util.List getPhraseSetsList() { - if (phraseSetsBuilder_ == null) { - return java.util.Collections.unmodifiableList(phraseSets_); - } else { - return phraseSetsBuilder_.getMessageList(); - } - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public int getPhraseSetsCount() { - if (phraseSetsBuilder_ == null) { - return phraseSets_.size(); - } else { - return phraseSetsBuilder_.getCount(); - } - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index) { - if (phraseSetsBuilder_ == null) { - return phraseSets_.get(index); - } else { - return phraseSetsBuilder_.getMessage(index); - } - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder setPhraseSets( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.set(index, value); - onChanged(); - } else { - phraseSetsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder setPhraseSets( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.set(index, builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets(com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.add(value); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.add(index, value); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.add(builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.add(index, builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addAllPhraseSets( - java.lang.Iterable values) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, phraseSets_); - onChanged(); - } else { - phraseSetsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder clearPhraseSets() { - if (phraseSetsBuilder_ == null) { - phraseSets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - phraseSetsBuilder_.clear(); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder removePhraseSets(int index) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.remove(index); - onChanged(); - } else { - phraseSetsBuilder_.remove(index); - } - return this; - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder getPhraseSetsBuilder( - int index) { - return getPhraseSetsFieldBuilder().getBuilder(index); - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder( - int index) { - if (phraseSetsBuilder_ == null) { - return phraseSets_.get(index); } else { - return phraseSetsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public java.util.List - getPhraseSetsOrBuilderList() { - if (phraseSetsBuilder_ != null) { - return phraseSetsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(phraseSets_); - } - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder() { - return getPhraseSetsFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()); - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder( - int index) { - return getPhraseSetsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()); - } - /** - *
-     * The phrase set.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public java.util.List - getPhraseSetsBuilderList() { - return getPhraseSetsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> - getPhraseSetsFieldBuilder() { - if (phraseSetsBuilder_ == null) { - phraseSetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder>( - phraseSets_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - phraseSets_ = null; - } - return phraseSetsBuilder_; - } - - private java.lang.Object nextPageToken_ = ""; - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @return The nextPageToken. - */ - public java.lang.String getNextPageToken() { - java.lang.Object ref = nextPageToken_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - nextPageToken_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - public com.google.protobuf.ByteString - getNextPageTokenBytes() { - java.lang.Object ref = nextPageToken_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - nextPageToken_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @param value The nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageToken( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - nextPageToken_ = value; - onChanged(); - return this; - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @return This builder for chaining. - */ - public Builder clearNextPageToken() { - - nextPageToken_ = getDefaultInstance().getNextPageToken(); - onChanged(); - return this; - } - /** - *
-     * A token, which can be sent as `page_token` to retrieve the next page.
-     * If this field is omitted, there are no subsequent pages.
-     * 
- * - * string next_page_token = 2; - * @param value The bytes for nextPageToken to set. - * @return This builder for chaining. - */ - public Builder setNextPageTokenBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - nextPageToken_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) - private static final com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse(); - } - - public static com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public ListPhraseSetResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new ListPhraseSetResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java deleted file mode 100644 index 7a24d1b77dc3..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/ListPhraseSetResponseOrBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface ListPhraseSetResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.ListPhraseSetResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - java.util.List - getPhraseSetsList(); - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index); - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - int getPhraseSetsCount(); - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - java.util.List - getPhraseSetsOrBuilderList(); - /** - *
-   * The phrase set.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder( - int index); - - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The nextPageToken. - */ - java.lang.String getNextPageToken(); - /** - *
-   * A token, which can be sent as `page_token` to retrieve the next page.
-   * If this field is omitted, there are no subsequent pages.
-   * 
- * - * string next_page_token = 2; - * @return The bytes for nextPageToken. - */ - com.google.protobuf.ByteString - getNextPageTokenBytes(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java deleted file mode 100644 index ed13f4e9c4db..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LocationName.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class LocationName implements ResourceName { - private static final PathTemplate PROJECT_LOCATION = - PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); - private volatile Map fieldValuesMap; - private final String project; - private final String location; - - @Deprecated - protected LocationName() { - project = null; - location = null; - } - - private LocationName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - } - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static LocationName of(String project, String location) { - return newBuilder().setProject(project).setLocation(location).build(); - } - - public static String format(String project, String location) { - return newBuilder().setProject(project).setLocation(location).build().toString(); - } - - public static LocationName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_LOCATION.validatedMatch( - formattedString, "LocationName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("location")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (LocationName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (location != null) { - fieldMapBuilder.put("location", location); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_LOCATION.instantiate("project", project, "location", location); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - LocationName that = ((LocationName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.location, that.location); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - return h; - } - - /** Builder for projects/{project}/locations/{location}. */ - public static class Builder { - private String project; - private String location; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - private Builder(LocationName locationName) { - this.project = locationName.project; - this.location = locationName.location; - } - - public LocationName build() { - return new LocationName(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java deleted file mode 100644 index 5dc34a20ed73..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadata.java +++ /dev/null @@ -1,1398 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Describes the progress of a long-running `LongRunningRecognize` call. It is
- * included in the `metadata` field of the `Operation` returned by the
- * `GetOperation` call of the `google::longrunning::Operations` service.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} - */ -public final class LongRunningRecognizeMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) - LongRunningRecognizeMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use LongRunningRecognizeMetadata.newBuilder() to construct. - private LongRunningRecognizeMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LongRunningRecognizeMetadata() { - uri_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new LongRunningRecognizeMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LongRunningRecognizeMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - progressPercent_ = input.readInt32(); - break; - } - case 18: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastUpdateTime_ != null) { - subBuilder = lastUpdateTime_.toBuilder(); - } - lastUpdateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastUpdateTime_); - lastUpdateTime_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - uri_ = s; - break; - } - case 42: { - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder subBuilder = null; - if (outputConfig_ != null) { - subBuilder = outputConfig_.toBuilder(); - } - outputConfig_ = input.readMessage(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(outputConfig_); - outputConfig_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.class, com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.Builder.class); - } - - public static final int PROGRESS_PERCENT_FIELD_NUMBER = 1; - private int progressPercent_; - /** - *
-   * Approximate percentage of audio processed thus far. Guaranteed to be 100
-   * when the audio is fully processed and the results are available.
-   * 
- * - * int32 progress_percent = 1; - * @return The progressPercent. - */ - @java.lang.Override - public int getProgressPercent() { - return progressPercent_; - } - - public static final int START_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Timestamp startTime_; - /** - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * @return Whether the startTime field is set. - */ - @java.lang.Override - public boolean hasStartTime() { - return startTime_ != null; - } - /** - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * @return The startTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getStartTime() { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } - /** - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - return getStartTime(); - } - - public static final int LAST_UPDATE_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Timestamp lastUpdateTime_; - /** - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * @return Whether the lastUpdateTime field is set. - */ - @java.lang.Override - public boolean hasLastUpdateTime() { - return lastUpdateTime_ != null; - } - /** - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * @return The lastUpdateTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getLastUpdateTime() { - return lastUpdateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lastUpdateTime_; - } - /** - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { - return getLastUpdateTime(); - } - - public static final int URI_FIELD_NUMBER = 4; - private volatile java.lang.Object uri_; - /** - *
-   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
-   * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The uri. - */ - @java.lang.Override - public java.lang.String getUri() { - java.lang.Object ref = uri_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uri_ = s; - return s; - } - } - /** - *
-   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
-   * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for uri. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUriBytes() { - java.lang.Object ref = uri_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uri_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OUTPUT_CONFIG_FIELD_NUMBER = 5; - private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; - /** - *
-   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the outputConfig field is set. - */ - @java.lang.Override - public boolean hasOutputConfig() { - return outputConfig_ != null; - } - /** - *
-   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The outputConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { - return outputConfig_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } - /** - *
-   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { - return getOutputConfig(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (progressPercent_ != 0) { - output.writeInt32(1, progressPercent_); - } - if (startTime_ != null) { - output.writeMessage(2, getStartTime()); - } - if (lastUpdateTime_ != null) { - output.writeMessage(3, getLastUpdateTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, uri_); - } - if (outputConfig_ != null) { - output.writeMessage(5, getOutputConfig()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (progressPercent_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, progressPercent_); - } - if (startTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getStartTime()); - } - if (lastUpdateTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getLastUpdateTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, uri_); - } - if (outputConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getOutputConfig()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata other = (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) obj; - - if (getProgressPercent() - != other.getProgressPercent()) return false; - if (hasStartTime() != other.hasStartTime()) return false; - if (hasStartTime()) { - if (!getStartTime() - .equals(other.getStartTime())) return false; - } - if (hasLastUpdateTime() != other.hasLastUpdateTime()) return false; - if (hasLastUpdateTime()) { - if (!getLastUpdateTime() - .equals(other.getLastUpdateTime())) return false; - } - if (!getUri() - .equals(other.getUri())) return false; - if (hasOutputConfig() != other.hasOutputConfig()) return false; - if (hasOutputConfig()) { - if (!getOutputConfig() - .equals(other.getOutputConfig())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PROGRESS_PERCENT_FIELD_NUMBER; - hash = (53 * hash) + getProgressPercent(); - if (hasStartTime()) { - hash = (37 * hash) + START_TIME_FIELD_NUMBER; - hash = (53 * hash) + getStartTime().hashCode(); - } - if (hasLastUpdateTime()) { - hash = (37 * hash) + LAST_UPDATE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getLastUpdateTime().hashCode(); - } - hash = (37 * hash) + URI_FIELD_NUMBER; - hash = (53 * hash) + getUri().hashCode(); - if (hasOutputConfig()) { - hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getOutputConfig().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Describes the progress of a long-running `LongRunningRecognize` call. It is
-   * included in the `metadata` field of the `Operation` returned by the
-   * `GetOperation` call of the `google::longrunning::Operations` service.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.class, com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - progressPercent_ = 0; - - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = null; - } else { - lastUpdateTime_ = null; - lastUpdateTimeBuilder_ = null; - } - uri_ = ""; - - if (outputConfigBuilder_ == null) { - outputConfig_ = null; - } else { - outputConfig_ = null; - outputConfigBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata build() { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata buildPartial() { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata result = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata(this); - result.progressPercent_ = progressPercent_; - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (lastUpdateTimeBuilder_ == null) { - result.lastUpdateTime_ = lastUpdateTime_; - } else { - result.lastUpdateTime_ = lastUpdateTimeBuilder_.build(); - } - result.uri_ = uri_; - if (outputConfigBuilder_ == null) { - result.outputConfig_ = outputConfig_; - } else { - result.outputConfig_ = outputConfigBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata other) { - if (other == com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.getDefaultInstance()) return this; - if (other.getProgressPercent() != 0) { - setProgressPercent(other.getProgressPercent()); - } - if (other.hasStartTime()) { - mergeStartTime(other.getStartTime()); - } - if (other.hasLastUpdateTime()) { - mergeLastUpdateTime(other.getLastUpdateTime()); - } - if (!other.getUri().isEmpty()) { - uri_ = other.uri_; - onChanged(); - } - if (other.hasOutputConfig()) { - mergeOutputConfig(other.getOutputConfig()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int progressPercent_ ; - /** - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - * @return The progressPercent. - */ - @java.lang.Override - public int getProgressPercent() { - return progressPercent_; - } - /** - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - * @param value The progressPercent to set. - * @return This builder for chaining. - */ - public Builder setProgressPercent(int value) { - - progressPercent_ = value; - onChanged(); - return this; - } - /** - *
-     * Approximate percentage of audio processed thus far. Guaranteed to be 100
-     * when the audio is fully processed and the results are available.
-     * 
- * - * int32 progress_percent = 1; - * @return This builder for chaining. - */ - public Builder clearProgressPercent() { - - progressPercent_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Timestamp startTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - * @return Whether the startTime field is set. - */ - public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - * @return The startTime. - */ - public com.google.protobuf.Timestamp getStartTime() { - if (startTimeBuilder_ == null) { - return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } else { - return startTimeBuilder_.getMessage(); - } - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder setStartTime(com.google.protobuf.Timestamp value) { - if (startTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - startTime_ = value; - onChanged(); - } else { - startTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder setStartTime( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (startTimeBuilder_ == null) { - startTime_ = builderForValue.build(); - onChanged(); - } else { - startTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder mergeStartTime(com.google.protobuf.Timestamp value) { - if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); - } else { - startTime_ = value; - } - onChanged(); - } else { - startTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { - - onChanged(); - return getStartTimeFieldBuilder().getBuilder(); - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { - if (startTimeBuilder_ != null) { - return startTimeBuilder_.getMessageOrBuilder(); - } else { - return startTime_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; - } - } - /** - *
-     * Time when the request was received.
-     * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getStartTimeFieldBuilder() { - if (startTimeBuilder_ == null) { - startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - getStartTime(), - getParentForChildren(), - isClean()); - startTime_ = null; - } - return startTimeBuilder_; - } - - private com.google.protobuf.Timestamp lastUpdateTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> lastUpdateTimeBuilder_; - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * @return Whether the lastUpdateTime field is set. - */ - public boolean hasLastUpdateTime() { - return lastUpdateTimeBuilder_ != null || lastUpdateTime_ != null; - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * @return The lastUpdateTime. - */ - public com.google.protobuf.Timestamp getLastUpdateTime() { - if (lastUpdateTimeBuilder_ == null) { - return lastUpdateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lastUpdateTime_; - } else { - return lastUpdateTimeBuilder_.getMessage(); - } - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder setLastUpdateTime(com.google.protobuf.Timestamp value) { - if (lastUpdateTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - lastUpdateTime_ = value; - onChanged(); - } else { - lastUpdateTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder setLastUpdateTime( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = builderForValue.build(); - onChanged(); - } else { - lastUpdateTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder mergeLastUpdateTime(com.google.protobuf.Timestamp value) { - if (lastUpdateTimeBuilder_ == null) { - if (lastUpdateTime_ != null) { - lastUpdateTime_ = - com.google.protobuf.Timestamp.newBuilder(lastUpdateTime_).mergeFrom(value).buildPartial(); - } else { - lastUpdateTime_ = value; - } - onChanged(); - } else { - lastUpdateTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public Builder clearLastUpdateTime() { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTime_ = null; - onChanged(); - } else { - lastUpdateTime_ = null; - lastUpdateTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.Timestamp.Builder getLastUpdateTimeBuilder() { - - onChanged(); - return getLastUpdateTimeFieldBuilder().getBuilder(); - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - public com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder() { - if (lastUpdateTimeBuilder_ != null) { - return lastUpdateTimeBuilder_.getMessageOrBuilder(); - } else { - return lastUpdateTime_ == null ? - com.google.protobuf.Timestamp.getDefaultInstance() : lastUpdateTime_; - } - } - /** - *
-     * Time of the most recent processing update.
-     * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> - getLastUpdateTimeFieldBuilder() { - if (lastUpdateTimeBuilder_ == null) { - lastUpdateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( - getLastUpdateTime(), - getParentForChildren(), - isClean()); - lastUpdateTime_ = null; - } - return lastUpdateTimeBuilder_; - } - - private java.lang.Object uri_ = ""; - /** - *
-     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The uri. - */ - public java.lang.String getUri() { - java.lang.Object ref = uri_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - uri_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for uri. - */ - public com.google.protobuf.ByteString - getUriBytes() { - java.lang.Object ref = uri_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - uri_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The uri to set. - * @return This builder for chaining. - */ - public Builder setUri( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - uri_ = value; - onChanged(); - return this; - } - /** - *
-     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return This builder for chaining. - */ - public Builder clearUri() { - - uri_ = getDefaultInstance().getUri(); - onChanged(); - return this; - } - /** - *
-     * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-     * as byte content.
-     * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The bytes for uri to set. - * @return This builder for chaining. - */ - public Builder setUriBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - uri_ = value; - onChanged(); - return this; - } - - private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> outputConfigBuilder_; - /** - *
-     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the outputConfig field is set. - */ - public boolean hasOutputConfig() { - return outputConfigBuilder_ != null || outputConfig_ != null; - } - /** - *
-     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The outputConfig. - */ - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { - if (outputConfigBuilder_ == null) { - return outputConfig_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } else { - return outputConfigBuilder_.getMessage(); - } - } - /** - *
-     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder setOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { - if (outputConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - outputConfig_ = value; - onChanged(); - } else { - outputConfigBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder setOutputConfig( - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder builderForValue) { - if (outputConfigBuilder_ == null) { - outputConfig_ = builderForValue.build(); - onChanged(); - } else { - outputConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder mergeOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { - if (outputConfigBuilder_ == null) { - if (outputConfig_ != null) { - outputConfig_ = - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); - } else { - outputConfig_ = value; - } - onChanged(); - } else { - outputConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public Builder clearOutputConfig() { - if (outputConfigBuilder_ == null) { - outputConfig_ = null; - onChanged(); - } else { - outputConfig_ = null; - outputConfigBuilder_ = null; - } - - return this; - } - /** - *
-     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder getOutputConfigBuilder() { - - onChanged(); - return getOutputConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { - if (outputConfigBuilder_ != null) { - return outputConfigBuilder_.getMessageOrBuilder(); - } else { - return outputConfig_ == null ? - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } - } - /** - *
-     * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> - getOutputConfigFieldBuilder() { - if (outputConfigBuilder_ == null) { - outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder>( - getOutputConfig(), - getParentForChildren(), - isClean()); - outputConfig_ = null; - } - return outputConfigBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) - private static final com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata(); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LongRunningRecognizeMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LongRunningRecognizeMetadata(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java deleted file mode 100644 index 2e4b54cbc0f0..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeMetadataOrBuilder.java +++ /dev/null @@ -1,123 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface LongRunningRecognizeMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Approximate percentage of audio processed thus far. Guaranteed to be 100
-   * when the audio is fully processed and the results are available.
-   * 
- * - * int32 progress_percent = 1; - * @return The progressPercent. - */ - int getProgressPercent(); - - /** - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * @return Whether the startTime field is set. - */ - boolean hasStartTime(); - /** - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - * @return The startTime. - */ - com.google.protobuf.Timestamp getStartTime(); - /** - *
-   * Time when the request was received.
-   * 
- * - * .google.protobuf.Timestamp start_time = 2; - */ - com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); - - /** - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * @return Whether the lastUpdateTime field is set. - */ - boolean hasLastUpdateTime(); - /** - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - * @return The lastUpdateTime. - */ - com.google.protobuf.Timestamp getLastUpdateTime(); - /** - *
-   * Time of the most recent processing update.
-   * 
- * - * .google.protobuf.Timestamp last_update_time = 3; - */ - com.google.protobuf.TimestampOrBuilder getLastUpdateTimeOrBuilder(); - - /** - *
-   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
-   * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The uri. - */ - java.lang.String getUri(); - /** - *
-   * Output only. The URI of the audio file being transcribed. Empty if the audio was sent
-   * as byte content.
-   * 
- * - * string uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for uri. - */ - com.google.protobuf.ByteString - getUriBytes(); - - /** - *
-   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return Whether the outputConfig field is set. - */ - boolean hasOutputConfig(); - /** - *
-   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The outputConfig. - */ - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig(); - /** - *
-   * Output only. A copy of the TranscriptOutputConfig if it was set in the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java deleted file mode 100644 index 74993a44d467..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequest.java +++ /dev/null @@ -1,1151 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * The top-level message sent by the client for the `LongRunningRecognize`
- * method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} - */ -public final class LongRunningRecognizeRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) - LongRunningRecognizeRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use LongRunningRecognizeRequest.newBuilder() to construct. - private LongRunningRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LongRunningRecognizeRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new LongRunningRecognizeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LongRunningRecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = input.readMessage(com.google.cloud.speech.v1p1beta1.RecognitionConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder subBuilder = null; - if (audio_ != null) { - subBuilder = audio_.toBuilder(); - } - audio_ = input.readMessage(com.google.cloud.speech.v1p1beta1.RecognitionAudio.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(audio_); - audio_ = subBuilder.buildPartial(); - } - - break; - } - case 34: { - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder subBuilder = null; - if (outputConfig_ != null) { - subBuilder = outputConfig_.toBuilder(); - } - outputConfig_ = input.readMessage(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(outputConfig_); - outputConfig_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.class, com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { - return config_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; - } - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int AUDIO_FIELD_NUMBER = 2; - private com.google.cloud.speech.v1p1beta1.RecognitionAudio audio_; - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the audio field is set. - */ - @java.lang.Override - public boolean hasAudio() { - return audio_ != null; - } - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The audio. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio() { - return audio_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() : audio_; - } - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { - return getAudio(); - } - - public static final int OUTPUT_CONFIG_FIELD_NUMBER = 4; - private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; - /** - *
-   * Optional. Specifies an optional destination for the recognition results.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return Whether the outputConfig field is set. - */ - @java.lang.Override - public boolean hasOutputConfig() { - return outputConfig_ != null; - } - /** - *
-   * Optional. Specifies an optional destination for the recognition results.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return The outputConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { - return outputConfig_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } - /** - *
-   * Optional. Specifies an optional destination for the recognition results.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { - return getOutputConfig(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (audio_ != null) { - output.writeMessage(2, getAudio()); - } - if (outputConfig_ != null) { - output.writeMessage(4, getOutputConfig()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getConfig()); - } - if (audio_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getAudio()); - } - if (outputConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getOutputConfig()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest other = (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) obj; - - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig() - .equals(other.getConfig())) return false; - } - if (hasAudio() != other.hasAudio()) return false; - if (hasAudio()) { - if (!getAudio() - .equals(other.getAudio())) return false; - } - if (hasOutputConfig() != other.hasOutputConfig()) return false; - if (hasOutputConfig()) { - if (!getOutputConfig() - .equals(other.getOutputConfig())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - if (hasAudio()) { - hash = (37 * hash) + AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getAudio().hashCode(); - } - if (hasOutputConfig()) { - hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getOutputConfig().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * The top-level message sent by the client for the `LongRunningRecognize`
-   * method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.class, com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - if (audioBuilder_ == null) { - audio_ = null; - } else { - audio_ = null; - audioBuilder_ = null; - } - if (outputConfigBuilder_ == null) { - outputConfig_ = null; - } else { - outputConfig_ = null; - outputConfigBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest build() { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest result = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - if (audioBuilder_ == null) { - result.audio_ = audio_; - } else { - result.audio_ = audioBuilder_.build(); - } - if (outputConfigBuilder_ == null) { - result.outputConfig_ = outputConfig_; - } else { - result.outputConfig_ = outputConfigBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.getDefaultInstance()) return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.hasAudio()) { - mergeAudio(other.getAudio()); - } - if (other.hasOutputConfig()) { - mergeOutputConfig(other.getOutputConfig()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> configBuilder_; - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setConfig( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1p1beta1.RecognitionConfig.newBuilder(config_).mergeFrom(value).buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null ? - com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; - } - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder>( - getConfig(), - getParentForChildren(), - isClean()); - config_ = null; - } - return configBuilder_; - } - - private com.google.cloud.speech.v1p1beta1.RecognitionAudio audio_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionAudio, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder> audioBuilder_; - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the audio field is set. - */ - public boolean hasAudio() { - return audioBuilder_ != null || audio_ != null; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The audio. - */ - public com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio() { - if (audioBuilder_ == null) { - return audio_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() : audio_; - } else { - return audioBuilder_.getMessage(); - } - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setAudio(com.google.cloud.speech.v1p1beta1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - audio_ = value; - onChanged(); - } else { - audioBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setAudio( - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder builderForValue) { - if (audioBuilder_ == null) { - audio_ = builderForValue.build(); - onChanged(); - } else { - audioBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeAudio(com.google.cloud.speech.v1p1beta1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (audio_ != null) { - audio_ = - com.google.cloud.speech.v1p1beta1.RecognitionAudio.newBuilder(audio_).mergeFrom(value).buildPartial(); - } else { - audio_ = value; - } - onChanged(); - } else { - audioBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearAudio() { - if (audioBuilder_ == null) { - audio_ = null; - onChanged(); - } else { - audio_ = null; - audioBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder getAudioBuilder() { - - onChanged(); - return getAudioFieldBuilder().getBuilder(); - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { - if (audioBuilder_ != null) { - return audioBuilder_.getMessageOrBuilder(); - } else { - return audio_ == null ? - com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() : audio_; - } - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionAudio, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder> - getAudioFieldBuilder() { - if (audioBuilder_ == null) { - audioBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionAudio, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder>( - getAudio(), - getParentForChildren(), - isClean()); - audio_ = null; - } - return audioBuilder_; - } - - private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> outputConfigBuilder_; - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return Whether the outputConfig field is set. - */ - public boolean hasOutputConfig() { - return outputConfigBuilder_ != null || outputConfig_ != null; - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return The outputConfig. - */ - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { - if (outputConfigBuilder_ == null) { - return outputConfig_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } else { - return outputConfigBuilder_.getMessage(); - } - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - public Builder setOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { - if (outputConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - outputConfig_ = value; - onChanged(); - } else { - outputConfigBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - public Builder setOutputConfig( - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder builderForValue) { - if (outputConfigBuilder_ == null) { - outputConfig_ = builderForValue.build(); - onChanged(); - } else { - outputConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - public Builder mergeOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { - if (outputConfigBuilder_ == null) { - if (outputConfig_ != null) { - outputConfig_ = - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); - } else { - outputConfig_ = value; - } - onChanged(); - } else { - outputConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - public Builder clearOutputConfig() { - if (outputConfigBuilder_ == null) { - outputConfig_ = null; - onChanged(); - } else { - outputConfig_ = null; - outputConfigBuilder_ = null; - } - - return this; - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder getOutputConfigBuilder() { - - onChanged(); - return getOutputConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { - if (outputConfigBuilder_ != null) { - return outputConfigBuilder_.getMessageOrBuilder(); - } else { - return outputConfig_ == null ? - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } - } - /** - *
-     * Optional. Specifies an optional destination for the recognition results.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> - getOutputConfigFieldBuilder() { - if (outputConfigBuilder_ == null) { - outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder>( - getOutputConfig(), - getParentForChildren(), - isClean()); - outputConfig_ = null; - } - return outputConfigBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) - private static final com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LongRunningRecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LongRunningRecognizeRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequestOrBuilder.java deleted file mode 100644 index 5a5a7bb3a28f..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeRequestOrBuilder.java +++ /dev/null @@ -1,93 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface LongRunningRecognizeRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig(); - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the audio field is set. - */ - boolean hasAudio(); - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The audio. - */ - com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio(); - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder(); - - /** - *
-   * Optional. Specifies an optional destination for the recognition results.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return Whether the outputConfig field is set. - */ - boolean hasOutputConfig(); - /** - *
-   * Optional. Specifies an optional destination for the recognition results.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - * @return The outputConfig. - */ - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig(); - /** - *
-   * Optional. Specifies an optional destination for the recognition results.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL]; - */ - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java deleted file mode 100644 index ef5d878c5e04..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponse.java +++ /dev/null @@ -1,1611 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * The only message returned to the client by the `LongRunningRecognize` method.
- * It contains the result as zero or more sequential `SpeechRecognitionResult`
- * messages. It is included in the `result.response` field of the `Operation`
- * returned by the `GetOperation` call of the `google::longrunning::Operations`
- * service.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} - */ -public final class LongRunningRecognizeResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) - LongRunningRecognizeResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use LongRunningRecognizeResponse.newBuilder() to construct. - private LongRunningRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private LongRunningRecognizeResponse() { - results_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new LongRunningRecognizeResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private LongRunningRecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.parser(), extensionRegistry)); - break; - } - case 26: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (totalBilledTime_ != null) { - subBuilder = totalBilledTime_.toBuilder(); - } - totalBilledTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(totalBilledTime_); - totalBilledTime_ = subBuilder.buildPartial(); - } - - break; - } - case 50: { - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder subBuilder = null; - if (outputConfig_ != null) { - subBuilder = outputConfig_.toBuilder(); - } - outputConfig_ = input.readMessage(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(outputConfig_); - outputConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 58: { - com.google.rpc.Status.Builder subBuilder = null; - if (outputError_ != null) { - subBuilder = outputError_.toBuilder(); - } - outputError_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(outputError_); - outputError_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.class, com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.Builder.class); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List getResultsList() { - return results_; - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List - getResultsOrBuilderList() { - return results_; - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public int getResultsCount() { - return results_.size(); - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - public static final int TOTAL_BILLED_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Duration totalBilledTime_; - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return Whether the totalBilledTime field is set. - */ - @java.lang.Override - public boolean hasTotalBilledTime() { - return totalBilledTime_ != null; - } - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return The totalBilledTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getTotalBilledTime() { - return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { - return getTotalBilledTime(); - } - - public static final int OUTPUT_CONFIG_FIELD_NUMBER = 6; - private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; - /** - *
-   * Original output config if present in the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - * @return Whether the outputConfig field is set. - */ - @java.lang.Override - public boolean hasOutputConfig() { - return outputConfig_ != null; - } - /** - *
-   * Original output config if present in the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - * @return The outputConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { - return outputConfig_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } - /** - *
-   * Original output config if present in the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { - return getOutputConfig(); - } - - public static final int OUTPUT_ERROR_FIELD_NUMBER = 7; - private com.google.rpc.Status outputError_; - /** - *
-   * If the transcript output fails this field contains the relevant error.
-   * 
- * - * .google.rpc.Status output_error = 7; - * @return Whether the outputError field is set. - */ - @java.lang.Override - public boolean hasOutputError() { - return outputError_ != null; - } - /** - *
-   * If the transcript output fails this field contains the relevant error.
-   * 
- * - * .google.rpc.Status output_error = 7; - * @return The outputError. - */ - @java.lang.Override - public com.google.rpc.Status getOutputError() { - return outputError_ == null ? com.google.rpc.Status.getDefaultInstance() : outputError_; - } - /** - *
-   * If the transcript output fails this field contains the relevant error.
-   * 
- * - * .google.rpc.Status output_error = 7; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { - return getOutputError(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - if (totalBilledTime_ != null) { - output.writeMessage(3, getTotalBilledTime()); - } - if (outputConfig_ != null) { - output.writeMessage(6, getOutputConfig()); - } - if (outputError_ != null) { - output.writeMessage(7, getOutputError()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, results_.get(i)); - } - if (totalBilledTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getTotalBilledTime()); - } - if (outputConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getOutputConfig()); - } - if (outputError_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getOutputError()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse other = (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) obj; - - if (!getResultsList() - .equals(other.getResultsList())) return false; - if (hasTotalBilledTime() != other.hasTotalBilledTime()) return false; - if (hasTotalBilledTime()) { - if (!getTotalBilledTime() - .equals(other.getTotalBilledTime())) return false; - } - if (hasOutputConfig() != other.hasOutputConfig()) return false; - if (hasOutputConfig()) { - if (!getOutputConfig() - .equals(other.getOutputConfig())) return false; - } - if (hasOutputError() != other.hasOutputError()) return false; - if (hasOutputError()) { - if (!getOutputError() - .equals(other.getOutputError())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - if (hasTotalBilledTime()) { - hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; - hash = (53 * hash) + getTotalBilledTime().hashCode(); - } - if (hasOutputConfig()) { - hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getOutputConfig().hashCode(); - } - if (hasOutputError()) { - hash = (37 * hash) + OUTPUT_ERROR_FIELD_NUMBER; - hash = (53 * hash) + getOutputError().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * The only message returned to the client by the `LongRunningRecognize` method.
-   * It contains the result as zero or more sequential `SpeechRecognitionResult`
-   * messages. It is included in the `result.response` field of the `Operation`
-   * returned by the `GetOperation` call of the `google::longrunning::Operations`
-   * service.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.class, com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = null; - } else { - totalBilledTime_ = null; - totalBilledTimeBuilder_ = null; - } - if (outputConfigBuilder_ == null) { - outputConfig_ = null; - } else { - outputConfig_ = null; - outputConfigBuilder_ = null; - } - if (outputErrorBuilder_ == null) { - outputError_ = null; - } else { - outputError_ = null; - outputErrorBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse build() { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse buildPartial() { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse result = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - if (totalBilledTimeBuilder_ == null) { - result.totalBilledTime_ = totalBilledTime_; - } else { - result.totalBilledTime_ = totalBilledTimeBuilder_.build(); - } - if (outputConfigBuilder_ == null) { - result.outputConfig_ = outputConfig_; - } else { - result.outputConfig_ = outputConfigBuilder_.build(); - } - if (outputErrorBuilder_ == null) { - result.outputError_ = outputError_; - } else { - result.outputError_ = outputErrorBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse other) { - if (other == com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.getDefaultInstance()) return this; - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResultsFieldBuilder() : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - if (other.hasTotalBilledTime()) { - mergeTotalBilledTime(other.getTotalBilledTime()); - } - if (other.hasOutputConfig()) { - mergeOutputConfig(other.getOutputConfig()); - } - if (other.hasOutputError()) { - mergeOutputError(other.getOutputError()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List results_ = - java.util.Collections.emptyList(); - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = new java.util.ArrayList(results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> resultsBuilder_; - - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder>( - results_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - results_ = null; - } - return resultsBuilder_; - } - - private com.google.protobuf.Duration totalBilledTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalBilledTimeBuilder_; - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return Whether the totalBilledTime field is set. - */ - public boolean hasTotalBilledTime() { - return totalBilledTimeBuilder_ != null || totalBilledTime_ != null; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return The totalBilledTime. - */ - public com.google.protobuf.Duration getTotalBilledTime() { - if (totalBilledTimeBuilder_ == null) { - return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } else { - return totalBilledTimeBuilder_.getMessage(); - } - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder setTotalBilledTime(com.google.protobuf.Duration value) { - if (totalBilledTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - totalBilledTime_ = value; - onChanged(); - } else { - totalBilledTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder setTotalBilledTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = builderForValue.build(); - onChanged(); - } else { - totalBilledTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder mergeTotalBilledTime(com.google.protobuf.Duration value) { - if (totalBilledTimeBuilder_ == null) { - if (totalBilledTime_ != null) { - totalBilledTime_ = - com.google.protobuf.Duration.newBuilder(totalBilledTime_).mergeFrom(value).buildPartial(); - } else { - totalBilledTime_ = value; - } - onChanged(); - } else { - totalBilledTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder clearTotalBilledTime() { - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = null; - onChanged(); - } else { - totalBilledTime_ = null; - totalBilledTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public com.google.protobuf.Duration.Builder getTotalBilledTimeBuilder() { - - onChanged(); - return getTotalBilledTimeFieldBuilder().getBuilder(); - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { - if (totalBilledTimeBuilder_ != null) { - return totalBilledTimeBuilder_.getMessageOrBuilder(); - } else { - return totalBilledTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getTotalBilledTimeFieldBuilder() { - if (totalBilledTimeBuilder_ == null) { - totalBilledTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getTotalBilledTime(), - getParentForChildren(), - isClean()); - totalBilledTime_ = null; - } - return totalBilledTimeBuilder_; - } - - private com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig outputConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> outputConfigBuilder_; - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - * @return Whether the outputConfig field is set. - */ - public boolean hasOutputConfig() { - return outputConfigBuilder_ != null || outputConfig_ != null; - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - * @return The outputConfig. - */ - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig() { - if (outputConfigBuilder_ == null) { - return outputConfig_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } else { - return outputConfigBuilder_.getMessage(); - } - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - */ - public Builder setOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { - if (outputConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - outputConfig_ = value; - onChanged(); - } else { - outputConfigBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - */ - public Builder setOutputConfig( - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder builderForValue) { - if (outputConfigBuilder_ == null) { - outputConfig_ = builderForValue.build(); - onChanged(); - } else { - outputConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - */ - public Builder mergeOutputConfig(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig value) { - if (outputConfigBuilder_ == null) { - if (outputConfig_ != null) { - outputConfig_ = - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial(); - } else { - outputConfig_ = value; - } - onChanged(); - } else { - outputConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - */ - public Builder clearOutputConfig() { - if (outputConfigBuilder_ == null) { - outputConfig_ = null; - onChanged(); - } else { - outputConfig_ = null; - outputConfigBuilder_ = null; - } - - return this; - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder getOutputConfigBuilder() { - - onChanged(); - return getOutputConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() { - if (outputConfigBuilder_ != null) { - return outputConfigBuilder_.getMessageOrBuilder(); - } else { - return outputConfig_ == null ? - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance() : outputConfig_; - } - } - /** - *
-     * Original output config if present in the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder> - getOutputConfigFieldBuilder() { - if (outputConfigBuilder_ == null) { - outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder>( - getOutputConfig(), - getParentForChildren(), - isClean()); - outputConfig_ = null; - } - return outputConfigBuilder_; - } - - private com.google.rpc.Status outputError_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> outputErrorBuilder_; - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - * @return Whether the outputError field is set. - */ - public boolean hasOutputError() { - return outputErrorBuilder_ != null || outputError_ != null; - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - * @return The outputError. - */ - public com.google.rpc.Status getOutputError() { - if (outputErrorBuilder_ == null) { - return outputError_ == null ? com.google.rpc.Status.getDefaultInstance() : outputError_; - } else { - return outputErrorBuilder_.getMessage(); - } - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - public Builder setOutputError(com.google.rpc.Status value) { - if (outputErrorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - outputError_ = value; - onChanged(); - } else { - outputErrorBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - public Builder setOutputError( - com.google.rpc.Status.Builder builderForValue) { - if (outputErrorBuilder_ == null) { - outputError_ = builderForValue.build(); - onChanged(); - } else { - outputErrorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - public Builder mergeOutputError(com.google.rpc.Status value) { - if (outputErrorBuilder_ == null) { - if (outputError_ != null) { - outputError_ = - com.google.rpc.Status.newBuilder(outputError_).mergeFrom(value).buildPartial(); - } else { - outputError_ = value; - } - onChanged(); - } else { - outputErrorBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - public Builder clearOutputError() { - if (outputErrorBuilder_ == null) { - outputError_ = null; - onChanged(); - } else { - outputError_ = null; - outputErrorBuilder_ = null; - } - - return this; - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - public com.google.rpc.Status.Builder getOutputErrorBuilder() { - - onChanged(); - return getOutputErrorFieldBuilder().getBuilder(); - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - public com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder() { - if (outputErrorBuilder_ != null) { - return outputErrorBuilder_.getMessageOrBuilder(); - } else { - return outputError_ == null ? - com.google.rpc.Status.getDefaultInstance() : outputError_; - } - } - /** - *
-     * If the transcript output fails this field contains the relevant error.
-     * 
- * - * .google.rpc.Status output_error = 7; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getOutputErrorFieldBuilder() { - if (outputErrorBuilder_ == null) { - outputErrorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( - getOutputError(), - getParentForChildren(), - isClean()); - outputError_ = null; - } - return outputErrorBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) - private static final com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse(); - } - - public static com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public LongRunningRecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new LongRunningRecognizeResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java deleted file mode 100644 index f6b5867cee72..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/LongRunningRecognizeResponseOrBuilder.java +++ /dev/null @@ -1,139 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface LongRunningRecognizeResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsList(); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - int getResultsCount(); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index); - - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return Whether the totalBilledTime field is set. - */ - boolean hasTotalBilledTime(); - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return The totalBilledTime. - */ - com.google.protobuf.Duration getTotalBilledTime(); - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); - - /** - *
-   * Original output config if present in the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - * @return Whether the outputConfig field is set. - */ - boolean hasOutputConfig(); - /** - *
-   * Original output config if present in the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - * @return The outputConfig. - */ - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getOutputConfig(); - /** - *
-   * Original output config if present in the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptOutputConfig output_config = 6; - */ - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder(); - - /** - *
-   * If the transcript output fails this field contains the relevant error.
-   * 
- * - * .google.rpc.Status output_error = 7; - * @return Whether the outputError field is set. - */ - boolean hasOutputError(); - /** - *
-   * If the transcript output fails this field contains the relevant error.
-   * 
- * - * .google.rpc.Status output_error = 7; - * @return The outputError. - */ - com.google.rpc.Status getOutputError(); - /** - *
-   * If the transcript output fails this field contains the relevant error.
-   * 
- * - * .google.rpc.Status output_error = 7; - */ - com.google.rpc.StatusOrBuilder getOutputErrorOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSet.java deleted file mode 100644 index 4e71340fc388..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSet.java +++ /dev/null @@ -1,1944 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Provides "hints" to the speech recognizer to favor specific words and phrases
- * in the results.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet} - */ -public final class PhraseSet extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.PhraseSet) - PhraseSetOrBuilder { -private static final long serialVersionUID = 0L; - // Use PhraseSet.newBuilder() to construct. - private PhraseSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PhraseSet() { - name_ = ""; - phrases_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PhraseSet(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PhraseSet( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phrases_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.parser(), extensionRegistry)); - break; - } - case 37: { - - boost_ = input.readFloat(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = java.util.Collections.unmodifiableList(phrases_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.PhraseSet.class, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder.class); - } - - public interface PhraseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * The phrase itself.
-     * 
- * - * string value = 1; - * @return The value. - */ - java.lang.String getValue(); - /** - *
-     * The phrase itself.
-     * 
- * - * string value = 1; - * @return The bytes for value. - */ - com.google.protobuf.ByteString - getValueBytes(); - - /** - *
-     * Hint Boost. Overrides the boost set at the phrase set level.
-     * Positive value will increase the probability that a specific phrase will
-     * be recognized over other similar sounding phrases. The higher the boost,
-     * the higher the chance of false positive recognition as well. Negative
-     * boost will simply be ignored. Though `boost` can accept a wide range of
-     * positive values, most use cases are best served
-     * with values between 0 and 20. We recommend using a binary search approach
-     * to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 2; - * @return The boost. - */ - float getBoost(); - } - /** - *
-   * A phrases containing words and phrase "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also include pre-built or custom classes containing groups
-   * of words that represent common concepts that occur in natural language. For
-   * example, rather than providing a phrase hint for every month of the
-   * year (e.g. "i was born in january", "i was born in febuary", ...), use the
-   * pre-built `$MONTH` class improves the likelihood of correctly transcribing
-   * audio that includes months (e.g. "i was born in $month").
-   * To refer to pre-built classes, use the class' symbol prepended with `$`
-   * e.g. `$MONTH`. To refer to custom classes that were defined inline in the
-   * request, set the class's `custom_class_id` to a string unique to all class
-   * resources and inline classes. Then use the class' id wrapped in $`{...}`
-   * e.g. "${my-months}". To refer to custom classes resources, use the class'
-   * id wrapped in `${}` (e.g. `${my-months}`).
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
-   * `eu` location value.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet.Phrase} - */ - public static final class Phrase extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) - PhraseOrBuilder { - private static final long serialVersionUID = 0L; - // Use Phrase.newBuilder() to construct. - private Phrase(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Phrase() { - value_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Phrase(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Phrase( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - value_ = s; - break; - } - case 21: { - - boost_ = input.readFloat(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.class, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder.class); - } - - public static final int VALUE_FIELD_NUMBER = 1; - private volatile java.lang.Object value_; - /** - *
-     * The phrase itself.
-     * 
- * - * string value = 1; - * @return The value. - */ - @java.lang.Override - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } - } - /** - *
-     * The phrase itself.
-     * 
- * - * string value = 1; - * @return The bytes for value. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int BOOST_FIELD_NUMBER = 2; - private float boost_; - /** - *
-     * Hint Boost. Overrides the boost set at the phrase set level.
-     * Positive value will increase the probability that a specific phrase will
-     * be recognized over other similar sounding phrases. The higher the boost,
-     * the higher the chance of false positive recognition as well. Negative
-     * boost will simply be ignored. Though `boost` can accept a wide range of
-     * positive values, most use cases are best served
-     * with values between 0 and 20. We recommend using a binary search approach
-     * to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 2; - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); - } - if (java.lang.Float.floatToRawIntBits(boost_) != 0) { - output.writeFloat(2, boost_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); - } - if (java.lang.Float.floatToRawIntBits(boost_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(2, boost_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase other = (com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) obj; - - if (!getValue() - .equals(other.getValue())) return false; - if (java.lang.Float.floatToIntBits(getBoost()) - != java.lang.Float.floatToIntBits( - other.getBoost())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValue().hashCode(); - hash = (37 * hash) + BOOST_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getBoost()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * A phrases containing words and phrase "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also include pre-built or custom classes containing groups
-     * of words that represent common concepts that occur in natural language. For
-     * example, rather than providing a phrase hint for every month of the
-     * year (e.g. "i was born in january", "i was born in febuary", ...), use the
-     * pre-built `$MONTH` class improves the likelihood of correctly transcribing
-     * audio that includes months (e.g. "i was born in $month").
-     * To refer to pre-built classes, use the class' symbol prepended with `$`
-     * e.g. `$MONTH`. To refer to custom classes that were defined inline in the
-     * request, set the class's `custom_class_id` to a string unique to all class
-     * resources and inline classes. Then use the class' id wrapped in $`{...}`
-     * e.g. "${my-months}". To refer to custom classes resources, use the class'
-     * id wrapped in `${}` (e.g. `${my-months}`).
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or
-     * `eu` location value.
-     * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet.Phrase} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) - com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.class, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - value_ = ""; - - boost_ = 0F; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase build() { - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase buildPartial() { - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase result = new com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase(this); - result.value_ = value_; - result.boost_ = boost_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase other) { - if (other == com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance()) return this; - if (!other.getValue().isEmpty()) { - value_ = other.value_; - onChanged(); - } - if (other.getBoost() != 0F) { - setBoost(other.getBoost()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object value_ = ""; - /** - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * @return The value. - */ - public java.lang.String getValue() { - java.lang.Object ref = value_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - value_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * @return The bytes for value. - */ - public com.google.protobuf.ByteString - getValueBytes() { - java.lang.Object ref = value_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - value_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - value_ = value; - onChanged(); - return this; - } - /** - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = getDefaultInstance().getValue(); - onChanged(); - return this; - } - /** - *
-       * The phrase itself.
-       * 
- * - * string value = 1; - * @param value The bytes for value to set. - * @return This builder for chaining. - */ - public Builder setValueBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - value_ = value; - onChanged(); - return this; - } - - private float boost_ ; - /** - *
-       * Hint Boost. Overrides the boost set at the phrase set level.
-       * Positive value will increase the probability that a specific phrase will
-       * be recognized over other similar sounding phrases. The higher the boost,
-       * the higher the chance of false positive recognition as well. Negative
-       * boost will simply be ignored. Though `boost` can accept a wide range of
-       * positive values, most use cases are best served
-       * with values between 0 and 20. We recommend using a binary search approach
-       * to finding the optimal value for your use case. Speech recognition
-       * will skip PhraseSets with a boost value of 0.
-       * 
- * - * float boost = 2; - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - /** - *
-       * Hint Boost. Overrides the boost set at the phrase set level.
-       * Positive value will increase the probability that a specific phrase will
-       * be recognized over other similar sounding phrases. The higher the boost,
-       * the higher the chance of false positive recognition as well. Negative
-       * boost will simply be ignored. Though `boost` can accept a wide range of
-       * positive values, most use cases are best served
-       * with values between 0 and 20. We recommend using a binary search approach
-       * to finding the optimal value for your use case. Speech recognition
-       * will skip PhraseSets with a boost value of 0.
-       * 
- * - * float boost = 2; - * @param value The boost to set. - * @return This builder for chaining. - */ - public Builder setBoost(float value) { - - boost_ = value; - onChanged(); - return this; - } - /** - *
-       * Hint Boost. Overrides the boost set at the phrase set level.
-       * Positive value will increase the probability that a specific phrase will
-       * be recognized over other similar sounding phrases. The higher the boost,
-       * the higher the chance of false positive recognition as well. Negative
-       * boost will simply be ignored. Though `boost` can accept a wide range of
-       * positive values, most use cases are best served
-       * with values between 0 and 20. We recommend using a binary search approach
-       * to finding the optimal value for your use case. Speech recognition
-       * will skip PhraseSets with a boost value of 0.
-       * 
- * - * float boost = 2; - * @return This builder for chaining. - */ - public Builder clearBoost() { - - boost_ = 0F; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.PhraseSet.Phrase) - private static final com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase(); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Phrase parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Phrase(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int NAME_FIELD_NUMBER = 1; - private volatile java.lang.Object name_; - /** - *
-   * The resource name of the phrase set.
-   * 
- * - * string name = 1; - * @return The name. - */ - @java.lang.Override - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - *
-   * The resource name of the phrase set.
-   * 
- * - * string name = 1; - * @return The bytes for name. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int PHRASES_FIELD_NUMBER = 2; - private java.util.List phrases_; - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public java.util.List getPhrasesList() { - return phrases_; - } - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public java.util.List - getPhrasesOrBuilderList() { - return phrases_; - } - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public int getPhrasesCount() { - return phrases_.size(); - } - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getPhrases(int index) { - return phrases_.get(index); - } - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( - int index) { - return phrases_.get(index); - } - - public static final int BOOST_FIELD_NUMBER = 4; - private float boost_; - /** - *
-   * Hint Boost. Positive value will increase the probability that a specific
-   * phrase will be recognized over other similar sounding phrases. The higher
-   * the boost, the higher the chance of false positive recognition as well.
-   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-   * enabled, so negative boost will simply be ignored. Though `boost` can
-   * accept a wide range of positive values, most use cases are best served with
-   * values between 0 (exclusive) and 20. We recommend using a binary search
-   * approach to finding the optimal value for your use case. Speech recognition
-   * will skip PhraseSets with a boost value of 0.
-   * 
- * - * float boost = 4; - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); - } - for (int i = 0; i < phrases_.size(); i++) { - output.writeMessage(2, phrases_.get(i)); - } - if (java.lang.Float.floatToRawIntBits(boost_) != 0) { - output.writeFloat(4, boost_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); - } - for (int i = 0; i < phrases_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, phrases_.get(i)); - } - if (java.lang.Float.floatToRawIntBits(boost_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(4, boost_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.PhraseSet)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.PhraseSet other = (com.google.cloud.speech.v1p1beta1.PhraseSet) obj; - - if (!getName() - .equals(other.getName())) return false; - if (!getPhrasesList() - .equals(other.getPhrasesList())) return false; - if (java.lang.Float.floatToIntBits(getBoost()) - != java.lang.Float.floatToIntBits( - other.getBoost())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - if (getPhrasesCount() > 0) { - hash = (37 * hash) + PHRASES_FIELD_NUMBER; - hash = (53 * hash) + getPhrasesList().hashCode(); - } - hash = (37 * hash) + BOOST_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getBoost()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.PhraseSet parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.PhraseSet prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Provides "hints" to the speech recognizer to favor specific words and phrases
-   * in the results.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.PhraseSet} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.PhraseSet) - com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.PhraseSet.class, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.PhraseSet.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getPhrasesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - name_ = ""; - - if (phrasesBuilder_ == null) { - phrases_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - phrasesBuilder_.clear(); - } - boost_ = 0F; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet build() { - com.google.cloud.speech.v1p1beta1.PhraseSet result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet buildPartial() { - com.google.cloud.speech.v1p1beta1.PhraseSet result = new com.google.cloud.speech.v1p1beta1.PhraseSet(this); - int from_bitField0_ = bitField0_; - result.name_ = name_; - if (phrasesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - phrases_ = java.util.Collections.unmodifiableList(phrases_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phrases_ = phrases_; - } else { - result.phrases_ = phrasesBuilder_.build(); - } - result.boost_ = boost_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.PhraseSet) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.PhraseSet)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.PhraseSet other) { - if (other == com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()) return this; - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - if (phrasesBuilder_ == null) { - if (!other.phrases_.isEmpty()) { - if (phrases_.isEmpty()) { - phrases_ = other.phrases_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhrasesIsMutable(); - phrases_.addAll(other.phrases_); - } - onChanged(); - } - } else { - if (!other.phrases_.isEmpty()) { - if (phrasesBuilder_.isEmpty()) { - phrasesBuilder_.dispose(); - phrasesBuilder_ = null; - phrases_ = other.phrases_; - bitField0_ = (bitField0_ & ~0x00000001); - phrasesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPhrasesFieldBuilder() : null; - } else { - phrasesBuilder_.addAllMessages(other.phrases_); - } - } - } - if (other.getBoost() != 0F) { - setBoost(other.getBoost()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.PhraseSet parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.PhraseSet) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object name_ = ""; - /** - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - *
-     * The resource name of the phrase set.
-     * 
- * - * string name = 1; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - - private java.util.List phrases_ = - java.util.Collections.emptyList(); - private void ensurePhrasesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - phrases_ = new java.util.ArrayList(phrases_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder, com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder> phrasesBuilder_; - - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public java.util.List getPhrasesList() { - if (phrasesBuilder_ == null) { - return java.util.Collections.unmodifiableList(phrases_); - } else { - return phrasesBuilder_.getMessageList(); - } - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public int getPhrasesCount() { - if (phrasesBuilder_ == null) { - return phrases_.size(); - } else { - return phrasesBuilder_.getCount(); - } - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getPhrases(int index) { - if (phrasesBuilder_ == null) { - return phrases_.get(index); - } else { - return phrasesBuilder_.getMessage(index); - } - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder setPhrases( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value) { - if (phrasesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.set(index, value); - onChanged(); - } else { - phrasesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder setPhrases( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - phrases_.set(index, builderForValue.build()); - onChanged(); - } else { - phrasesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder addPhrases(com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value) { - if (phrasesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.add(value); - onChanged(); - } else { - phrasesBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder addPhrases( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase value) { - if (phrasesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.add(index, value); - onChanged(); - } else { - phrasesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder addPhrases( - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - phrases_.add(builderForValue.build()); - onChanged(); - } else { - phrasesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder addPhrases( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder builderForValue) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - phrases_.add(index, builderForValue.build()); - onChanged(); - } else { - phrasesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder addAllPhrases( - java.lang.Iterable values) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, phrases_); - onChanged(); - } else { - phrasesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder clearPhrases() { - if (phrasesBuilder_ == null) { - phrases_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - phrasesBuilder_.clear(); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public Builder removePhrases(int index) { - if (phrasesBuilder_ == null) { - ensurePhrasesIsMutable(); - phrases_.remove(index); - onChanged(); - } else { - phrasesBuilder_.remove(index); - } - return this; - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder getPhrasesBuilder( - int index) { - return getPhrasesFieldBuilder().getBuilder(index); - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( - int index) { - if (phrasesBuilder_ == null) { - return phrases_.get(index); } else { - return phrasesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public java.util.List - getPhrasesOrBuilderList() { - if (phrasesBuilder_ != null) { - return phrasesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(phrases_); - } - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder addPhrasesBuilder() { - return getPhrasesFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance()); - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder addPhrasesBuilder( - int index) { - return getPhrasesFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.getDefaultInstance()); - } - /** - *
-     * A list of word and phrases.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - public java.util.List - getPhrasesBuilderList() { - return getPhrasesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder, com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder> - getPhrasesFieldBuilder() { - if (phrasesBuilder_ == null) { - phrasesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase, com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase.Builder, com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder>( - phrases_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - phrases_ = null; - } - return phrasesBuilder_; - } - - private float boost_ ; - /** - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 (exclusive) and 20. We recommend using a binary search
-     * approach to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 4; - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - /** - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 (exclusive) and 20. We recommend using a binary search
-     * approach to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 4; - * @param value The boost to set. - * @return This builder for chaining. - */ - public Builder setBoost(float value) { - - boost_ = value; - onChanged(); - return this; - } - /** - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 (exclusive) and 20. We recommend using a binary search
-     * approach to finding the optimal value for your use case. Speech recognition
-     * will skip PhraseSets with a boost value of 0.
-     * 
- * - * float boost = 4; - * @return This builder for chaining. - */ - public Builder clearBoost() { - - boost_ = 0F; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.PhraseSet) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.PhraseSet) - private static final com.google.cloud.speech.v1p1beta1.PhraseSet DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.PhraseSet(); - } - - public static com.google.cloud.speech.v1p1beta1.PhraseSet getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PhraseSet parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PhraseSet(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetName.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetName.java deleted file mode 100644 index aaea055bf1b8..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetName.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1; - -import com.google.api.pathtemplate.PathTemplate; -import com.google.api.resourcenames.ResourceName; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.annotation.Generated; - -// AUTO-GENERATED DOCUMENTATION AND CLASS. -@Generated("by gapic-generator-java") -public class PhraseSetName implements ResourceName { - private static final PathTemplate PROJECT_LOCATION_PHRASE_SET = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/phraseSets/{phrase_set}"); - private volatile Map fieldValuesMap; - private final String project; - private final String location; - private final String phraseSet; - - @Deprecated - protected PhraseSetName() { - project = null; - location = null; - phraseSet = null; - } - - private PhraseSetName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - phraseSet = Preconditions.checkNotNull(builder.getPhraseSet()); - } - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getPhraseSet() { - return phraseSet; - } - - public static Builder newBuilder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder(this); - } - - public static PhraseSetName of(String project, String location, String phraseSet) { - return newBuilder().setProject(project).setLocation(location).setPhraseSet(phraseSet).build(); - } - - public static String format(String project, String location, String phraseSet) { - return newBuilder() - .setProject(project) - .setLocation(location) - .setPhraseSet(phraseSet) - .build() - .toString(); - } - - public static PhraseSetName parse(String formattedString) { - if (formattedString.isEmpty()) { - return null; - } - Map matchMap = - PROJECT_LOCATION_PHRASE_SET.validatedMatch( - formattedString, "PhraseSetName.parse: formattedString not in valid format"); - return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("phrase_set")); - } - - public static List parseList(List formattedStrings) { - List list = new ArrayList<>(formattedStrings.size()); - for (String formattedString : formattedStrings) { - list.add(parse(formattedString)); - } - return list; - } - - public static List toStringList(List values) { - List list = new ArrayList<>(values.size()); - for (PhraseSetName value : values) { - if (value == null) { - list.add(""); - } else { - list.add(value.toString()); - } - } - return list; - } - - public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION_PHRASE_SET.matches(formattedString); - } - - @Override - public Map getFieldValuesMap() { - if (fieldValuesMap == null) { - synchronized (this) { - if (fieldValuesMap == null) { - ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { - fieldMapBuilder.put("project", project); - } - if (location != null) { - fieldMapBuilder.put("location", location); - } - if (phraseSet != null) { - fieldMapBuilder.put("phrase_set", phraseSet); - } - fieldValuesMap = fieldMapBuilder.build(); - } - } - } - return fieldValuesMap; - } - - public String getFieldValue(String fieldName) { - return getFieldValuesMap().get(fieldName); - } - - @Override - public String toString() { - return PROJECT_LOCATION_PHRASE_SET.instantiate( - "project", project, "location", location, "phrase_set", phraseSet); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - PhraseSetName that = ((PhraseSetName) o); - return Objects.equals(this.project, that.project) - && Objects.equals(this.location, that.location) - && Objects.equals(this.phraseSet, that.phraseSet); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - h *= 1000003; - h ^= Objects.hashCode(phraseSet); - return h; - } - - /** Builder for projects/{project}/locations/{location}/phraseSets/{phrase_set}. */ - public static class Builder { - private String project; - private String location; - private String phraseSet; - - protected Builder() {} - - public String getProject() { - return project; - } - - public String getLocation() { - return location; - } - - public String getPhraseSet() { - return phraseSet; - } - - public Builder setProject(String project) { - this.project = project; - return this; - } - - public Builder setLocation(String location) { - this.location = location; - return this; - } - - public Builder setPhraseSet(String phraseSet) { - this.phraseSet = phraseSet; - return this; - } - - private Builder(PhraseSetName phraseSetName) { - this.project = phraseSetName.project; - this.location = phraseSetName.location; - this.phraseSet = phraseSetName.phraseSet; - } - - public PhraseSetName build() { - return new PhraseSetName(this); - } - } -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetOrBuilder.java deleted file mode 100644 index 1ed61ed52826..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/PhraseSetOrBuilder.java +++ /dev/null @@ -1,91 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface PhraseSetOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.PhraseSet) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The resource name of the phrase set.
-   * 
- * - * string name = 1; - * @return The name. - */ - java.lang.String getName(); - /** - *
-   * The resource name of the phrase set.
-   * 
- * - * string name = 1; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); - - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - java.util.List - getPhrasesList(); - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - com.google.cloud.speech.v1p1beta1.PhraseSet.Phrase getPhrases(int index); - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - int getPhrasesCount(); - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - java.util.List - getPhrasesOrBuilderList(); - /** - *
-   * A list of word and phrases.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet.Phrase phrases = 2; - */ - com.google.cloud.speech.v1p1beta1.PhraseSet.PhraseOrBuilder getPhrasesOrBuilder( - int index); - - /** - *
-   * Hint Boost. Positive value will increase the probability that a specific
-   * phrase will be recognized over other similar sounding phrases. The higher
-   * the boost, the higher the chance of false positive recognition as well.
-   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-   * enabled, so negative boost will simply be ignored. Though `boost` can
-   * accept a wide range of positive values, most use cases are best served with
-   * values between 0 (exclusive) and 20. We recommend using a binary search
-   * approach to finding the optimal value for your use case. Speech recognition
-   * will skip PhraseSets with a boost value of 0.
-   * 
- * - * float boost = 4; - * @return The boost. - */ - float getBoost(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudio.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudio.java deleted file mode 100644 index fe2a09446dbd..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudio.java +++ /dev/null @@ -1,906 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Contains audio data in the encoding specified in the `RecognitionConfig`.
- * Either `content` or `uri` must be supplied. Supplying both or neither
- * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
- * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionAudio} - */ -public final class RecognitionAudio extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognitionAudio) - RecognitionAudioOrBuilder { -private static final long serialVersionUID = 0L; - // Use RecognitionAudio.newBuilder() to construct. - private RecognitionAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RecognitionAudio() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RecognitionAudio(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RecognitionAudio( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - audioSource_ = input.readBytes(); - audioSourceCase_ = 1; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - audioSourceCase_ = 2; - audioSource_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognitionAudio.class, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder.class); - } - - private int audioSourceCase_ = 0; - private java.lang.Object audioSource_; - public enum AudioSourceCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - CONTENT(1), - URI(2), - AUDIOSOURCE_NOT_SET(0); - private final int value; - private AudioSourceCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static AudioSourceCase valueOf(int value) { - return forNumber(value); - } - - public static AudioSourceCase forNumber(int value) { - switch (value) { - case 1: return CONTENT; - case 2: return URI; - case 0: return AUDIOSOURCE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public AudioSourceCase - getAudioSourceCase() { - return AudioSourceCase.forNumber( - audioSourceCase_); - } - - public static final int CONTENT_FIELD_NUMBER = 1; - /** - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - * @return Whether the content field is set. - */ - @java.lang.Override - public boolean hasContent() { - return audioSourceCase_ == 1; - } - /** - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - * @return The content. - */ - @java.lang.Override - public com.google.protobuf.ByteString getContent() { - if (audioSourceCase_ == 1) { - return (com.google.protobuf.ByteString) audioSource_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - public static final int URI_FIELD_NUMBER = 2; - /** - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * @return Whether the uri field is set. - */ - public boolean hasUri() { - return audioSourceCase_ == 2; - } - /** - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * @return The uri. - */ - public java.lang.String getUri() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (audioSourceCase_ == 2) { - audioSource_ = s; - } - return s; - } - } - /** - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * @return The bytes for uri. - */ - public com.google.protobuf.ByteString - getUriBytes() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (audioSourceCase_ == 2) { - audioSource_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (audioSourceCase_ == 1) { - output.writeBytes( - 1, (com.google.protobuf.ByteString) audioSource_); - } - if (audioSourceCase_ == 2) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, audioSource_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (audioSourceCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize( - 1, (com.google.protobuf.ByteString) audioSource_); - } - if (audioSourceCase_ == 2) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, audioSource_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.RecognitionAudio)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.RecognitionAudio other = (com.google.cloud.speech.v1p1beta1.RecognitionAudio) obj; - - if (!getAudioSourceCase().equals(other.getAudioSourceCase())) return false; - switch (audioSourceCase_) { - case 1: - if (!getContent() - .equals(other.getContent())) return false; - break; - case 2: - if (!getUri() - .equals(other.getUri())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (audioSourceCase_) { - case 1: - hash = (37 * hash) + CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getContent().hashCode(); - break; - case 2: - hash = (37 * hash) + URI_FIELD_NUMBER; - hash = (53 * hash) + getUri().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.RecognitionAudio prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Contains audio data in the encoding specified in the `RecognitionConfig`.
-   * Either `content` or `uri` must be supplied. Supplying both or neither
-   * returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionAudio} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognitionAudio) - com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognitionAudio.class, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.RecognitionAudio.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - audioSourceCase_ = 0; - audioSource_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudio getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudio build() { - com.google.cloud.speech.v1p1beta1.RecognitionAudio result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudio buildPartial() { - com.google.cloud.speech.v1p1beta1.RecognitionAudio result = new com.google.cloud.speech.v1p1beta1.RecognitionAudio(this); - if (audioSourceCase_ == 1) { - result.audioSource_ = audioSource_; - } - if (audioSourceCase_ == 2) { - result.audioSource_ = audioSource_; - } - result.audioSourceCase_ = audioSourceCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.RecognitionAudio) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognitionAudio)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognitionAudio other) { - if (other == com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance()) return this; - switch (other.getAudioSourceCase()) { - case CONTENT: { - setContent(other.getContent()); - break; - } - case URI: { - audioSourceCase_ = 2; - audioSource_ = other.audioSource_; - onChanged(); - break; - } - case AUDIOSOURCE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.RecognitionAudio parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.RecognitionAudio) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int audioSourceCase_ = 0; - private java.lang.Object audioSource_; - public AudioSourceCase - getAudioSourceCase() { - return AudioSourceCase.forNumber( - audioSourceCase_); - } - - public Builder clearAudioSource() { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - return this; - } - - - /** - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * @return Whether the content field is set. - */ - public boolean hasContent() { - return audioSourceCase_ == 1; - } - /** - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * @return The content. - */ - public com.google.protobuf.ByteString getContent() { - if (audioSourceCase_ == 1) { - return (com.google.protobuf.ByteString) audioSource_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * @param value The content to set. - * @return This builder for chaining. - */ - public Builder setContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - audioSourceCase_ = 1; - audioSource_ = value; - onChanged(); - return this; - } - /** - *
-     * The audio data bytes encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation, whereas JSON representations use base64.
-     * 
- * - * bytes content = 1; - * @return This builder for chaining. - */ - public Builder clearContent() { - if (audioSourceCase_ == 1) { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - } - return this; - } - - /** - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * @return Whether the uri field is set. - */ - @java.lang.Override - public boolean hasUri() { - return audioSourceCase_ == 2; - } - /** - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * @return The uri. - */ - @java.lang.Override - public java.lang.String getUri() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (audioSourceCase_ == 2) { - audioSource_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * @return The bytes for uri. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getUriBytes() { - java.lang.Object ref = ""; - if (audioSourceCase_ == 2) { - ref = audioSource_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (audioSourceCase_ == 2) { - audioSource_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * @param value The uri to set. - * @return This builder for chaining. - */ - public Builder setUri( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - audioSourceCase_ = 2; - audioSource_ = value; - onChanged(); - return this; - } - /** - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * @return This builder for chaining. - */ - public Builder clearUri() { - if (audioSourceCase_ == 2) { - audioSourceCase_ = 0; - audioSource_ = null; - onChanged(); - } - return this; - } - /** - *
-     * URI that points to a file that contains audio data bytes as specified in
-     * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-     * Currently, only Google Cloud Storage URIs are
-     * supported, which must be specified in the following format:
-     * `gs://bucket_name/object_name` (other URI formats return
-     * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-     * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-     * 
- * - * string uri = 2; - * @param value The bytes for uri to set. - * @return This builder for chaining. - */ - public Builder setUriBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - audioSourceCase_ = 2; - audioSource_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.RecognitionAudio) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognitionAudio) - private static final com.google.cloud.speech.v1p1beta1.RecognitionAudio DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognitionAudio(); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionAudio getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognitionAudio parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionAudio(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudio getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudioOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudioOrBuilder.java deleted file mode 100644 index 6127a94e206c..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionAudioOrBuilder.java +++ /dev/null @@ -1,81 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface RecognitionAudioOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognitionAudio) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - * @return Whether the content field is set. - */ - boolean hasContent(); - /** - *
-   * The audio data bytes encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation, whereas JSON representations use base64.
-   * 
- * - * bytes content = 1; - * @return The content. - */ - com.google.protobuf.ByteString getContent(); - - /** - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * @return Whether the uri field is set. - */ - boolean hasUri(); - /** - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * @return The uri. - */ - java.lang.String getUri(); - /** - *
-   * URI that points to a file that contains audio data bytes as specified in
-   * `RecognitionConfig`. The file must not be compressed (for example, gzip).
-   * Currently, only Google Cloud Storage URIs are
-   * supported, which must be specified in the following format:
-   * `gs://bucket_name/object_name` (other URI formats return
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
-   * [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
-   * 
- * - * string uri = 2; - * @return The bytes for uri. - */ - com.google.protobuf.ByteString - getUriBytes(); - - public com.google.cloud.speech.v1p1beta1.RecognitionAudio.AudioSourceCase getAudioSourceCase(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java deleted file mode 100644 index 7acf02511c20..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfig.java +++ /dev/null @@ -1,5330 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Provides information to the recognizer that specifies how to process the
- * request.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionConfig} - */ -public final class RecognitionConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognitionConfig) - RecognitionConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use RecognitionConfig.newBuilder() to construct. - private RecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RecognitionConfig() { - encoding_ = 0; - languageCode_ = ""; - alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - speechContexts_ = java.util.Collections.emptyList(); - model_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RecognitionConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RecognitionConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - int rawValue = input.readEnum(); - - encoding_ = rawValue; - break; - } - case 16: { - - sampleRateHertz_ = input.readInt32(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - languageCode_ = s; - break; - } - case 32: { - - maxAlternatives_ = input.readInt32(); - break; - } - case 40: { - - profanityFilter_ = input.readBool(); - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - speechContexts_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - speechContexts_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.SpeechContext.parser(), extensionRegistry)); - break; - } - case 56: { - - audioChannelCount_ = input.readInt32(); - break; - } - case 64: { - - enableWordTimeOffsets_ = input.readBool(); - break; - } - case 74: { - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder subBuilder = null; - if (metadata_ != null) { - subBuilder = metadata_.toBuilder(); - } - metadata_ = input.readMessage(com.google.cloud.speech.v1p1beta1.RecognitionMetadata.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(metadata_); - metadata_ = subBuilder.buildPartial(); - } - - break; - } - case 88: { - - enableAutomaticPunctuation_ = input.readBool(); - break; - } - case 96: { - - enableSeparateRecognitionPerChannel_ = input.readBool(); - break; - } - case 106: { - java.lang.String s = input.readStringRequireUtf8(); - - model_ = s; - break; - } - case 112: { - - useEnhanced_ = input.readBool(); - break; - } - case 120: { - - enableWordConfidence_ = input.readBool(); - break; - } - case 128: { - - enableSpeakerDiarization_ = input.readBool(); - break; - } - case 136: { - - diarizationSpeakerCount_ = input.readInt32(); - break; - } - case 146: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - alternativeLanguageCodes_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - alternativeLanguageCodes_.add(s); - break; - } - case 154: { - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder subBuilder = null; - if (diarizationConfig_ != null) { - subBuilder = diarizationConfig_.toBuilder(); - } - diarizationConfig_ = input.readMessage(com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(diarizationConfig_); - diarizationConfig_ = subBuilder.buildPartial(); - } - - break; - } - case 162: { - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder subBuilder = null; - if (adaptation_ != null) { - subBuilder = adaptation_.toBuilder(); - } - adaptation_ = input.readMessage(com.google.cloud.speech.v1p1beta1.SpeechAdaptation.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(adaptation_); - adaptation_ = subBuilder.buildPartial(); - } - - break; - } - case 178: { - com.google.protobuf.BoolValue.Builder subBuilder = null; - if (enableSpokenPunctuation_ != null) { - subBuilder = enableSpokenPunctuation_.toBuilder(); - } - enableSpokenPunctuation_ = input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(enableSpokenPunctuation_); - enableSpokenPunctuation_ = subBuilder.buildPartial(); - } - - break; - } - case 186: { - com.google.protobuf.BoolValue.Builder subBuilder = null; - if (enableSpokenEmojis_ != null) { - subBuilder = enableSpokenEmojis_.toBuilder(); - } - enableSpokenEmojis_ = input.readMessage(com.google.protobuf.BoolValue.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(enableSpokenEmojis_); - enableSpokenEmojis_ = subBuilder.buildPartial(); - } - - break; - } - case 194: { - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder subBuilder = null; - if (transcriptNormalization_ != null) { - subBuilder = transcriptNormalization_.toBuilder(); - } - transcriptNormalization_ = input.readMessage(com.google.cloud.speech.v1p1beta1.TranscriptNormalization.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(transcriptNormalization_); - transcriptNormalization_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { - speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); - } - if (((mutable_bitField0_ & 0x00000001) != 0)) { - alternativeLanguageCodes_ = alternativeLanguageCodes_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.class, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder.class); - } - - /** - *
-   * The encoding of the audio data sent in the request.
-   * All encodings support only 1 channel (mono) audio, unless the
-   * `audio_channel_count` and `enable_separate_recognition_per_channel` fields
-   * are set.
-   * For best results, the audio source should be captured and transmitted using
-   * a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
-   * recognition can be reduced if lossy codecs are used to capture or transmit
-   * audio, particularly if background noise is present. Lossy codecs include
-   * `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`,
-   * and `WEBM_OPUS`.
-   * The `FLAC` and `WAV` audio file formats include a header that describes the
-   * included audio content. You can request recognition for `WAV` files that
-   * contain either `LINEAR16` or `MULAW` encoded audio.
-   * If you send `FLAC` or `WAV` audio file format in
-   * your request, you do not need to specify an `AudioEncoding`; the audio
-   * encoding format is determined from the file header. If you specify
-   * an `AudioEncoding` when you send  send `FLAC` or `WAV` audio, the
-   * encoding configuration must match the encoding described in the audio
-   * header; otherwise the request returns an
-   * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding} - */ - public enum AudioEncoding - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * Not specified.
-     * 
- * - * ENCODING_UNSPECIFIED = 0; - */ - ENCODING_UNSPECIFIED(0), - /** - *
-     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
-     * 
- * - * LINEAR16 = 1; - */ - LINEAR16(1), - /** - *
-     * `FLAC` (Free Lossless Audio
-     * Codec) is the recommended encoding because it is
-     * lossless--therefore recognition is not compromised--and
-     * requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
-     * encoding supports 16-bit and 24-bit samples, however, not all fields in
-     * `STREAMINFO` are supported.
-     * 
- * - * FLAC = 2; - */ - FLAC(2), - /** - *
-     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
-     * 
- * - * MULAW = 3; - */ - MULAW(3), - /** - *
-     * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
-     * 
- * - * AMR = 4; - */ - AMR(4), - /** - *
-     * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
-     * 
- * - * AMR_WB = 5; - */ - AMR_WB(5), - /** - *
-     * Opus encoded audio frames in Ogg container
-     * ([OggOpus](https://wiki.xiph.org/OggOpus)).
-     * `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
-     * 
- * - * OGG_OPUS = 6; - */ - OGG_OPUS(6), - /** - *
-     * Although the use of lossy encodings is not recommended, if a very low
-     * bitrate encoding is required, `OGG_OPUS` is highly preferred over
-     * Speex encoding. The [Speex](https://speex.org/)  encoding supported by
-     * Cloud Speech API has a header byte in each block, as in MIME type
-     * `audio/x-speex-with-header-byte`.
-     * It is a variant of the RTP Speex encoding defined in
-     * [RFC 5574](https://tools.ietf.org/html/rfc5574).
-     * The stream is a sequence of blocks, one block per RTP packet. Each block
-     * starts with a byte containing the length of the block, in bytes, followed
-     * by one or more frames of Speex data, padded to an integral number of
-     * bytes (octets) as specified in RFC 5574. In other words, each RTP header
-     * is replaced with a single byte containing the block length. Only Speex
-     * wideband is supported. `sample_rate_hertz` must be 16000.
-     * 
- * - * SPEEX_WITH_HEADER_BYTE = 7; - */ - SPEEX_WITH_HEADER_BYTE(7), - /** - *
-     * MP3 audio. MP3 encoding is a Beta feature and only available in
-     * v1p1beta1. Support all standard MP3 bitrates (which range from 32-320
-     * kbps). When using this encoding, `sample_rate_hertz` has to match the
-     * sample rate of the file being used.
-     * 
- * - * MP3 = 8; - */ - MP3(8), - /** - *
-     * Opus encoded audio frames in WebM container
-     * ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be
-     * one of 8000, 12000, 16000, 24000, or 48000.
-     * 
- * - * WEBM_OPUS = 9; - */ - WEBM_OPUS(9), - UNRECOGNIZED(-1), - ; - - /** - *
-     * Not specified.
-     * 
- * - * ENCODING_UNSPECIFIED = 0; - */ - public static final int ENCODING_UNSPECIFIED_VALUE = 0; - /** - *
-     * Uncompressed 16-bit signed little-endian samples (Linear PCM).
-     * 
- * - * LINEAR16 = 1; - */ - public static final int LINEAR16_VALUE = 1; - /** - *
-     * `FLAC` (Free Lossless Audio
-     * Codec) is the recommended encoding because it is
-     * lossless--therefore recognition is not compromised--and
-     * requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
-     * encoding supports 16-bit and 24-bit samples, however, not all fields in
-     * `STREAMINFO` are supported.
-     * 
- * - * FLAC = 2; - */ - public static final int FLAC_VALUE = 2; - /** - *
-     * 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
-     * 
- * - * MULAW = 3; - */ - public static final int MULAW_VALUE = 3; - /** - *
-     * Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
-     * 
- * - * AMR = 4; - */ - public static final int AMR_VALUE = 4; - /** - *
-     * Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
-     * 
- * - * AMR_WB = 5; - */ - public static final int AMR_WB_VALUE = 5; - /** - *
-     * Opus encoded audio frames in Ogg container
-     * ([OggOpus](https://wiki.xiph.org/OggOpus)).
-     * `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
-     * 
- * - * OGG_OPUS = 6; - */ - public static final int OGG_OPUS_VALUE = 6; - /** - *
-     * Although the use of lossy encodings is not recommended, if a very low
-     * bitrate encoding is required, `OGG_OPUS` is highly preferred over
-     * Speex encoding. The [Speex](https://speex.org/)  encoding supported by
-     * Cloud Speech API has a header byte in each block, as in MIME type
-     * `audio/x-speex-with-header-byte`.
-     * It is a variant of the RTP Speex encoding defined in
-     * [RFC 5574](https://tools.ietf.org/html/rfc5574).
-     * The stream is a sequence of blocks, one block per RTP packet. Each block
-     * starts with a byte containing the length of the block, in bytes, followed
-     * by one or more frames of Speex data, padded to an integral number of
-     * bytes (octets) as specified in RFC 5574. In other words, each RTP header
-     * is replaced with a single byte containing the block length. Only Speex
-     * wideband is supported. `sample_rate_hertz` must be 16000.
-     * 
- * - * SPEEX_WITH_HEADER_BYTE = 7; - */ - public static final int SPEEX_WITH_HEADER_BYTE_VALUE = 7; - /** - *
-     * MP3 audio. MP3 encoding is a Beta feature and only available in
-     * v1p1beta1. Support all standard MP3 bitrates (which range from 32-320
-     * kbps). When using this encoding, `sample_rate_hertz` has to match the
-     * sample rate of the file being used.
-     * 
- * - * MP3 = 8; - */ - public static final int MP3_VALUE = 8; - /** - *
-     * Opus encoded audio frames in WebM container
-     * ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be
-     * one of 8000, 12000, 16000, 24000, or 48000.
-     * 
- * - * WEBM_OPUS = 9; - */ - public static final int WEBM_OPUS_VALUE = 9; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static AudioEncoding valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static AudioEncoding forNumber(int value) { - switch (value) { - case 0: return ENCODING_UNSPECIFIED; - case 1: return LINEAR16; - case 2: return FLAC; - case 3: return MULAW; - case 4: return AMR; - case 5: return AMR_WB; - case 6: return OGG_OPUS; - case 7: return SPEEX_WITH_HEADER_BYTE; - case 8: return MP3; - case 9: return WEBM_OPUS; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - AudioEncoding> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public AudioEncoding findValueByNumber(int number) { - return AudioEncoding.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDescriptor().getEnumTypes().get(0); - } - - private static final AudioEncoding[] VALUES = values(); - - public static AudioEncoding valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private AudioEncoding(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding) - } - - public static final int ENCODING_FIELD_NUMBER = 1; - private int encoding_; - /** - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * @return The enum numeric value on the wire for encoding. - */ - @java.lang.Override public int getEncodingValue() { - return encoding_; - } - /** - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * @return The encoding. - */ - @java.lang.Override public com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding getEncoding() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding result = com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.valueOf(encoding_); - return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.UNRECOGNIZED : result; - } - - public static final int SAMPLE_RATE_HERTZ_FIELD_NUMBER = 2; - private int sampleRateHertz_; - /** - *
-   * Sample rate in Hertz of the audio data sent in all
-   * `RecognitionAudio` messages. Valid values are: 8000-48000.
-   * 16000 is optimal. For best results, set the sampling rate of the audio
-   * source to 16000 Hz. If that's not possible, use the native sample rate of
-   * the audio source (instead of re-sampling).
-   * This field is optional for FLAC and WAV audio files, but is
-   * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-   * 
- * - * int32 sample_rate_hertz = 2; - * @return The sampleRateHertz. - */ - @java.lang.Override - public int getSampleRateHertz() { - return sampleRateHertz_; - } - - public static final int AUDIO_CHANNEL_COUNT_FIELD_NUMBER = 7; - private int audioChannelCount_; - /** - *
-   * The number of channels in the input audio data.
-   * ONLY set this for MULTI-CHANNEL recognition.
-   * Valid values for LINEAR16 and FLAC are `1`-`8`.
-   * Valid values for OGG_OPUS are '1'-'254'.
-   * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
-   * If `0` or omitted, defaults to one channel (mono).
-   * Note: We only recognize the first channel by default.
-   * To perform independent recognition on each channel set
-   * `enable_separate_recognition_per_channel` to 'true'.
-   * 
- * - * int32 audio_channel_count = 7; - * @return The audioChannelCount. - */ - @java.lang.Override - public int getAudioChannelCount() { - return audioChannelCount_; - } - - public static final int ENABLE_SEPARATE_RECOGNITION_PER_CHANNEL_FIELD_NUMBER = 12; - private boolean enableSeparateRecognitionPerChannel_; - /** - *
-   * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-   * to get each channel recognized separately. The recognition result will
-   * contain a `channel_tag` field to state which channel that result belongs
-   * to. If this is not true, we will only recognize the first channel. The
-   * request is billed cumulatively for all channels recognized:
-   * `audio_channel_count` multiplied by the length of the audio.
-   * 
- * - * bool enable_separate_recognition_per_channel = 12; - * @return The enableSeparateRecognitionPerChannel. - */ - @java.lang.Override - public boolean getEnableSeparateRecognitionPerChannel() { - return enableSeparateRecognitionPerChannel_; - } - - public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; - private volatile java.lang.Object languageCode_; - /** - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The languageCode. - */ - @java.lang.Override - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } - } - /** - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for languageCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ALTERNATIVE_LANGUAGE_CODES_FIELD_NUMBER = 18; - private com.google.protobuf.LazyStringList alternativeLanguageCodes_; - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @return A list containing the alternativeLanguageCodes. - */ - public com.google.protobuf.ProtocolStringList - getAlternativeLanguageCodesList() { - return alternativeLanguageCodes_; - } - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @return The count of alternativeLanguageCodes. - */ - public int getAlternativeLanguageCodesCount() { - return alternativeLanguageCodes_.size(); - } - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index of the element to return. - * @return The alternativeLanguageCodes at the given index. - */ - public java.lang.String getAlternativeLanguageCodes(int index) { - return alternativeLanguageCodes_.get(index); - } - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index of the value to return. - * @return The bytes of the alternativeLanguageCodes at the given index. - */ - public com.google.protobuf.ByteString - getAlternativeLanguageCodesBytes(int index) { - return alternativeLanguageCodes_.getByteString(index); - } - - public static final int MAX_ALTERNATIVES_FIELD_NUMBER = 4; - private int maxAlternatives_; - /** - *
-   * Maximum number of recognition hypotheses to be returned.
-   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-   * within each `SpeechRecognitionResult`.
-   * The server may return fewer than `max_alternatives`.
-   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-   * one. If omitted, will return a maximum of one.
-   * 
- * - * int32 max_alternatives = 4; - * @return The maxAlternatives. - */ - @java.lang.Override - public int getMaxAlternatives() { - return maxAlternatives_; - } - - public static final int PROFANITY_FILTER_FIELD_NUMBER = 5; - private boolean profanityFilter_; - /** - *
-   * If set to `true`, the server will attempt to filter out
-   * profanities, replacing all but the initial character in each filtered word
-   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-   * won't be filtered out.
-   * 
- * - * bool profanity_filter = 5; - * @return The profanityFilter. - */ - @java.lang.Override - public boolean getProfanityFilter() { - return profanityFilter_; - } - - public static final int ADAPTATION_FIELD_NUMBER = 20; - private com.google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation_; - /** - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-   * documentation.
-   * When speech adaptation is set it supersedes the `speech_contexts` field.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - * @return Whether the adaptation field is set. - */ - @java.lang.Override - public boolean hasAdaptation() { - return adaptation_ != null; - } - /** - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-   * documentation.
-   * When speech adaptation is set it supersedes the `speech_contexts` field.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - * @return The adaptation. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation getAdaptation() { - return adaptation_ == null ? com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance() : adaptation_; - } - /** - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-   * documentation.
-   * When speech adaptation is set it supersedes the `speech_contexts` field.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder getAdaptationOrBuilder() { - return getAdaptation(); - } - - public static final int TRANSCRIPT_NORMALIZATION_FIELD_NUMBER = 24; - private com.google.cloud.speech.v1p1beta1.TranscriptNormalization transcriptNormalization_; - /** - *
-   * Use transcription normalization to automatically replace parts of the
-   * transcript with phrases of your choosing. For StreamingRecognize, this
-   * normalization only applies to stable partial transcripts (stability > 0.8)
-   * and final transcripts.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - * @return Whether the transcriptNormalization field is set. - */ - @java.lang.Override - public boolean hasTranscriptNormalization() { - return transcriptNormalization_ != null; - } - /** - *
-   * Use transcription normalization to automatically replace parts of the
-   * transcript with phrases of your choosing. For StreamingRecognize, this
-   * normalization only applies to stable partial transcripts (stability > 0.8)
-   * and final transcripts.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - * @return The transcriptNormalization. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization getTranscriptNormalization() { - return transcriptNormalization_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptNormalization.getDefaultInstance() : transcriptNormalization_; - } - /** - *
-   * Use transcription normalization to automatically replace parts of the
-   * transcript with phrases of your choosing. For StreamingRecognize, this
-   * normalization only applies to stable partial transcripts (stability > 0.8)
-   * and final transcripts.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder getTranscriptNormalizationOrBuilder() { - return getTranscriptNormalization(); - } - - public static final int SPEECH_CONTEXTS_FIELD_NUMBER = 6; - private java.util.List speechContexts_; - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public java.util.List getSpeechContextsList() { - return speechContexts_; - } - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public java.util.List - getSpeechContextsOrBuilderList() { - return speechContexts_; - } - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public int getSpeechContextsCount() { - return speechContexts_.size(); - } - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechContext getSpeechContexts(int index) { - return speechContexts_.get(index); - } - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder getSpeechContextsOrBuilder( - int index) { - return speechContexts_.get(index); - } - - public static final int ENABLE_WORD_TIME_OFFSETS_FIELD_NUMBER = 8; - private boolean enableWordTimeOffsets_; - /** - *
-   * If `true`, the top result includes a list of words and
-   * the start and end time offsets (timestamps) for those words. If
-   * `false`, no word-level time offset information is returned. The default is
-   * `false`.
-   * 
- * - * bool enable_word_time_offsets = 8; - * @return The enableWordTimeOffsets. - */ - @java.lang.Override - public boolean getEnableWordTimeOffsets() { - return enableWordTimeOffsets_; - } - - public static final int ENABLE_WORD_CONFIDENCE_FIELD_NUMBER = 15; - private boolean enableWordConfidence_; - /** - *
-   * If `true`, the top result includes a list of words and the
-   * confidence for those words. If `false`, no word-level confidence
-   * information is returned. The default is `false`.
-   * 
- * - * bool enable_word_confidence = 15; - * @return The enableWordConfidence. - */ - @java.lang.Override - public boolean getEnableWordConfidence() { - return enableWordConfidence_; - } - - public static final int ENABLE_AUTOMATIC_PUNCTUATION_FIELD_NUMBER = 11; - private boolean enableAutomaticPunctuation_; - /** - *
-   * If 'true', adds punctuation to recognition result hypotheses.
-   * This feature is only available in select languages. Setting this for
-   * requests in other languages has no effect at all.
-   * The default 'false' value does not add punctuation to result hypotheses.
-   * 
- * - * bool enable_automatic_punctuation = 11; - * @return The enableAutomaticPunctuation. - */ - @java.lang.Override - public boolean getEnableAutomaticPunctuation() { - return enableAutomaticPunctuation_; - } - - public static final int ENABLE_SPOKEN_PUNCTUATION_FIELD_NUMBER = 22; - private com.google.protobuf.BoolValue enableSpokenPunctuation_; - /** - *
-   * The spoken punctuation behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * e.g. command_and_search will enable spoken punctuation by default
-   * If 'true', replaces spoken punctuation with the corresponding symbols in
-   * the request. For example, "how are you question mark" becomes "how are
-   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-   * for support. If 'false', spoken punctuation is not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - * @return Whether the enableSpokenPunctuation field is set. - */ - @java.lang.Override - public boolean hasEnableSpokenPunctuation() { - return enableSpokenPunctuation_ != null; - } - /** - *
-   * The spoken punctuation behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * e.g. command_and_search will enable spoken punctuation by default
-   * If 'true', replaces spoken punctuation with the corresponding symbols in
-   * the request. For example, "how are you question mark" becomes "how are
-   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-   * for support. If 'false', spoken punctuation is not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - * @return The enableSpokenPunctuation. - */ - @java.lang.Override - public com.google.protobuf.BoolValue getEnableSpokenPunctuation() { - return enableSpokenPunctuation_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenPunctuation_; - } - /** - *
-   * The spoken punctuation behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * e.g. command_and_search will enable spoken punctuation by default
-   * If 'true', replaces spoken punctuation with the corresponding symbols in
-   * the request. For example, "how are you question mark" becomes "how are
-   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-   * for support. If 'false', spoken punctuation is not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - @java.lang.Override - public com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilder() { - return getEnableSpokenPunctuation(); - } - - public static final int ENABLE_SPOKEN_EMOJIS_FIELD_NUMBER = 23; - private com.google.protobuf.BoolValue enableSpokenEmojis_; - /** - *
-   * The spoken emoji behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * If 'true', adds spoken emoji formatting for the request. This will replace
-   * spoken emojis with the corresponding Unicode symbols in the final
-   * transcript. If 'false', spoken emojis are not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - * @return Whether the enableSpokenEmojis field is set. - */ - @java.lang.Override - public boolean hasEnableSpokenEmojis() { - return enableSpokenEmojis_ != null; - } - /** - *
-   * The spoken emoji behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * If 'true', adds spoken emoji formatting for the request. This will replace
-   * spoken emojis with the corresponding Unicode symbols in the final
-   * transcript. If 'false', spoken emojis are not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - * @return The enableSpokenEmojis. - */ - @java.lang.Override - public com.google.protobuf.BoolValue getEnableSpokenEmojis() { - return enableSpokenEmojis_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenEmojis_; - } - /** - *
-   * The spoken emoji behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * If 'true', adds spoken emoji formatting for the request. This will replace
-   * spoken emojis with the corresponding Unicode symbols in the final
-   * transcript. If 'false', spoken emojis are not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - @java.lang.Override - public com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder() { - return getEnableSpokenEmojis(); - } - - public static final int ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER = 16; - private boolean enableSpeakerDiarization_; - /** - *
-   * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
-   * Note: Use diarization_config instead.
-   * 
- * - * bool enable_speaker_diarization = 16 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378 - * @return The enableSpeakerDiarization. - */ - @java.lang.Override - @java.lang.Deprecated public boolean getEnableSpeakerDiarization() { - return enableSpeakerDiarization_; - } - - public static final int DIARIZATION_SPEAKER_COUNT_FIELD_NUMBER = 17; - private int diarizationSpeakerCount_; - /** - *
-   * If set, specifies the estimated number of speakers in the conversation.
-   * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
-   * Note: Use diarization_config instead.
-   * 
- * - * int32 diarization_speaker_count = 17 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383 - * @return The diarizationSpeakerCount. - */ - @java.lang.Override - @java.lang.Deprecated public int getDiarizationSpeakerCount() { - return diarizationSpeakerCount_; - } - - public static final int DIARIZATION_CONFIG_FIELD_NUMBER = 19; - private com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarizationConfig_; - /** - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - * @return Whether the diarizationConfig field is set. - */ - @java.lang.Override - public boolean hasDiarizationConfig() { - return diarizationConfig_ != null; - } - /** - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - * @return The diarizationConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDiarizationConfig() { - return diarizationConfig_ == null ? com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance() : diarizationConfig_; - } - /** - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder() { - return getDiarizationConfig(); - } - - public static final int METADATA_FIELD_NUMBER = 9; - private com.google.cloud.speech.v1p1beta1.RecognitionMetadata metadata_; - /** - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - * @return Whether the metadata field is set. - */ - @java.lang.Override - public boolean hasMetadata() { - return metadata_ != null; - } - /** - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - * @return The metadata. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata getMetadata() { - return metadata_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance() : metadata_; - } - /** - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder getMetadataOrBuilder() { - return getMetadata(); - } - - public static final int MODEL_FIELD_NUMBER = 13; - private volatile java.lang.Object model_; - /** - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_long</code></td>
-   *     <td>Best for long form content like media or conversation.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_short</code></td>
-   *     <td>Best for short form content like commands or single shot directed
-   *     speech.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_conversation</code></td>
-   *     <td>Best for audio that originated from a conversation between a
-   *         medical provider and patient.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_dictation</code></td>
-   *     <td>Best for audio that originated from dictation notes by a medical
-   *         provider.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * @return The model. - */ - @java.lang.Override - public java.lang.String getModel() { - java.lang.Object ref = model_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - model_ = s; - return s; - } - } - /** - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_long</code></td>
-   *     <td>Best for long form content like media or conversation.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_short</code></td>
-   *     <td>Best for short form content like commands or single shot directed
-   *     speech.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_conversation</code></td>
-   *     <td>Best for audio that originated from a conversation between a
-   *         medical provider and patient.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_dictation</code></td>
-   *     <td>Best for audio that originated from dictation notes by a medical
-   *         provider.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * @return The bytes for model. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getModelBytes() { - java.lang.Object ref = model_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - model_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int USE_ENHANCED_FIELD_NUMBER = 14; - private boolean useEnhanced_; - /** - *
-   * Set to true to use an enhanced model for speech recognition.
-   * If `use_enhanced` is set to true and the `model` field is not set, then
-   * an appropriate enhanced model is chosen if an enhanced model exists for
-   * the audio.
-   * If `use_enhanced` is true and an enhanced version of the specified model
-   * does not exist, then the speech is recognized using the standard version
-   * of the specified model.
-   * 
- * - * bool use_enhanced = 14; - * @return The useEnhanced. - */ - @java.lang.Override - public boolean getUseEnhanced() { - return useEnhanced_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (encoding_ != com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED.getNumber()) { - output.writeEnum(1, encoding_); - } - if (sampleRateHertz_ != 0) { - output.writeInt32(2, sampleRateHertz_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); - } - if (maxAlternatives_ != 0) { - output.writeInt32(4, maxAlternatives_); - } - if (profanityFilter_ != false) { - output.writeBool(5, profanityFilter_); - } - for (int i = 0; i < speechContexts_.size(); i++) { - output.writeMessage(6, speechContexts_.get(i)); - } - if (audioChannelCount_ != 0) { - output.writeInt32(7, audioChannelCount_); - } - if (enableWordTimeOffsets_ != false) { - output.writeBool(8, enableWordTimeOffsets_); - } - if (metadata_ != null) { - output.writeMessage(9, getMetadata()); - } - if (enableAutomaticPunctuation_ != false) { - output.writeBool(11, enableAutomaticPunctuation_); - } - if (enableSeparateRecognitionPerChannel_ != false) { - output.writeBool(12, enableSeparateRecognitionPerChannel_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 13, model_); - } - if (useEnhanced_ != false) { - output.writeBool(14, useEnhanced_); - } - if (enableWordConfidence_ != false) { - output.writeBool(15, enableWordConfidence_); - } - if (enableSpeakerDiarization_ != false) { - output.writeBool(16, enableSpeakerDiarization_); - } - if (diarizationSpeakerCount_ != 0) { - output.writeInt32(17, diarizationSpeakerCount_); - } - for (int i = 0; i < alternativeLanguageCodes_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 18, alternativeLanguageCodes_.getRaw(i)); - } - if (diarizationConfig_ != null) { - output.writeMessage(19, getDiarizationConfig()); - } - if (adaptation_ != null) { - output.writeMessage(20, getAdaptation()); - } - if (enableSpokenPunctuation_ != null) { - output.writeMessage(22, getEnableSpokenPunctuation()); - } - if (enableSpokenEmojis_ != null) { - output.writeMessage(23, getEnableSpokenEmojis()); - } - if (transcriptNormalization_ != null) { - output.writeMessage(24, getTranscriptNormalization()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (encoding_ != com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.ENCODING_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, encoding_); - } - if (sampleRateHertz_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, sampleRateHertz_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); - } - if (maxAlternatives_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, maxAlternatives_); - } - if (profanityFilter_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(5, profanityFilter_); - } - for (int i = 0; i < speechContexts_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, speechContexts_.get(i)); - } - if (audioChannelCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(7, audioChannelCount_); - } - if (enableWordTimeOffsets_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(8, enableWordTimeOffsets_); - } - if (metadata_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, getMetadata()); - } - if (enableAutomaticPunctuation_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(11, enableAutomaticPunctuation_); - } - if (enableSeparateRecognitionPerChannel_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(12, enableSeparateRecognitionPerChannel_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, model_); - } - if (useEnhanced_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(14, useEnhanced_); - } - if (enableWordConfidence_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(15, enableWordConfidence_); - } - if (enableSpeakerDiarization_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(16, enableSpeakerDiarization_); - } - if (diarizationSpeakerCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(17, diarizationSpeakerCount_); - } - { - int dataSize = 0; - for (int i = 0; i < alternativeLanguageCodes_.size(); i++) { - dataSize += computeStringSizeNoTag(alternativeLanguageCodes_.getRaw(i)); - } - size += dataSize; - size += 2 * getAlternativeLanguageCodesList().size(); - } - if (diarizationConfig_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(19, getDiarizationConfig()); - } - if (adaptation_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(20, getAdaptation()); - } - if (enableSpokenPunctuation_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(22, getEnableSpokenPunctuation()); - } - if (enableSpokenEmojis_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(23, getEnableSpokenEmojis()); - } - if (transcriptNormalization_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(24, getTranscriptNormalization()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.RecognitionConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.RecognitionConfig other = (com.google.cloud.speech.v1p1beta1.RecognitionConfig) obj; - - if (encoding_ != other.encoding_) return false; - if (getSampleRateHertz() - != other.getSampleRateHertz()) return false; - if (getAudioChannelCount() - != other.getAudioChannelCount()) return false; - if (getEnableSeparateRecognitionPerChannel() - != other.getEnableSeparateRecognitionPerChannel()) return false; - if (!getLanguageCode() - .equals(other.getLanguageCode())) return false; - if (!getAlternativeLanguageCodesList() - .equals(other.getAlternativeLanguageCodesList())) return false; - if (getMaxAlternatives() - != other.getMaxAlternatives()) return false; - if (getProfanityFilter() - != other.getProfanityFilter()) return false; - if (hasAdaptation() != other.hasAdaptation()) return false; - if (hasAdaptation()) { - if (!getAdaptation() - .equals(other.getAdaptation())) return false; - } - if (hasTranscriptNormalization() != other.hasTranscriptNormalization()) return false; - if (hasTranscriptNormalization()) { - if (!getTranscriptNormalization() - .equals(other.getTranscriptNormalization())) return false; - } - if (!getSpeechContextsList() - .equals(other.getSpeechContextsList())) return false; - if (getEnableWordTimeOffsets() - != other.getEnableWordTimeOffsets()) return false; - if (getEnableWordConfidence() - != other.getEnableWordConfidence()) return false; - if (getEnableAutomaticPunctuation() - != other.getEnableAutomaticPunctuation()) return false; - if (hasEnableSpokenPunctuation() != other.hasEnableSpokenPunctuation()) return false; - if (hasEnableSpokenPunctuation()) { - if (!getEnableSpokenPunctuation() - .equals(other.getEnableSpokenPunctuation())) return false; - } - if (hasEnableSpokenEmojis() != other.hasEnableSpokenEmojis()) return false; - if (hasEnableSpokenEmojis()) { - if (!getEnableSpokenEmojis() - .equals(other.getEnableSpokenEmojis())) return false; - } - if (getEnableSpeakerDiarization() - != other.getEnableSpeakerDiarization()) return false; - if (getDiarizationSpeakerCount() - != other.getDiarizationSpeakerCount()) return false; - if (hasDiarizationConfig() != other.hasDiarizationConfig()) return false; - if (hasDiarizationConfig()) { - if (!getDiarizationConfig() - .equals(other.getDiarizationConfig())) return false; - } - if (hasMetadata() != other.hasMetadata()) return false; - if (hasMetadata()) { - if (!getMetadata() - .equals(other.getMetadata())) return false; - } - if (!getModel() - .equals(other.getModel())) return false; - if (getUseEnhanced() - != other.getUseEnhanced()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENCODING_FIELD_NUMBER; - hash = (53 * hash) + encoding_; - hash = (37 * hash) + SAMPLE_RATE_HERTZ_FIELD_NUMBER; - hash = (53 * hash) + getSampleRateHertz(); - hash = (37 * hash) + AUDIO_CHANNEL_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getAudioChannelCount(); - hash = (37 * hash) + ENABLE_SEPARATE_RECOGNITION_PER_CHANNEL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableSeparateRecognitionPerChannel()); - hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getLanguageCode().hashCode(); - if (getAlternativeLanguageCodesCount() > 0) { - hash = (37 * hash) + ALTERNATIVE_LANGUAGE_CODES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativeLanguageCodesList().hashCode(); - } - hash = (37 * hash) + MAX_ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getMaxAlternatives(); - hash = (37 * hash) + PROFANITY_FILTER_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getProfanityFilter()); - if (hasAdaptation()) { - hash = (37 * hash) + ADAPTATION_FIELD_NUMBER; - hash = (53 * hash) + getAdaptation().hashCode(); - } - if (hasTranscriptNormalization()) { - hash = (37 * hash) + TRANSCRIPT_NORMALIZATION_FIELD_NUMBER; - hash = (53 * hash) + getTranscriptNormalization().hashCode(); - } - if (getSpeechContextsCount() > 0) { - hash = (37 * hash) + SPEECH_CONTEXTS_FIELD_NUMBER; - hash = (53 * hash) + getSpeechContextsList().hashCode(); - } - hash = (37 * hash) + ENABLE_WORD_TIME_OFFSETS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableWordTimeOffsets()); - hash = (37 * hash) + ENABLE_WORD_CONFIDENCE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableWordConfidence()); - hash = (37 * hash) + ENABLE_AUTOMATIC_PUNCTUATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableAutomaticPunctuation()); - if (hasEnableSpokenPunctuation()) { - hash = (37 * hash) + ENABLE_SPOKEN_PUNCTUATION_FIELD_NUMBER; - hash = (53 * hash) + getEnableSpokenPunctuation().hashCode(); - } - if (hasEnableSpokenEmojis()) { - hash = (37 * hash) + ENABLE_SPOKEN_EMOJIS_FIELD_NUMBER; - hash = (53 * hash) + getEnableSpokenEmojis().hashCode(); - } - hash = (37 * hash) + ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableSpeakerDiarization()); - hash = (37 * hash) + DIARIZATION_SPEAKER_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getDiarizationSpeakerCount(); - if (hasDiarizationConfig()) { - hash = (37 * hash) + DIARIZATION_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getDiarizationConfig().hashCode(); - } - if (hasMetadata()) { - hash = (37 * hash) + METADATA_FIELD_NUMBER; - hash = (53 * hash) + getMetadata().hashCode(); - } - hash = (37 * hash) + MODEL_FIELD_NUMBER; - hash = (53 * hash) + getModel().hashCode(); - hash = (37 * hash) + USE_ENHANCED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getUseEnhanced()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.RecognitionConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognitionConfig) - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.class, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.RecognitionConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getSpeechContextsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - encoding_ = 0; - - sampleRateHertz_ = 0; - - audioChannelCount_ = 0; - - enableSeparateRecognitionPerChannel_ = false; - - languageCode_ = ""; - - alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - maxAlternatives_ = 0; - - profanityFilter_ = false; - - if (adaptationBuilder_ == null) { - adaptation_ = null; - } else { - adaptation_ = null; - adaptationBuilder_ = null; - } - if (transcriptNormalizationBuilder_ == null) { - transcriptNormalization_ = null; - } else { - transcriptNormalization_ = null; - transcriptNormalizationBuilder_ = null; - } - if (speechContextsBuilder_ == null) { - speechContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - } else { - speechContextsBuilder_.clear(); - } - enableWordTimeOffsets_ = false; - - enableWordConfidence_ = false; - - enableAutomaticPunctuation_ = false; - - if (enableSpokenPunctuationBuilder_ == null) { - enableSpokenPunctuation_ = null; - } else { - enableSpokenPunctuation_ = null; - enableSpokenPunctuationBuilder_ = null; - } - if (enableSpokenEmojisBuilder_ == null) { - enableSpokenEmojis_ = null; - } else { - enableSpokenEmojis_ = null; - enableSpokenEmojisBuilder_ = null; - } - enableSpeakerDiarization_ = false; - - diarizationSpeakerCount_ = 0; - - if (diarizationConfigBuilder_ == null) { - diarizationConfig_ = null; - } else { - diarizationConfig_ = null; - diarizationConfigBuilder_ = null; - } - if (metadataBuilder_ == null) { - metadata_ = null; - } else { - metadata_ = null; - metadataBuilder_ = null; - } - model_ = ""; - - useEnhanced_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig build() { - com.google.cloud.speech.v1p1beta1.RecognitionConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig buildPartial() { - com.google.cloud.speech.v1p1beta1.RecognitionConfig result = new com.google.cloud.speech.v1p1beta1.RecognitionConfig(this); - int from_bitField0_ = bitField0_; - result.encoding_ = encoding_; - result.sampleRateHertz_ = sampleRateHertz_; - result.audioChannelCount_ = audioChannelCount_; - result.enableSeparateRecognitionPerChannel_ = enableSeparateRecognitionPerChannel_; - result.languageCode_ = languageCode_; - if (((bitField0_ & 0x00000001) != 0)) { - alternativeLanguageCodes_ = alternativeLanguageCodes_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternativeLanguageCodes_ = alternativeLanguageCodes_; - result.maxAlternatives_ = maxAlternatives_; - result.profanityFilter_ = profanityFilter_; - if (adaptationBuilder_ == null) { - result.adaptation_ = adaptation_; - } else { - result.adaptation_ = adaptationBuilder_.build(); - } - if (transcriptNormalizationBuilder_ == null) { - result.transcriptNormalization_ = transcriptNormalization_; - } else { - result.transcriptNormalization_ = transcriptNormalizationBuilder_.build(); - } - if (speechContextsBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { - speechContexts_ = java.util.Collections.unmodifiableList(speechContexts_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.speechContexts_ = speechContexts_; - } else { - result.speechContexts_ = speechContextsBuilder_.build(); - } - result.enableWordTimeOffsets_ = enableWordTimeOffsets_; - result.enableWordConfidence_ = enableWordConfidence_; - result.enableAutomaticPunctuation_ = enableAutomaticPunctuation_; - if (enableSpokenPunctuationBuilder_ == null) { - result.enableSpokenPunctuation_ = enableSpokenPunctuation_; - } else { - result.enableSpokenPunctuation_ = enableSpokenPunctuationBuilder_.build(); - } - if (enableSpokenEmojisBuilder_ == null) { - result.enableSpokenEmojis_ = enableSpokenEmojis_; - } else { - result.enableSpokenEmojis_ = enableSpokenEmojisBuilder_.build(); - } - result.enableSpeakerDiarization_ = enableSpeakerDiarization_; - result.diarizationSpeakerCount_ = diarizationSpeakerCount_; - if (diarizationConfigBuilder_ == null) { - result.diarizationConfig_ = diarizationConfig_; - } else { - result.diarizationConfig_ = diarizationConfigBuilder_.build(); - } - if (metadataBuilder_ == null) { - result.metadata_ = metadata_; - } else { - result.metadata_ = metadataBuilder_.build(); - } - result.model_ = model_; - result.useEnhanced_ = useEnhanced_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.RecognitionConfig) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognitionConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognitionConfig other) { - if (other == com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance()) return this; - if (other.encoding_ != 0) { - setEncodingValue(other.getEncodingValue()); - } - if (other.getSampleRateHertz() != 0) { - setSampleRateHertz(other.getSampleRateHertz()); - } - if (other.getAudioChannelCount() != 0) { - setAudioChannelCount(other.getAudioChannelCount()); - } - if (other.getEnableSeparateRecognitionPerChannel() != false) { - setEnableSeparateRecognitionPerChannel(other.getEnableSeparateRecognitionPerChannel()); - } - if (!other.getLanguageCode().isEmpty()) { - languageCode_ = other.languageCode_; - onChanged(); - } - if (!other.alternativeLanguageCodes_.isEmpty()) { - if (alternativeLanguageCodes_.isEmpty()) { - alternativeLanguageCodes_ = other.alternativeLanguageCodes_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativeLanguageCodesIsMutable(); - alternativeLanguageCodes_.addAll(other.alternativeLanguageCodes_); - } - onChanged(); - } - if (other.getMaxAlternatives() != 0) { - setMaxAlternatives(other.getMaxAlternatives()); - } - if (other.getProfanityFilter() != false) { - setProfanityFilter(other.getProfanityFilter()); - } - if (other.hasAdaptation()) { - mergeAdaptation(other.getAdaptation()); - } - if (other.hasTranscriptNormalization()) { - mergeTranscriptNormalization(other.getTranscriptNormalization()); - } - if (speechContextsBuilder_ == null) { - if (!other.speechContexts_.isEmpty()) { - if (speechContexts_.isEmpty()) { - speechContexts_ = other.speechContexts_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureSpeechContextsIsMutable(); - speechContexts_.addAll(other.speechContexts_); - } - onChanged(); - } - } else { - if (!other.speechContexts_.isEmpty()) { - if (speechContextsBuilder_.isEmpty()) { - speechContextsBuilder_.dispose(); - speechContextsBuilder_ = null; - speechContexts_ = other.speechContexts_; - bitField0_ = (bitField0_ & ~0x00000002); - speechContextsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getSpeechContextsFieldBuilder() : null; - } else { - speechContextsBuilder_.addAllMessages(other.speechContexts_); - } - } - } - if (other.getEnableWordTimeOffsets() != false) { - setEnableWordTimeOffsets(other.getEnableWordTimeOffsets()); - } - if (other.getEnableWordConfidence() != false) { - setEnableWordConfidence(other.getEnableWordConfidence()); - } - if (other.getEnableAutomaticPunctuation() != false) { - setEnableAutomaticPunctuation(other.getEnableAutomaticPunctuation()); - } - if (other.hasEnableSpokenPunctuation()) { - mergeEnableSpokenPunctuation(other.getEnableSpokenPunctuation()); - } - if (other.hasEnableSpokenEmojis()) { - mergeEnableSpokenEmojis(other.getEnableSpokenEmojis()); - } - if (other.getEnableSpeakerDiarization() != false) { - setEnableSpeakerDiarization(other.getEnableSpeakerDiarization()); - } - if (other.getDiarizationSpeakerCount() != 0) { - setDiarizationSpeakerCount(other.getDiarizationSpeakerCount()); - } - if (other.hasDiarizationConfig()) { - mergeDiarizationConfig(other.getDiarizationConfig()); - } - if (other.hasMetadata()) { - mergeMetadata(other.getMetadata()); - } - if (!other.getModel().isEmpty()) { - model_ = other.model_; - onChanged(); - } - if (other.getUseEnhanced() != false) { - setUseEnhanced(other.getUseEnhanced()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.RecognitionConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.RecognitionConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private int encoding_ = 0; - /** - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * @return The enum numeric value on the wire for encoding. - */ - @java.lang.Override public int getEncodingValue() { - return encoding_; - } - /** - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * @param value The enum numeric value on the wire for encoding to set. - * @return This builder for chaining. - */ - public Builder setEncodingValue(int value) { - - encoding_ = value; - onChanged(); - return this; - } - /** - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * @return The encoding. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding getEncoding() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding result = com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.valueOf(encoding_); - return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding.UNRECOGNIZED : result; - } - /** - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * @param value The encoding to set. - * @return This builder for chaining. - */ - public Builder setEncoding(com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding value) { - if (value == null) { - throw new NullPointerException(); - } - - encoding_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-     * Encoding of audio data sent in all `RecognitionAudio` messages.
-     * This field is optional for `FLAC` and `WAV` audio files and required
-     * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * @return This builder for chaining. - */ - public Builder clearEncoding() { - - encoding_ = 0; - onChanged(); - return this; - } - - private int sampleRateHertz_ ; - /** - *
-     * Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * This field is optional for FLAC and WAV audio files, but is
-     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * int32 sample_rate_hertz = 2; - * @return The sampleRateHertz. - */ - @java.lang.Override - public int getSampleRateHertz() { - return sampleRateHertz_; - } - /** - *
-     * Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * This field is optional for FLAC and WAV audio files, but is
-     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * int32 sample_rate_hertz = 2; - * @param value The sampleRateHertz to set. - * @return This builder for chaining. - */ - public Builder setSampleRateHertz(int value) { - - sampleRateHertz_ = value; - onChanged(); - return this; - } - /** - *
-     * Sample rate in Hertz of the audio data sent in all
-     * `RecognitionAudio` messages. Valid values are: 8000-48000.
-     * 16000 is optimal. For best results, set the sampling rate of the audio
-     * source to 16000 Hz. If that's not possible, use the native sample rate of
-     * the audio source (instead of re-sampling).
-     * This field is optional for FLAC and WAV audio files, but is
-     * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-     * 
- * - * int32 sample_rate_hertz = 2; - * @return This builder for chaining. - */ - public Builder clearSampleRateHertz() { - - sampleRateHertz_ = 0; - onChanged(); - return this; - } - - private int audioChannelCount_ ; - /** - *
-     * The number of channels in the input audio data.
-     * ONLY set this for MULTI-CHANNEL recognition.
-     * Valid values for LINEAR16 and FLAC are `1`-`8`.
-     * Valid values for OGG_OPUS are '1'-'254'.
-     * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
-     * If `0` or omitted, defaults to one channel (mono).
-     * Note: We only recognize the first channel by default.
-     * To perform independent recognition on each channel set
-     * `enable_separate_recognition_per_channel` to 'true'.
-     * 
- * - * int32 audio_channel_count = 7; - * @return The audioChannelCount. - */ - @java.lang.Override - public int getAudioChannelCount() { - return audioChannelCount_; - } - /** - *
-     * The number of channels in the input audio data.
-     * ONLY set this for MULTI-CHANNEL recognition.
-     * Valid values for LINEAR16 and FLAC are `1`-`8`.
-     * Valid values for OGG_OPUS are '1'-'254'.
-     * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
-     * If `0` or omitted, defaults to one channel (mono).
-     * Note: We only recognize the first channel by default.
-     * To perform independent recognition on each channel set
-     * `enable_separate_recognition_per_channel` to 'true'.
-     * 
- * - * int32 audio_channel_count = 7; - * @param value The audioChannelCount to set. - * @return This builder for chaining. - */ - public Builder setAudioChannelCount(int value) { - - audioChannelCount_ = value; - onChanged(); - return this; - } - /** - *
-     * The number of channels in the input audio data.
-     * ONLY set this for MULTI-CHANNEL recognition.
-     * Valid values for LINEAR16 and FLAC are `1`-`8`.
-     * Valid values for OGG_OPUS are '1'-'254'.
-     * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
-     * If `0` or omitted, defaults to one channel (mono).
-     * Note: We only recognize the first channel by default.
-     * To perform independent recognition on each channel set
-     * `enable_separate_recognition_per_channel` to 'true'.
-     * 
- * - * int32 audio_channel_count = 7; - * @return This builder for chaining. - */ - public Builder clearAudioChannelCount() { - - audioChannelCount_ = 0; - onChanged(); - return this; - } - - private boolean enableSeparateRecognitionPerChannel_ ; - /** - *
-     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-     * to get each channel recognized separately. The recognition result will
-     * contain a `channel_tag` field to state which channel that result belongs
-     * to. If this is not true, we will only recognize the first channel. The
-     * request is billed cumulatively for all channels recognized:
-     * `audio_channel_count` multiplied by the length of the audio.
-     * 
- * - * bool enable_separate_recognition_per_channel = 12; - * @return The enableSeparateRecognitionPerChannel. - */ - @java.lang.Override - public boolean getEnableSeparateRecognitionPerChannel() { - return enableSeparateRecognitionPerChannel_; - } - /** - *
-     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-     * to get each channel recognized separately. The recognition result will
-     * contain a `channel_tag` field to state which channel that result belongs
-     * to. If this is not true, we will only recognize the first channel. The
-     * request is billed cumulatively for all channels recognized:
-     * `audio_channel_count` multiplied by the length of the audio.
-     * 
- * - * bool enable_separate_recognition_per_channel = 12; - * @param value The enableSeparateRecognitionPerChannel to set. - * @return This builder for chaining. - */ - public Builder setEnableSeparateRecognitionPerChannel(boolean value) { - - enableSeparateRecognitionPerChannel_ = value; - onChanged(); - return this; - } - /** - *
-     * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-     * to get each channel recognized separately. The recognition result will
-     * contain a `channel_tag` field to state which channel that result belongs
-     * to. If this is not true, we will only recognize the first channel. The
-     * request is billed cumulatively for all channels recognized:
-     * `audio_channel_count` multiplied by the length of the audio.
-     * 
- * - * bool enable_separate_recognition_per_channel = 12; - * @return This builder for chaining. - */ - public Builder clearEnableSeparateRecognitionPerChannel() { - - enableSeparateRecognitionPerChannel_ = false; - onChanged(); - return this; - } - - private java.lang.Object languageCode_ = ""; - /** - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The languageCode. - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for languageCode. - */ - public com.google.protobuf.ByteString - getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param value The languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCode( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - languageCode_ = value; - onChanged(); - return this; - } - /** - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return This builder for chaining. - */ - public Builder clearLanguageCode() { - - languageCode_ = getDefaultInstance().getLanguageCode(); - onChanged(); - return this; - } - /** - *
-     * Required. The language of the supplied audio as a
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-     * Example: "en-US".
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes.
-     * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param value The bytes for languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCodeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - languageCode_ = value; - onChanged(); - return this; - } - - private com.google.protobuf.LazyStringList alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensureAlternativeLanguageCodesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - alternativeLanguageCodes_ = new com.google.protobuf.LazyStringArrayList(alternativeLanguageCodes_); - bitField0_ |= 0x00000001; - } - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @return A list containing the alternativeLanguageCodes. - */ - public com.google.protobuf.ProtocolStringList - getAlternativeLanguageCodesList() { - return alternativeLanguageCodes_.getUnmodifiableView(); - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @return The count of alternativeLanguageCodes. - */ - public int getAlternativeLanguageCodesCount() { - return alternativeLanguageCodes_.size(); - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index of the element to return. - * @return The alternativeLanguageCodes at the given index. - */ - public java.lang.String getAlternativeLanguageCodes(int index) { - return alternativeLanguageCodes_.get(index); - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index of the value to return. - * @return The bytes of the alternativeLanguageCodes at the given index. - */ - public com.google.protobuf.ByteString - getAlternativeLanguageCodesBytes(int index) { - return alternativeLanguageCodes_.getByteString(index); - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index to set the value at. - * @param value The alternativeLanguageCodes to set. - * @return This builder for chaining. - */ - public Builder setAlternativeLanguageCodes( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativeLanguageCodesIsMutable(); - alternativeLanguageCodes_.set(index, value); - onChanged(); - return this; - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @param value The alternativeLanguageCodes to add. - * @return This builder for chaining. - */ - public Builder addAlternativeLanguageCodes( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativeLanguageCodesIsMutable(); - alternativeLanguageCodes_.add(value); - onChanged(); - return this; - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @param values The alternativeLanguageCodes to add. - * @return This builder for chaining. - */ - public Builder addAllAlternativeLanguageCodes( - java.lang.Iterable values) { - ensureAlternativeLanguageCodesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, alternativeLanguageCodes_); - onChanged(); - return this; - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @return This builder for chaining. - */ - public Builder clearAlternativeLanguageCodes() { - alternativeLanguageCodes_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
-     * A list of up to 3 additional
-     * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-     * listing possible alternative languages of the supplied audio.
-     * See [Language
-     * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-     * of the currently supported language codes. If alternative languages are
-     * listed, recognition result will contain recognition in the most likely
-     * language detected including the main language_code. The recognition result
-     * will include the language tag of the language detected in the audio. Note:
-     * This feature is only supported for Voice Command and Voice Search use cases
-     * and performance may vary for other use cases (e.g., phone call
-     * transcription).
-     * 
- * - * repeated string alternative_language_codes = 18; - * @param value The bytes of the alternativeLanguageCodes to add. - * @return This builder for chaining. - */ - public Builder addAlternativeLanguageCodesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureAlternativeLanguageCodesIsMutable(); - alternativeLanguageCodes_.add(value); - onChanged(); - return this; - } - - private int maxAlternatives_ ; - /** - *
-     * Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - * @return The maxAlternatives. - */ - @java.lang.Override - public int getMaxAlternatives() { - return maxAlternatives_; - } - /** - *
-     * Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - * @param value The maxAlternatives to set. - * @return This builder for chaining. - */ - public Builder setMaxAlternatives(int value) { - - maxAlternatives_ = value; - onChanged(); - return this; - } - /** - *
-     * Maximum number of recognition hypotheses to be returned.
-     * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-     * within each `SpeechRecognitionResult`.
-     * The server may return fewer than `max_alternatives`.
-     * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-     * one. If omitted, will return a maximum of one.
-     * 
- * - * int32 max_alternatives = 4; - * @return This builder for chaining. - */ - public Builder clearMaxAlternatives() { - - maxAlternatives_ = 0; - onChanged(); - return this; - } - - private boolean profanityFilter_ ; - /** - *
-     * If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - * @return The profanityFilter. - */ - @java.lang.Override - public boolean getProfanityFilter() { - return profanityFilter_; - } - /** - *
-     * If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - * @param value The profanityFilter to set. - * @return This builder for chaining. - */ - public Builder setProfanityFilter(boolean value) { - - profanityFilter_ = value; - onChanged(); - return this; - } - /** - *
-     * If set to `true`, the server will attempt to filter out
-     * profanities, replacing all but the initial character in each filtered word
-     * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-     * won't be filtered out.
-     * 
- * - * bool profanity_filter = 5; - * @return This builder for chaining. - */ - public Builder clearProfanityFilter() { - - profanityFilter_ = false; - onChanged(); - return this; - } - - private com.google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechAdaptation, com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder, com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder> adaptationBuilder_; - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - * @return Whether the adaptation field is set. - */ - public boolean hasAdaptation() { - return adaptationBuilder_ != null || adaptation_ != null; - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - * @return The adaptation. - */ - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation getAdaptation() { - if (adaptationBuilder_ == null) { - return adaptation_ == null ? com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance() : adaptation_; - } else { - return adaptationBuilder_.getMessage(); - } - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - public Builder setAdaptation(com.google.cloud.speech.v1p1beta1.SpeechAdaptation value) { - if (adaptationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - adaptation_ = value; - onChanged(); - } else { - adaptationBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - public Builder setAdaptation( - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder builderForValue) { - if (adaptationBuilder_ == null) { - adaptation_ = builderForValue.build(); - onChanged(); - } else { - adaptationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - public Builder mergeAdaptation(com.google.cloud.speech.v1p1beta1.SpeechAdaptation value) { - if (adaptationBuilder_ == null) { - if (adaptation_ != null) { - adaptation_ = - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.newBuilder(adaptation_).mergeFrom(value).buildPartial(); - } else { - adaptation_ = value; - } - onChanged(); - } else { - adaptationBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - public Builder clearAdaptation() { - if (adaptationBuilder_ == null) { - adaptation_ = null; - onChanged(); - } else { - adaptation_ = null; - adaptationBuilder_ = null; - } - - return this; - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder getAdaptationBuilder() { - - onChanged(); - return getAdaptationFieldBuilder().getBuilder(); - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - public com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder getAdaptationOrBuilder() { - if (adaptationBuilder_ != null) { - return adaptationBuilder_.getMessageOrBuilder(); - } else { - return adaptation_ == null ? - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance() : adaptation_; - } - } - /** - *
-     * Speech adaptation configuration improves the accuracy of speech
-     * recognition. For more information, see the [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-     * documentation.
-     * When speech adaptation is set it supersedes the `speech_contexts` field.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechAdaptation, com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder, com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder> - getAdaptationFieldBuilder() { - if (adaptationBuilder_ == null) { - adaptationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechAdaptation, com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder, com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder>( - getAdaptation(), - getParentForChildren(), - isClean()); - adaptation_ = null; - } - return adaptationBuilder_; - } - - private com.google.cloud.speech.v1p1beta1.TranscriptNormalization transcriptNormalization_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptNormalization, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder, com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder> transcriptNormalizationBuilder_; - /** - *
-     * Use transcription normalization to automatically replace parts of the
-     * transcript with phrases of your choosing. For StreamingRecognize, this
-     * normalization only applies to stable partial transcripts (stability > 0.8)
-     * and final transcripts.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - * @return Whether the transcriptNormalization field is set. - */ - public boolean hasTranscriptNormalization() { - return transcriptNormalizationBuilder_ != null || transcriptNormalization_ != null; - } - /** - *
-     * Use transcription normalization to automatically replace parts of the
-     * transcript with phrases of your choosing. For StreamingRecognize, this
-     * normalization only applies to stable partial transcripts (stability > 0.8)
-     * and final transcripts.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - * @return The transcriptNormalization. - */ - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization getTranscriptNormalization() { - if (transcriptNormalizationBuilder_ == null) { - return transcriptNormalization_ == null ? com.google.cloud.speech.v1p1beta1.TranscriptNormalization.getDefaultInstance() : transcriptNormalization_; - } else { - return transcriptNormalizationBuilder_.getMessage(); - } - } - /** - *
-     * Use transcription normalization to automatically replace parts of the
-     * transcript with phrases of your choosing. For StreamingRecognize, this
-     * normalization only applies to stable partial transcripts (stability > 0.8)
-     * and final transcripts.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - */ - public Builder setTranscriptNormalization(com.google.cloud.speech.v1p1beta1.TranscriptNormalization value) { - if (transcriptNormalizationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - transcriptNormalization_ = value; - onChanged(); - } else { - transcriptNormalizationBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Use transcription normalization to automatically replace parts of the
-     * transcript with phrases of your choosing. For StreamingRecognize, this
-     * normalization only applies to stable partial transcripts (stability > 0.8)
-     * and final transcripts.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - */ - public Builder setTranscriptNormalization( - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder builderForValue) { - if (transcriptNormalizationBuilder_ == null) { - transcriptNormalization_ = builderForValue.build(); - onChanged(); - } else { - transcriptNormalizationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Use transcription normalization to automatically replace parts of the
-     * transcript with phrases of your choosing. For StreamingRecognize, this
-     * normalization only applies to stable partial transcripts (stability > 0.8)
-     * and final transcripts.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - */ - public Builder mergeTranscriptNormalization(com.google.cloud.speech.v1p1beta1.TranscriptNormalization value) { - if (transcriptNormalizationBuilder_ == null) { - if (transcriptNormalization_ != null) { - transcriptNormalization_ = - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.newBuilder(transcriptNormalization_).mergeFrom(value).buildPartial(); - } else { - transcriptNormalization_ = value; - } - onChanged(); - } else { - transcriptNormalizationBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Use transcription normalization to automatically replace parts of the
-     * transcript with phrases of your choosing. For StreamingRecognize, this
-     * normalization only applies to stable partial transcripts (stability > 0.8)
-     * and final transcripts.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - */ - public Builder clearTranscriptNormalization() { - if (transcriptNormalizationBuilder_ == null) { - transcriptNormalization_ = null; - onChanged(); - } else { - transcriptNormalization_ = null; - transcriptNormalizationBuilder_ = null; - } - - return this; - } - /** - *
-     * Use transcription normalization to automatically replace parts of the
-     * transcript with phrases of your choosing. For StreamingRecognize, this
-     * normalization only applies to stable partial transcripts (stability > 0.8)
-     * and final transcripts.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder getTranscriptNormalizationBuilder() { - - onChanged(); - return getTranscriptNormalizationFieldBuilder().getBuilder(); - } - /** - *
-     * Use transcription normalization to automatically replace parts of the
-     * transcript with phrases of your choosing. For StreamingRecognize, this
-     * normalization only applies to stable partial transcripts (stability > 0.8)
-     * and final transcripts.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder getTranscriptNormalizationOrBuilder() { - if (transcriptNormalizationBuilder_ != null) { - return transcriptNormalizationBuilder_.getMessageOrBuilder(); - } else { - return transcriptNormalization_ == null ? - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.getDefaultInstance() : transcriptNormalization_; - } - } - /** - *
-     * Use transcription normalization to automatically replace parts of the
-     * transcript with phrases of your choosing. For StreamingRecognize, this
-     * normalization only applies to stable partial transcripts (stability > 0.8)
-     * and final transcripts.
-     * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptNormalization, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder, com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder> - getTranscriptNormalizationFieldBuilder() { - if (transcriptNormalizationBuilder_ == null) { - transcriptNormalizationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptNormalization, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder, com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder>( - getTranscriptNormalization(), - getParentForChildren(), - isClean()); - transcriptNormalization_ = null; - } - return transcriptNormalizationBuilder_; - } - - private java.util.List speechContexts_ = - java.util.Collections.emptyList(); - private void ensureSpeechContextsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - speechContexts_ = new java.util.ArrayList(speechContexts_); - bitField0_ |= 0x00000002; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechContext, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder, com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder> speechContextsBuilder_; - - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public java.util.List getSpeechContextsList() { - if (speechContextsBuilder_ == null) { - return java.util.Collections.unmodifiableList(speechContexts_); - } else { - return speechContextsBuilder_.getMessageList(); - } - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public int getSpeechContextsCount() { - if (speechContextsBuilder_ == null) { - return speechContexts_.size(); - } else { - return speechContextsBuilder_.getCount(); - } - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1p1beta1.SpeechContext getSpeechContexts(int index) { - if (speechContextsBuilder_ == null) { - return speechContexts_.get(index); - } else { - return speechContextsBuilder_.getMessage(index); - } - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder setSpeechContexts( - int index, com.google.cloud.speech.v1p1beta1.SpeechContext value) { - if (speechContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpeechContextsIsMutable(); - speechContexts_.set(index, value); - onChanged(); - } else { - speechContextsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder setSpeechContexts( - int index, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder builderForValue) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.set(index, builderForValue.build()); - onChanged(); - } else { - speechContextsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts(com.google.cloud.speech.v1p1beta1.SpeechContext value) { - if (speechContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpeechContextsIsMutable(); - speechContexts_.add(value); - onChanged(); - } else { - speechContextsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts( - int index, com.google.cloud.speech.v1p1beta1.SpeechContext value) { - if (speechContextsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSpeechContextsIsMutable(); - speechContexts_.add(index, value); - onChanged(); - } else { - speechContextsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts( - com.google.cloud.speech.v1p1beta1.SpeechContext.Builder builderForValue) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.add(builderForValue.build()); - onChanged(); - } else { - speechContextsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder addSpeechContexts( - int index, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder builderForValue) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.add(index, builderForValue.build()); - onChanged(); - } else { - speechContextsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder addAllSpeechContexts( - java.lang.Iterable values) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, speechContexts_); - onChanged(); - } else { - speechContextsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder clearSpeechContexts() { - if (speechContextsBuilder_ == null) { - speechContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - } else { - speechContextsBuilder_.clear(); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public Builder removeSpeechContexts(int index) { - if (speechContextsBuilder_ == null) { - ensureSpeechContextsIsMutable(); - speechContexts_.remove(index); - onChanged(); - } else { - speechContextsBuilder_.remove(index); - } - return this; - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1p1beta1.SpeechContext.Builder getSpeechContextsBuilder( - int index) { - return getSpeechContextsFieldBuilder().getBuilder(index); - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder getSpeechContextsOrBuilder( - int index) { - if (speechContextsBuilder_ == null) { - return speechContexts_.get(index); } else { - return speechContextsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public java.util.List - getSpeechContextsOrBuilderList() { - if (speechContextsBuilder_ != null) { - return speechContextsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(speechContexts_); - } - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1p1beta1.SpeechContext.Builder addSpeechContextsBuilder() { - return getSpeechContextsFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.SpeechContext.getDefaultInstance()); - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public com.google.cloud.speech.v1p1beta1.SpeechContext.Builder addSpeechContextsBuilder( - int index) { - return getSpeechContextsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.SpeechContext.getDefaultInstance()); - } - /** - *
-     * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-     * A means to provide context to assist the speech recognition. For more
-     * information, see
-     * [speech
-     * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - public java.util.List - getSpeechContextsBuilderList() { - return getSpeechContextsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechContext, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder, com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder> - getSpeechContextsFieldBuilder() { - if (speechContextsBuilder_ == null) { - speechContextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechContext, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder, com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder>( - speechContexts_, - ((bitField0_ & 0x00000002) != 0), - getParentForChildren(), - isClean()); - speechContexts_ = null; - } - return speechContextsBuilder_; - } - - private boolean enableWordTimeOffsets_ ; - /** - *
-     * If `true`, the top result includes a list of words and
-     * the start and end time offsets (timestamps) for those words. If
-     * `false`, no word-level time offset information is returned. The default is
-     * `false`.
-     * 
- * - * bool enable_word_time_offsets = 8; - * @return The enableWordTimeOffsets. - */ - @java.lang.Override - public boolean getEnableWordTimeOffsets() { - return enableWordTimeOffsets_; - } - /** - *
-     * If `true`, the top result includes a list of words and
-     * the start and end time offsets (timestamps) for those words. If
-     * `false`, no word-level time offset information is returned. The default is
-     * `false`.
-     * 
- * - * bool enable_word_time_offsets = 8; - * @param value The enableWordTimeOffsets to set. - * @return This builder for chaining. - */ - public Builder setEnableWordTimeOffsets(boolean value) { - - enableWordTimeOffsets_ = value; - onChanged(); - return this; - } - /** - *
-     * If `true`, the top result includes a list of words and
-     * the start and end time offsets (timestamps) for those words. If
-     * `false`, no word-level time offset information is returned. The default is
-     * `false`.
-     * 
- * - * bool enable_word_time_offsets = 8; - * @return This builder for chaining. - */ - public Builder clearEnableWordTimeOffsets() { - - enableWordTimeOffsets_ = false; - onChanged(); - return this; - } - - private boolean enableWordConfidence_ ; - /** - *
-     * If `true`, the top result includes a list of words and the
-     * confidence for those words. If `false`, no word-level confidence
-     * information is returned. The default is `false`.
-     * 
- * - * bool enable_word_confidence = 15; - * @return The enableWordConfidence. - */ - @java.lang.Override - public boolean getEnableWordConfidence() { - return enableWordConfidence_; - } - /** - *
-     * If `true`, the top result includes a list of words and the
-     * confidence for those words. If `false`, no word-level confidence
-     * information is returned. The default is `false`.
-     * 
- * - * bool enable_word_confidence = 15; - * @param value The enableWordConfidence to set. - * @return This builder for chaining. - */ - public Builder setEnableWordConfidence(boolean value) { - - enableWordConfidence_ = value; - onChanged(); - return this; - } - /** - *
-     * If `true`, the top result includes a list of words and the
-     * confidence for those words. If `false`, no word-level confidence
-     * information is returned. The default is `false`.
-     * 
- * - * bool enable_word_confidence = 15; - * @return This builder for chaining. - */ - public Builder clearEnableWordConfidence() { - - enableWordConfidence_ = false; - onChanged(); - return this; - } - - private boolean enableAutomaticPunctuation_ ; - /** - *
-     * If 'true', adds punctuation to recognition result hypotheses.
-     * This feature is only available in select languages. Setting this for
-     * requests in other languages has no effect at all.
-     * The default 'false' value does not add punctuation to result hypotheses.
-     * 
- * - * bool enable_automatic_punctuation = 11; - * @return The enableAutomaticPunctuation. - */ - @java.lang.Override - public boolean getEnableAutomaticPunctuation() { - return enableAutomaticPunctuation_; - } - /** - *
-     * If 'true', adds punctuation to recognition result hypotheses.
-     * This feature is only available in select languages. Setting this for
-     * requests in other languages has no effect at all.
-     * The default 'false' value does not add punctuation to result hypotheses.
-     * 
- * - * bool enable_automatic_punctuation = 11; - * @param value The enableAutomaticPunctuation to set. - * @return This builder for chaining. - */ - public Builder setEnableAutomaticPunctuation(boolean value) { - - enableAutomaticPunctuation_ = value; - onChanged(); - return this; - } - /** - *
-     * If 'true', adds punctuation to recognition result hypotheses.
-     * This feature is only available in select languages. Setting this for
-     * requests in other languages has no effect at all.
-     * The default 'false' value does not add punctuation to result hypotheses.
-     * 
- * - * bool enable_automatic_punctuation = 11; - * @return This builder for chaining. - */ - public Builder clearEnableAutomaticPunctuation() { - - enableAutomaticPunctuation_ = false; - onChanged(); - return this; - } - - private com.google.protobuf.BoolValue enableSpokenPunctuation_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> enableSpokenPunctuationBuilder_; - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - * @return Whether the enableSpokenPunctuation field is set. - */ - public boolean hasEnableSpokenPunctuation() { - return enableSpokenPunctuationBuilder_ != null || enableSpokenPunctuation_ != null; - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - * @return The enableSpokenPunctuation. - */ - public com.google.protobuf.BoolValue getEnableSpokenPunctuation() { - if (enableSpokenPunctuationBuilder_ == null) { - return enableSpokenPunctuation_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenPunctuation_; - } else { - return enableSpokenPunctuationBuilder_.getMessage(); - } - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - public Builder setEnableSpokenPunctuation(com.google.protobuf.BoolValue value) { - if (enableSpokenPunctuationBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - enableSpokenPunctuation_ = value; - onChanged(); - } else { - enableSpokenPunctuationBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - public Builder setEnableSpokenPunctuation( - com.google.protobuf.BoolValue.Builder builderForValue) { - if (enableSpokenPunctuationBuilder_ == null) { - enableSpokenPunctuation_ = builderForValue.build(); - onChanged(); - } else { - enableSpokenPunctuationBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - public Builder mergeEnableSpokenPunctuation(com.google.protobuf.BoolValue value) { - if (enableSpokenPunctuationBuilder_ == null) { - if (enableSpokenPunctuation_ != null) { - enableSpokenPunctuation_ = - com.google.protobuf.BoolValue.newBuilder(enableSpokenPunctuation_).mergeFrom(value).buildPartial(); - } else { - enableSpokenPunctuation_ = value; - } - onChanged(); - } else { - enableSpokenPunctuationBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - public Builder clearEnableSpokenPunctuation() { - if (enableSpokenPunctuationBuilder_ == null) { - enableSpokenPunctuation_ = null; - onChanged(); - } else { - enableSpokenPunctuation_ = null; - enableSpokenPunctuationBuilder_ = null; - } - - return this; - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - public com.google.protobuf.BoolValue.Builder getEnableSpokenPunctuationBuilder() { - - onChanged(); - return getEnableSpokenPunctuationFieldBuilder().getBuilder(); - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - public com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilder() { - if (enableSpokenPunctuationBuilder_ != null) { - return enableSpokenPunctuationBuilder_.getMessageOrBuilder(); - } else { - return enableSpokenPunctuation_ == null ? - com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenPunctuation_; - } - } - /** - *
-     * The spoken punctuation behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * e.g. command_and_search will enable spoken punctuation by default
-     * If 'true', replaces spoken punctuation with the corresponding symbols in
-     * the request. For example, "how are you question mark" becomes "how are
-     * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-     * for support. If 'false', spoken punctuation is not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> - getEnableSpokenPunctuationFieldBuilder() { - if (enableSpokenPunctuationBuilder_ == null) { - enableSpokenPunctuationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder>( - getEnableSpokenPunctuation(), - getParentForChildren(), - isClean()); - enableSpokenPunctuation_ = null; - } - return enableSpokenPunctuationBuilder_; - } - - private com.google.protobuf.BoolValue enableSpokenEmojis_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> enableSpokenEmojisBuilder_; - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - * @return Whether the enableSpokenEmojis field is set. - */ - public boolean hasEnableSpokenEmojis() { - return enableSpokenEmojisBuilder_ != null || enableSpokenEmojis_ != null; - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - * @return The enableSpokenEmojis. - */ - public com.google.protobuf.BoolValue getEnableSpokenEmojis() { - if (enableSpokenEmojisBuilder_ == null) { - return enableSpokenEmojis_ == null ? com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenEmojis_; - } else { - return enableSpokenEmojisBuilder_.getMessage(); - } - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - public Builder setEnableSpokenEmojis(com.google.protobuf.BoolValue value) { - if (enableSpokenEmojisBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - enableSpokenEmojis_ = value; - onChanged(); - } else { - enableSpokenEmojisBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - public Builder setEnableSpokenEmojis( - com.google.protobuf.BoolValue.Builder builderForValue) { - if (enableSpokenEmojisBuilder_ == null) { - enableSpokenEmojis_ = builderForValue.build(); - onChanged(); - } else { - enableSpokenEmojisBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - public Builder mergeEnableSpokenEmojis(com.google.protobuf.BoolValue value) { - if (enableSpokenEmojisBuilder_ == null) { - if (enableSpokenEmojis_ != null) { - enableSpokenEmojis_ = - com.google.protobuf.BoolValue.newBuilder(enableSpokenEmojis_).mergeFrom(value).buildPartial(); - } else { - enableSpokenEmojis_ = value; - } - onChanged(); - } else { - enableSpokenEmojisBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - public Builder clearEnableSpokenEmojis() { - if (enableSpokenEmojisBuilder_ == null) { - enableSpokenEmojis_ = null; - onChanged(); - } else { - enableSpokenEmojis_ = null; - enableSpokenEmojisBuilder_ = null; - } - - return this; - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - public com.google.protobuf.BoolValue.Builder getEnableSpokenEmojisBuilder() { - - onChanged(); - return getEnableSpokenEmojisFieldBuilder().getBuilder(); - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - public com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder() { - if (enableSpokenEmojisBuilder_ != null) { - return enableSpokenEmojisBuilder_.getMessageOrBuilder(); - } else { - return enableSpokenEmojis_ == null ? - com.google.protobuf.BoolValue.getDefaultInstance() : enableSpokenEmojis_; - } - } - /** - *
-     * The spoken emoji behavior for the call
-     * If not set, uses default behavior based on model of choice
-     * If 'true', adds spoken emoji formatting for the request. This will replace
-     * spoken emojis with the corresponding Unicode symbols in the final
-     * transcript. If 'false', spoken emojis are not replaced.
-     * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder> - getEnableSpokenEmojisFieldBuilder() { - if (enableSpokenEmojisBuilder_ == null) { - enableSpokenEmojisBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.BoolValue, com.google.protobuf.BoolValue.Builder, com.google.protobuf.BoolValueOrBuilder>( - getEnableSpokenEmojis(), - getParentForChildren(), - isClean()); - enableSpokenEmojis_ = null; - } - return enableSpokenEmojisBuilder_; - } - - private boolean enableSpeakerDiarization_ ; - /** - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * Note: Use diarization_config instead.
-     * 
- * - * bool enable_speaker_diarization = 16 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378 - * @return The enableSpeakerDiarization. - */ - @java.lang.Override - @java.lang.Deprecated public boolean getEnableSpeakerDiarization() { - return enableSpeakerDiarization_; - } - /** - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * Note: Use diarization_config instead.
-     * 
- * - * bool enable_speaker_diarization = 16 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378 - * @param value The enableSpeakerDiarization to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated public Builder setEnableSpeakerDiarization(boolean value) { - - enableSpeakerDiarization_ = value; - onChanged(); - return this; - } - /** - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * Note: Use diarization_config instead.
-     * 
- * - * bool enable_speaker_diarization = 16 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378 - * @return This builder for chaining. - */ - @java.lang.Deprecated public Builder clearEnableSpeakerDiarization() { - - enableSpeakerDiarization_ = false; - onChanged(); - return this; - } - - private int diarizationSpeakerCount_ ; - /** - *
-     * If set, specifies the estimated number of speakers in the conversation.
-     * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
-     * Note: Use diarization_config instead.
-     * 
- * - * int32 diarization_speaker_count = 17 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383 - * @return The diarizationSpeakerCount. - */ - @java.lang.Override - @java.lang.Deprecated public int getDiarizationSpeakerCount() { - return diarizationSpeakerCount_; - } - /** - *
-     * If set, specifies the estimated number of speakers in the conversation.
-     * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
-     * Note: Use diarization_config instead.
-     * 
- * - * int32 diarization_speaker_count = 17 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383 - * @param value The diarizationSpeakerCount to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated public Builder setDiarizationSpeakerCount(int value) { - - diarizationSpeakerCount_ = value; - onChanged(); - return this; - } - /** - *
-     * If set, specifies the estimated number of speakers in the conversation.
-     * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
-     * Note: Use diarization_config instead.
-     * 
- * - * int32 diarization_speaker_count = 17 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383 - * @return This builder for chaining. - */ - @java.lang.Deprecated public Builder clearDiarizationSpeakerCount() { - - diarizationSpeakerCount_ = 0; - onChanged(); - return this; - } - - private com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarizationConfig_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder> diarizationConfigBuilder_; - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - * @return Whether the diarizationConfig field is set. - */ - public boolean hasDiarizationConfig() { - return diarizationConfigBuilder_ != null || diarizationConfig_ != null; - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - * @return The diarizationConfig. - */ - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDiarizationConfig() { - if (diarizationConfigBuilder_ == null) { - return diarizationConfig_ == null ? com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance() : diarizationConfig_; - } else { - return diarizationConfigBuilder_.getMessage(); - } - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder setDiarizationConfig(com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig value) { - if (diarizationConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - diarizationConfig_ = value; - onChanged(); - } else { - diarizationConfigBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder setDiarizationConfig( - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder builderForValue) { - if (diarizationConfigBuilder_ == null) { - diarizationConfig_ = builderForValue.build(); - onChanged(); - } else { - diarizationConfigBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder mergeDiarizationConfig(com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig value) { - if (diarizationConfigBuilder_ == null) { - if (diarizationConfig_ != null) { - diarizationConfig_ = - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.newBuilder(diarizationConfig_).mergeFrom(value).buildPartial(); - } else { - diarizationConfig_ = value; - } - onChanged(); - } else { - diarizationConfigBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - public Builder clearDiarizationConfig() { - if (diarizationConfigBuilder_ == null) { - diarizationConfig_ = null; - onChanged(); - } else { - diarizationConfig_ = null; - diarizationConfigBuilder_ = null; - } - - return this; - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder getDiarizationConfigBuilder() { - - onChanged(); - return getDiarizationConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder() { - if (diarizationConfigBuilder_ != null) { - return diarizationConfigBuilder_.getMessageOrBuilder(); - } else { - return diarizationConfig_ == null ? - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance() : diarizationConfig_; - } - } - /** - *
-     * Config to enable speaker diarization and set additional
-     * parameters to make diarization better suited for your application.
-     * Note: When this is enabled, we send all the words from the beginning of the
-     * audio for the top alternative in every consecutive STREAMING responses.
-     * This is done in order to improve our speaker tags as our models learn to
-     * identify the speakers in the conversation over time.
-     * For non-streaming requests, the diarization results will be provided only
-     * in the top alternative of the FINAL SpeechRecognitionResult.
-     * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder> - getDiarizationConfigFieldBuilder() { - if (diarizationConfigBuilder_ == null) { - diarizationConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder>( - getDiarizationConfig(), - getParentForChildren(), - isClean()); - diarizationConfig_ = null; - } - return diarizationConfigBuilder_; - } - - private com.google.cloud.speech.v1p1beta1.RecognitionMetadata metadata_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionMetadata, com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder, com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder> metadataBuilder_; - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - * @return Whether the metadata field is set. - */ - public boolean hasMetadata() { - return metadataBuilder_ != null || metadata_ != null; - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - * @return The metadata. - */ - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata getMetadata() { - if (metadataBuilder_ == null) { - return metadata_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance() : metadata_; - } else { - return metadataBuilder_.getMessage(); - } - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - public Builder setMetadata(com.google.cloud.speech.v1p1beta1.RecognitionMetadata value) { - if (metadataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - metadata_ = value; - onChanged(); - } else { - metadataBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - public Builder setMetadata( - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder builderForValue) { - if (metadataBuilder_ == null) { - metadata_ = builderForValue.build(); - onChanged(); - } else { - metadataBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - public Builder mergeMetadata(com.google.cloud.speech.v1p1beta1.RecognitionMetadata value) { - if (metadataBuilder_ == null) { - if (metadata_ != null) { - metadata_ = - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.newBuilder(metadata_).mergeFrom(value).buildPartial(); - } else { - metadata_ = value; - } - onChanged(); - } else { - metadataBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - public Builder clearMetadata() { - if (metadataBuilder_ == null) { - metadata_ = null; - onChanged(); - } else { - metadata_ = null; - metadataBuilder_ = null; - } - - return this; - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder getMetadataBuilder() { - - onChanged(); - return getMetadataFieldBuilder().getBuilder(); - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder getMetadataOrBuilder() { - if (metadataBuilder_ != null) { - return metadataBuilder_.getMessageOrBuilder(); - } else { - return metadata_ == null ? - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance() : metadata_; - } - } - /** - *
-     * Metadata regarding this request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionMetadata, com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder, com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder> - getMetadataFieldBuilder() { - if (metadataBuilder_ == null) { - metadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionMetadata, com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder, com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder>( - getMetadata(), - getParentForChildren(), - isClean()); - metadata_ = null; - } - return metadataBuilder_; - } - - private java.lang.Object model_ = ""; - /** - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_long</code></td>
-     *     <td>Best for long form content like media or conversation.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_short</code></td>
-     *     <td>Best for short form content like commands or single shot directed
-     *     speech.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_conversation</code></td>
-     *     <td>Best for audio that originated from a conversation between a
-     *         medical provider and patient.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_dictation</code></td>
-     *     <td>Best for audio that originated from dictation notes by a medical
-     *         provider.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * @return The model. - */ - public java.lang.String getModel() { - java.lang.Object ref = model_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - model_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_long</code></td>
-     *     <td>Best for long form content like media or conversation.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_short</code></td>
-     *     <td>Best for short form content like commands or single shot directed
-     *     speech.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_conversation</code></td>
-     *     <td>Best for audio that originated from a conversation between a
-     *         medical provider and patient.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_dictation</code></td>
-     *     <td>Best for audio that originated from dictation notes by a medical
-     *         provider.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * @return The bytes for model. - */ - public com.google.protobuf.ByteString - getModelBytes() { - java.lang.Object ref = model_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - model_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_long</code></td>
-     *     <td>Best for long form content like media or conversation.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_short</code></td>
-     *     <td>Best for short form content like commands or single shot directed
-     *     speech.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_conversation</code></td>
-     *     <td>Best for audio that originated from a conversation between a
-     *         medical provider and patient.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_dictation</code></td>
-     *     <td>Best for audio that originated from dictation notes by a medical
-     *         provider.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * @param value The model to set. - * @return This builder for chaining. - */ - public Builder setModel( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - model_ = value; - onChanged(); - return this; - } - /** - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_long</code></td>
-     *     <td>Best for long form content like media or conversation.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_short</code></td>
-     *     <td>Best for short form content like commands or single shot directed
-     *     speech.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_conversation</code></td>
-     *     <td>Best for audio that originated from a conversation between a
-     *         medical provider and patient.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_dictation</code></td>
-     *     <td>Best for audio that originated from dictation notes by a medical
-     *         provider.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * @return This builder for chaining. - */ - public Builder clearModel() { - - model_ = getDefaultInstance().getModel(); - onChanged(); - return this; - } - /** - *
-     * Which model to select for the given request. Select the model
-     * best suited to your domain to get best results. If a model is not
-     * explicitly specified, then we auto-select a model based on the parameters
-     * in the RecognitionConfig.
-     * <table>
-     *   <tr>
-     *     <td><b>Model</b></td>
-     *     <td><b>Description</b></td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_long</code></td>
-     *     <td>Best for long form content like media or conversation.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>latest_short</code></td>
-     *     <td>Best for short form content like commands or single shot directed
-     *     speech.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>command_and_search</code></td>
-     *     <td>Best for short queries such as voice commands or voice search.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>phone_call</code></td>
-     *     <td>Best for audio that originated from a phone call (typically
-     *     recorded at an 8khz sampling rate).</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>video</code></td>
-     *     <td>Best for audio that originated from video or includes multiple
-     *         speakers. Ideally the audio is recorded at a 16khz or greater
-     *         sampling rate. This is a premium model that costs more than the
-     *         standard rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>default</code></td>
-     *     <td>Best for audio that is not one of the specific audio models.
-     *         For example, long-form audio. Ideally the audio is high-fidelity,
-     *         recorded at a 16khz or greater sampling rate.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_conversation</code></td>
-     *     <td>Best for audio that originated from a conversation between a
-     *         medical provider and patient.</td>
-     *   </tr>
-     *   <tr>
-     *     <td><code>medical_dictation</code></td>
-     *     <td>Best for audio that originated from dictation notes by a medical
-     *         provider.</td>
-     *   </tr>
-     * </table>
-     * 
- * - * string model = 13; - * @param value The bytes for model to set. - * @return This builder for chaining. - */ - public Builder setModelBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - model_ = value; - onChanged(); - return this; - } - - private boolean useEnhanced_ ; - /** - *
-     * Set to true to use an enhanced model for speech recognition.
-     * If `use_enhanced` is set to true and the `model` field is not set, then
-     * an appropriate enhanced model is chosen if an enhanced model exists for
-     * the audio.
-     * If `use_enhanced` is true and an enhanced version of the specified model
-     * does not exist, then the speech is recognized using the standard version
-     * of the specified model.
-     * 
- * - * bool use_enhanced = 14; - * @return The useEnhanced. - */ - @java.lang.Override - public boolean getUseEnhanced() { - return useEnhanced_; - } - /** - *
-     * Set to true to use an enhanced model for speech recognition.
-     * If `use_enhanced` is set to true and the `model` field is not set, then
-     * an appropriate enhanced model is chosen if an enhanced model exists for
-     * the audio.
-     * If `use_enhanced` is true and an enhanced version of the specified model
-     * does not exist, then the speech is recognized using the standard version
-     * of the specified model.
-     * 
- * - * bool use_enhanced = 14; - * @param value The useEnhanced to set. - * @return This builder for chaining. - */ - public Builder setUseEnhanced(boolean value) { - - useEnhanced_ = value; - onChanged(); - return this; - } - /** - *
-     * Set to true to use an enhanced model for speech recognition.
-     * If `use_enhanced` is set to true and the `model` field is not set, then
-     * an appropriate enhanced model is chosen if an enhanced model exists for
-     * the audio.
-     * If `use_enhanced` is true and an enhanced version of the specified model
-     * does not exist, then the speech is recognized using the standard version
-     * of the specified model.
-     * 
- * - * bool use_enhanced = 14; - * @return This builder for chaining. - */ - public Builder clearUseEnhanced() { - - useEnhanced_ = false; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.RecognitionConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognitionConfig) - private static final com.google.cloud.speech.v1p1beta1.RecognitionConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognitionConfig(); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognitionConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java deleted file mode 100644 index dfc41e54d6fe..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionConfigOrBuilder.java +++ /dev/null @@ -1,725 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface RecognitionConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognitionConfig) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * @return The enum numeric value on the wire for encoding. - */ - int getEncodingValue(); - /** - *
-   * Encoding of audio data sent in all `RecognitionAudio` messages.
-   * This field is optional for `FLAC` and `WAV` audio files and required
-   * for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding encoding = 1; - * @return The encoding. - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding getEncoding(); - - /** - *
-   * Sample rate in Hertz of the audio data sent in all
-   * `RecognitionAudio` messages. Valid values are: 8000-48000.
-   * 16000 is optimal. For best results, set the sampling rate of the audio
-   * source to 16000 Hz. If that's not possible, use the native sample rate of
-   * the audio source (instead of re-sampling).
-   * This field is optional for FLAC and WAV audio files, but is
-   * required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding].
-   * 
- * - * int32 sample_rate_hertz = 2; - * @return The sampleRateHertz. - */ - int getSampleRateHertz(); - - /** - *
-   * The number of channels in the input audio data.
-   * ONLY set this for MULTI-CHANNEL recognition.
-   * Valid values for LINEAR16 and FLAC are `1`-`8`.
-   * Valid values for OGG_OPUS are '1'-'254'.
-   * Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
-   * If `0` or omitted, defaults to one channel (mono).
-   * Note: We only recognize the first channel by default.
-   * To perform independent recognition on each channel set
-   * `enable_separate_recognition_per_channel` to 'true'.
-   * 
- * - * int32 audio_channel_count = 7; - * @return The audioChannelCount. - */ - int getAudioChannelCount(); - - /** - *
-   * This needs to be set to `true` explicitly and `audio_channel_count` > 1
-   * to get each channel recognized separately. The recognition result will
-   * contain a `channel_tag` field to state which channel that result belongs
-   * to. If this is not true, we will only recognize the first channel. The
-   * request is billed cumulatively for all channels recognized:
-   * `audio_channel_count` multiplied by the length of the audio.
-   * 
- * - * bool enable_separate_recognition_per_channel = 12; - * @return The enableSeparateRecognitionPerChannel. - */ - boolean getEnableSeparateRecognitionPerChannel(); - - /** - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The languageCode. - */ - java.lang.String getLanguageCode(); - /** - *
-   * Required. The language of the supplied audio as a
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
-   * Example: "en-US".
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes.
-   * 
- * - * string language_code = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return The bytes for languageCode. - */ - com.google.protobuf.ByteString - getLanguageCodeBytes(); - - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @return A list containing the alternativeLanguageCodes. - */ - java.util.List - getAlternativeLanguageCodesList(); - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @return The count of alternativeLanguageCodes. - */ - int getAlternativeLanguageCodesCount(); - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index of the element to return. - * @return The alternativeLanguageCodes at the given index. - */ - java.lang.String getAlternativeLanguageCodes(int index); - /** - *
-   * A list of up to 3 additional
-   * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
-   * listing possible alternative languages of the supplied audio.
-   * See [Language
-   * Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
-   * of the currently supported language codes. If alternative languages are
-   * listed, recognition result will contain recognition in the most likely
-   * language detected including the main language_code. The recognition result
-   * will include the language tag of the language detected in the audio. Note:
-   * This feature is only supported for Voice Command and Voice Search use cases
-   * and performance may vary for other use cases (e.g., phone call
-   * transcription).
-   * 
- * - * repeated string alternative_language_codes = 18; - * @param index The index of the value to return. - * @return The bytes of the alternativeLanguageCodes at the given index. - */ - com.google.protobuf.ByteString - getAlternativeLanguageCodesBytes(int index); - - /** - *
-   * Maximum number of recognition hypotheses to be returned.
-   * Specifically, the maximum number of `SpeechRecognitionAlternative` messages
-   * within each `SpeechRecognitionResult`.
-   * The server may return fewer than `max_alternatives`.
-   * Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
-   * one. If omitted, will return a maximum of one.
-   * 
- * - * int32 max_alternatives = 4; - * @return The maxAlternatives. - */ - int getMaxAlternatives(); - - /** - *
-   * If set to `true`, the server will attempt to filter out
-   * profanities, replacing all but the initial character in each filtered word
-   * with asterisks, e.g. "f***". If set to `false` or omitted, profanities
-   * won't be filtered out.
-   * 
- * - * bool profanity_filter = 5; - * @return The profanityFilter. - */ - boolean getProfanityFilter(); - - /** - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-   * documentation.
-   * When speech adaptation is set it supersedes the `speech_contexts` field.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - * @return Whether the adaptation field is set. - */ - boolean hasAdaptation(); - /** - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-   * documentation.
-   * When speech adaptation is set it supersedes the `speech_contexts` field.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - * @return The adaptation. - */ - com.google.cloud.speech.v1p1beta1.SpeechAdaptation getAdaptation(); - /** - *
-   * Speech adaptation configuration improves the accuracy of speech
-   * recognition. For more information, see the [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
-   * documentation.
-   * When speech adaptation is set it supersedes the `speech_contexts` field.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeechAdaptation adaptation = 20; - */ - com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder getAdaptationOrBuilder(); - - /** - *
-   * Use transcription normalization to automatically replace parts of the
-   * transcript with phrases of your choosing. For StreamingRecognize, this
-   * normalization only applies to stable partial transcripts (stability > 0.8)
-   * and final transcripts.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - * @return Whether the transcriptNormalization field is set. - */ - boolean hasTranscriptNormalization(); - /** - *
-   * Use transcription normalization to automatically replace parts of the
-   * transcript with phrases of your choosing. For StreamingRecognize, this
-   * normalization only applies to stable partial transcripts (stability > 0.8)
-   * and final transcripts.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - * @return The transcriptNormalization. - */ - com.google.cloud.speech.v1p1beta1.TranscriptNormalization getTranscriptNormalization(); - /** - *
-   * Use transcription normalization to automatically replace parts of the
-   * transcript with phrases of your choosing. For StreamingRecognize, this
-   * normalization only applies to stable partial transcripts (stability > 0.8)
-   * and final transcripts.
-   * 
- * - * .google.cloud.speech.v1p1beta1.TranscriptNormalization transcript_normalization = 24; - */ - com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder getTranscriptNormalizationOrBuilder(); - - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - java.util.List - getSpeechContextsList(); - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - com.google.cloud.speech.v1p1beta1.SpeechContext getSpeechContexts(int index); - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - int getSpeechContextsCount(); - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - java.util.List - getSpeechContextsOrBuilderList(); - /** - *
-   * Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
-   * A means to provide context to assist the speech recognition. For more
-   * information, see
-   * [speech
-   * adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechContext speech_contexts = 6; - */ - com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder getSpeechContextsOrBuilder( - int index); - - /** - *
-   * If `true`, the top result includes a list of words and
-   * the start and end time offsets (timestamps) for those words. If
-   * `false`, no word-level time offset information is returned. The default is
-   * `false`.
-   * 
- * - * bool enable_word_time_offsets = 8; - * @return The enableWordTimeOffsets. - */ - boolean getEnableWordTimeOffsets(); - - /** - *
-   * If `true`, the top result includes a list of words and the
-   * confidence for those words. If `false`, no word-level confidence
-   * information is returned. The default is `false`.
-   * 
- * - * bool enable_word_confidence = 15; - * @return The enableWordConfidence. - */ - boolean getEnableWordConfidence(); - - /** - *
-   * If 'true', adds punctuation to recognition result hypotheses.
-   * This feature is only available in select languages. Setting this for
-   * requests in other languages has no effect at all.
-   * The default 'false' value does not add punctuation to result hypotheses.
-   * 
- * - * bool enable_automatic_punctuation = 11; - * @return The enableAutomaticPunctuation. - */ - boolean getEnableAutomaticPunctuation(); - - /** - *
-   * The spoken punctuation behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * e.g. command_and_search will enable spoken punctuation by default
-   * If 'true', replaces spoken punctuation with the corresponding symbols in
-   * the request. For example, "how are you question mark" becomes "how are
-   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-   * for support. If 'false', spoken punctuation is not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - * @return Whether the enableSpokenPunctuation field is set. - */ - boolean hasEnableSpokenPunctuation(); - /** - *
-   * The spoken punctuation behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * e.g. command_and_search will enable spoken punctuation by default
-   * If 'true', replaces spoken punctuation with the corresponding symbols in
-   * the request. For example, "how are you question mark" becomes "how are
-   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-   * for support. If 'false', spoken punctuation is not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - * @return The enableSpokenPunctuation. - */ - com.google.protobuf.BoolValue getEnableSpokenPunctuation(); - /** - *
-   * The spoken punctuation behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * e.g. command_and_search will enable spoken punctuation by default
-   * If 'true', replaces spoken punctuation with the corresponding symbols in
-   * the request. For example, "how are you question mark" becomes "how are
-   * you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
-   * for support. If 'false', spoken punctuation is not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_punctuation = 22; - */ - com.google.protobuf.BoolValueOrBuilder getEnableSpokenPunctuationOrBuilder(); - - /** - *
-   * The spoken emoji behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * If 'true', adds spoken emoji formatting for the request. This will replace
-   * spoken emojis with the corresponding Unicode symbols in the final
-   * transcript. If 'false', spoken emojis are not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - * @return Whether the enableSpokenEmojis field is set. - */ - boolean hasEnableSpokenEmojis(); - /** - *
-   * The spoken emoji behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * If 'true', adds spoken emoji formatting for the request. This will replace
-   * spoken emojis with the corresponding Unicode symbols in the final
-   * transcript. If 'false', spoken emojis are not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - * @return The enableSpokenEmojis. - */ - com.google.protobuf.BoolValue getEnableSpokenEmojis(); - /** - *
-   * The spoken emoji behavior for the call
-   * If not set, uses default behavior based on model of choice
-   * If 'true', adds spoken emoji formatting for the request. This will replace
-   * spoken emojis with the corresponding Unicode symbols in the final
-   * transcript. If 'false', spoken emojis are not replaced.
-   * 
- * - * .google.protobuf.BoolValue enable_spoken_emojis = 23; - */ - com.google.protobuf.BoolValueOrBuilder getEnableSpokenEmojisOrBuilder(); - - /** - *
-   * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
-   * Note: Use diarization_config instead.
-   * 
- * - * bool enable_speaker_diarization = 16 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=378 - * @return The enableSpeakerDiarization. - */ - @java.lang.Deprecated boolean getEnableSpeakerDiarization(); - - /** - *
-   * If set, specifies the estimated number of speakers in the conversation.
-   * Defaults to '2'. Ignored unless enable_speaker_diarization is set to true.
-   * Note: Use diarization_config instead.
-   * 
- * - * int32 diarization_speaker_count = 17 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=383 - * @return The diarizationSpeakerCount. - */ - @java.lang.Deprecated int getDiarizationSpeakerCount(); - - /** - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - * @return Whether the diarizationConfig field is set. - */ - boolean hasDiarizationConfig(); - /** - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - * @return The diarizationConfig. - */ - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDiarizationConfig(); - /** - *
-   * Config to enable speaker diarization and set additional
-   * parameters to make diarization better suited for your application.
-   * Note: When this is enabled, we send all the words from the beginning of the
-   * audio for the top alternative in every consecutive STREAMING responses.
-   * This is done in order to improve our speaker tags as our models learn to
-   * identify the speakers in the conversation over time.
-   * For non-streaming requests, the diarization results will be provided only
-   * in the top alternative of the FINAL SpeechRecognitionResult.
-   * 
- * - * .google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig diarization_config = 19; - */ - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder getDiarizationConfigOrBuilder(); - - /** - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - * @return Whether the metadata field is set. - */ - boolean hasMetadata(); - /** - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - * @return The metadata. - */ - com.google.cloud.speech.v1p1beta1.RecognitionMetadata getMetadata(); - /** - *
-   * Metadata regarding this request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata metadata = 9; - */ - com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder getMetadataOrBuilder(); - - /** - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_long</code></td>
-   *     <td>Best for long form content like media or conversation.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_short</code></td>
-   *     <td>Best for short form content like commands or single shot directed
-   *     speech.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_conversation</code></td>
-   *     <td>Best for audio that originated from a conversation between a
-   *         medical provider and patient.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_dictation</code></td>
-   *     <td>Best for audio that originated from dictation notes by a medical
-   *         provider.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * @return The model. - */ - java.lang.String getModel(); - /** - *
-   * Which model to select for the given request. Select the model
-   * best suited to your domain to get best results. If a model is not
-   * explicitly specified, then we auto-select a model based on the parameters
-   * in the RecognitionConfig.
-   * <table>
-   *   <tr>
-   *     <td><b>Model</b></td>
-   *     <td><b>Description</b></td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_long</code></td>
-   *     <td>Best for long form content like media or conversation.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>latest_short</code></td>
-   *     <td>Best for short form content like commands or single shot directed
-   *     speech.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>command_and_search</code></td>
-   *     <td>Best for short queries such as voice commands or voice search.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>phone_call</code></td>
-   *     <td>Best for audio that originated from a phone call (typically
-   *     recorded at an 8khz sampling rate).</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>video</code></td>
-   *     <td>Best for audio that originated from video or includes multiple
-   *         speakers. Ideally the audio is recorded at a 16khz or greater
-   *         sampling rate. This is a premium model that costs more than the
-   *         standard rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>default</code></td>
-   *     <td>Best for audio that is not one of the specific audio models.
-   *         For example, long-form audio. Ideally the audio is high-fidelity,
-   *         recorded at a 16khz or greater sampling rate.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_conversation</code></td>
-   *     <td>Best for audio that originated from a conversation between a
-   *         medical provider and patient.</td>
-   *   </tr>
-   *   <tr>
-   *     <td><code>medical_dictation</code></td>
-   *     <td>Best for audio that originated from dictation notes by a medical
-   *         provider.</td>
-   *   </tr>
-   * </table>
-   * 
- * - * string model = 13; - * @return The bytes for model. - */ - com.google.protobuf.ByteString - getModelBytes(); - - /** - *
-   * Set to true to use an enhanced model for speech recognition.
-   * If `use_enhanced` is set to true and the `model` field is not set, then
-   * an appropriate enhanced model is chosen if an enhanced model exists for
-   * the audio.
-   * If `use_enhanced` is true and an enhanced version of the specified model
-   * does not exist, then the speech is recognized using the standard version
-   * of the specified model.
-   * 
- * - * bool use_enhanced = 14; - * @return The useEnhanced. - */ - boolean getUseEnhanced(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java deleted file mode 100644 index 4a666fd4cee5..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadata.java +++ /dev/null @@ -1,2436 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Description of audio data to be recognized.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionMetadata} - */ -@java.lang.Deprecated public final class RecognitionMetadata extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognitionMetadata) - RecognitionMetadataOrBuilder { -private static final long serialVersionUID = 0L; - // Use RecognitionMetadata.newBuilder() to construct. - private RecognitionMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RecognitionMetadata() { - interactionType_ = 0; - microphoneDistance_ = 0; - originalMediaType_ = 0; - recordingDeviceType_ = 0; - recordingDeviceName_ = ""; - originalMimeType_ = ""; - audioTopic_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RecognitionMetadata(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RecognitionMetadata( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - int rawValue = input.readEnum(); - - interactionType_ = rawValue; - break; - } - case 24: { - - industryNaicsCodeOfAudio_ = input.readUInt32(); - break; - } - case 32: { - int rawValue = input.readEnum(); - - microphoneDistance_ = rawValue; - break; - } - case 40: { - int rawValue = input.readEnum(); - - originalMediaType_ = rawValue; - break; - } - case 48: { - int rawValue = input.readEnum(); - - recordingDeviceType_ = rawValue; - break; - } - case 58: { - java.lang.String s = input.readStringRequireUtf8(); - - recordingDeviceName_ = s; - break; - } - case 66: { - java.lang.String s = input.readStringRequireUtf8(); - - originalMimeType_ = s; - break; - } - case 72: { - - obfuscatedId_ = input.readInt64(); - break; - } - case 82: { - java.lang.String s = input.readStringRequireUtf8(); - - audioTopic_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.class, com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder.class); - } - - /** - *
-   * Use case categories that the audio recognition request can be described
-   * by.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType} - */ - public enum InteractionType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * Use case is either unknown or is something other than one of the other
-     * values below.
-     * 
- * - * INTERACTION_TYPE_UNSPECIFIED = 0; - */ - INTERACTION_TYPE_UNSPECIFIED(0), - /** - *
-     * Multiple people in a conversation or discussion. For example in a
-     * meeting with two or more people actively participating. Typically
-     * all the primary people speaking would be in the same room (if not,
-     * see PHONE_CALL)
-     * 
- * - * DISCUSSION = 1; - */ - DISCUSSION(1), - /** - *
-     * One or more persons lecturing or presenting to others, mostly
-     * uninterrupted.
-     * 
- * - * PRESENTATION = 2; - */ - PRESENTATION(2), - /** - *
-     * A phone-call or video-conference in which two or more people, who are
-     * not in the same room, are actively participating.
-     * 
- * - * PHONE_CALL = 3; - */ - PHONE_CALL(3), - /** - *
-     * A recorded message intended for another person to listen to.
-     * 
- * - * VOICEMAIL = 4; - */ - VOICEMAIL(4), - /** - *
-     * Professionally produced audio (eg. TV Show, Podcast).
-     * 
- * - * PROFESSIONALLY_PRODUCED = 5; - */ - PROFESSIONALLY_PRODUCED(5), - /** - *
-     * Transcribe spoken questions and queries into text.
-     * 
- * - * VOICE_SEARCH = 6; - */ - VOICE_SEARCH(6), - /** - *
-     * Transcribe voice commands, such as for controlling a device.
-     * 
- * - * VOICE_COMMAND = 7; - */ - VOICE_COMMAND(7), - /** - *
-     * Transcribe speech to text to create a written document, such as a
-     * text-message, email or report.
-     * 
- * - * DICTATION = 8; - */ - DICTATION(8), - UNRECOGNIZED(-1), - ; - - /** - *
-     * Use case is either unknown or is something other than one of the other
-     * values below.
-     * 
- * - * INTERACTION_TYPE_UNSPECIFIED = 0; - */ - public static final int INTERACTION_TYPE_UNSPECIFIED_VALUE = 0; - /** - *
-     * Multiple people in a conversation or discussion. For example in a
-     * meeting with two or more people actively participating. Typically
-     * all the primary people speaking would be in the same room (if not,
-     * see PHONE_CALL)
-     * 
- * - * DISCUSSION = 1; - */ - public static final int DISCUSSION_VALUE = 1; - /** - *
-     * One or more persons lecturing or presenting to others, mostly
-     * uninterrupted.
-     * 
- * - * PRESENTATION = 2; - */ - public static final int PRESENTATION_VALUE = 2; - /** - *
-     * A phone-call or video-conference in which two or more people, who are
-     * not in the same room, are actively participating.
-     * 
- * - * PHONE_CALL = 3; - */ - public static final int PHONE_CALL_VALUE = 3; - /** - *
-     * A recorded message intended for another person to listen to.
-     * 
- * - * VOICEMAIL = 4; - */ - public static final int VOICEMAIL_VALUE = 4; - /** - *
-     * Professionally produced audio (eg. TV Show, Podcast).
-     * 
- * - * PROFESSIONALLY_PRODUCED = 5; - */ - public static final int PROFESSIONALLY_PRODUCED_VALUE = 5; - /** - *
-     * Transcribe spoken questions and queries into text.
-     * 
- * - * VOICE_SEARCH = 6; - */ - public static final int VOICE_SEARCH_VALUE = 6; - /** - *
-     * Transcribe voice commands, such as for controlling a device.
-     * 
- * - * VOICE_COMMAND = 7; - */ - public static final int VOICE_COMMAND_VALUE = 7; - /** - *
-     * Transcribe speech to text to create a written document, such as a
-     * text-message, email or report.
-     * 
- * - * DICTATION = 8; - */ - public static final int DICTATION_VALUE = 8; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static InteractionType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static InteractionType forNumber(int value) { - switch (value) { - case 0: return INTERACTION_TYPE_UNSPECIFIED; - case 1: return DISCUSSION; - case 2: return PRESENTATION; - case 3: return PHONE_CALL; - case 4: return VOICEMAIL; - case 5: return PROFESSIONALLY_PRODUCED; - case 6: return VOICE_SEARCH; - case 7: return VOICE_COMMAND; - case 8: return DICTATION; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - InteractionType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public InteractionType findValueByNumber(int number) { - return InteractionType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDescriptor().getEnumTypes().get(0); - } - - private static final InteractionType[] VALUES = values(); - - public static InteractionType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private InteractionType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType) - } - - /** - *
-   * Enumerates the types of capture settings describing an audio file.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance} - */ - public enum MicrophoneDistance - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * Audio type is not known.
-     * 
- * - * MICROPHONE_DISTANCE_UNSPECIFIED = 0; - */ - MICROPHONE_DISTANCE_UNSPECIFIED(0), - /** - *
-     * The audio was captured from a closely placed microphone. Eg. phone,
-     * dictaphone, or handheld microphone. Generally if there speaker is within
-     * 1 meter of the microphone.
-     * 
- * - * NEARFIELD = 1; - */ - NEARFIELD(1), - /** - *
-     * The speaker if within 3 meters of the microphone.
-     * 
- * - * MIDFIELD = 2; - */ - MIDFIELD(2), - /** - *
-     * The speaker is more than 3 meters away from the microphone.
-     * 
- * - * FARFIELD = 3; - */ - FARFIELD(3), - UNRECOGNIZED(-1), - ; - - /** - *
-     * Audio type is not known.
-     * 
- * - * MICROPHONE_DISTANCE_UNSPECIFIED = 0; - */ - public static final int MICROPHONE_DISTANCE_UNSPECIFIED_VALUE = 0; - /** - *
-     * The audio was captured from a closely placed microphone. Eg. phone,
-     * dictaphone, or handheld microphone. Generally if there speaker is within
-     * 1 meter of the microphone.
-     * 
- * - * NEARFIELD = 1; - */ - public static final int NEARFIELD_VALUE = 1; - /** - *
-     * The speaker if within 3 meters of the microphone.
-     * 
- * - * MIDFIELD = 2; - */ - public static final int MIDFIELD_VALUE = 2; - /** - *
-     * The speaker is more than 3 meters away from the microphone.
-     * 
- * - * FARFIELD = 3; - */ - public static final int FARFIELD_VALUE = 3; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static MicrophoneDistance valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static MicrophoneDistance forNumber(int value) { - switch (value) { - case 0: return MICROPHONE_DISTANCE_UNSPECIFIED; - case 1: return NEARFIELD; - case 2: return MIDFIELD; - case 3: return FARFIELD; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - MicrophoneDistance> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public MicrophoneDistance findValueByNumber(int number) { - return MicrophoneDistance.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDescriptor().getEnumTypes().get(1); - } - - private static final MicrophoneDistance[] VALUES = values(); - - public static MicrophoneDistance valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private MicrophoneDistance(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance) - } - - /** - *
-   * The original media the speech was recorded on.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType} - */ - public enum OriginalMediaType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * Unknown original media type.
-     * 
- * - * ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - */ - ORIGINAL_MEDIA_TYPE_UNSPECIFIED(0), - /** - *
-     * The speech data is an audio recording.
-     * 
- * - * AUDIO = 1; - */ - AUDIO(1), - /** - *
-     * The speech data originally recorded on a video.
-     * 
- * - * VIDEO = 2; - */ - VIDEO(2), - UNRECOGNIZED(-1), - ; - - /** - *
-     * Unknown original media type.
-     * 
- * - * ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - */ - public static final int ORIGINAL_MEDIA_TYPE_UNSPECIFIED_VALUE = 0; - /** - *
-     * The speech data is an audio recording.
-     * 
- * - * AUDIO = 1; - */ - public static final int AUDIO_VALUE = 1; - /** - *
-     * The speech data originally recorded on a video.
-     * 
- * - * VIDEO = 2; - */ - public static final int VIDEO_VALUE = 2; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OriginalMediaType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static OriginalMediaType forNumber(int value) { - switch (value) { - case 0: return ORIGINAL_MEDIA_TYPE_UNSPECIFIED; - case 1: return AUDIO; - case 2: return VIDEO; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - OriginalMediaType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public OriginalMediaType findValueByNumber(int number) { - return OriginalMediaType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDescriptor().getEnumTypes().get(2); - } - - private static final OriginalMediaType[] VALUES = values(); - - public static OriginalMediaType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private OriginalMediaType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType) - } - - /** - *
-   * The type of device the speech was recorded with.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType} - */ - public enum RecordingDeviceType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * The recording device is unknown.
-     * 
- * - * RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - */ - RECORDING_DEVICE_TYPE_UNSPECIFIED(0), - /** - *
-     * Speech was recorded on a smartphone.
-     * 
- * - * SMARTPHONE = 1; - */ - SMARTPHONE(1), - /** - *
-     * Speech was recorded using a personal computer or tablet.
-     * 
- * - * PC = 2; - */ - PC(2), - /** - *
-     * Speech was recorded over a phone line.
-     * 
- * - * PHONE_LINE = 3; - */ - PHONE_LINE(3), - /** - *
-     * Speech was recorded in a vehicle.
-     * 
- * - * VEHICLE = 4; - */ - VEHICLE(4), - /** - *
-     * Speech was recorded outdoors.
-     * 
- * - * OTHER_OUTDOOR_DEVICE = 5; - */ - OTHER_OUTDOOR_DEVICE(5), - /** - *
-     * Speech was recorded indoors.
-     * 
- * - * OTHER_INDOOR_DEVICE = 6; - */ - OTHER_INDOOR_DEVICE(6), - UNRECOGNIZED(-1), - ; - - /** - *
-     * The recording device is unknown.
-     * 
- * - * RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - */ - public static final int RECORDING_DEVICE_TYPE_UNSPECIFIED_VALUE = 0; - /** - *
-     * Speech was recorded on a smartphone.
-     * 
- * - * SMARTPHONE = 1; - */ - public static final int SMARTPHONE_VALUE = 1; - /** - *
-     * Speech was recorded using a personal computer or tablet.
-     * 
- * - * PC = 2; - */ - public static final int PC_VALUE = 2; - /** - *
-     * Speech was recorded over a phone line.
-     * 
- * - * PHONE_LINE = 3; - */ - public static final int PHONE_LINE_VALUE = 3; - /** - *
-     * Speech was recorded in a vehicle.
-     * 
- * - * VEHICLE = 4; - */ - public static final int VEHICLE_VALUE = 4; - /** - *
-     * Speech was recorded outdoors.
-     * 
- * - * OTHER_OUTDOOR_DEVICE = 5; - */ - public static final int OTHER_OUTDOOR_DEVICE_VALUE = 5; - /** - *
-     * Speech was recorded indoors.
-     * 
- * - * OTHER_INDOOR_DEVICE = 6; - */ - public static final int OTHER_INDOOR_DEVICE_VALUE = 6; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static RecordingDeviceType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static RecordingDeviceType forNumber(int value) { - switch (value) { - case 0: return RECORDING_DEVICE_TYPE_UNSPECIFIED; - case 1: return SMARTPHONE; - case 2: return PC; - case 3: return PHONE_LINE; - case 4: return VEHICLE; - case 5: return OTHER_OUTDOOR_DEVICE; - case 6: return OTHER_INDOOR_DEVICE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - RecordingDeviceType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public RecordingDeviceType findValueByNumber(int number) { - return RecordingDeviceType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDescriptor().getEnumTypes().get(3); - } - - private static final RecordingDeviceType[] VALUES = values(); - - public static RecordingDeviceType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private RecordingDeviceType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType) - } - - public static final int INTERACTION_TYPE_FIELD_NUMBER = 1; - private int interactionType_; - /** - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return The enum numeric value on the wire for interactionType. - */ - @java.lang.Override public int getInteractionTypeValue() { - return interactionType_; - } - /** - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return The interactionType. - */ - @java.lang.Override public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType getInteractionType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.valueOf(interactionType_); - return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.UNRECOGNIZED : result; - } - - public static final int INDUSTRY_NAICS_CODE_OF_AUDIO_FIELD_NUMBER = 3; - private int industryNaicsCodeOfAudio_; - /** - *
-   * The industry vertical to which this speech recognition request most
-   * closely applies. This is most indicative of the topics contained
-   * in the audio.  Use the 6-digit NAICS code to identify the industry
-   * vertical - see https://www.naics.com/search/.
-   * 
- * - * uint32 industry_naics_code_of_audio = 3; - * @return The industryNaicsCodeOfAudio. - */ - @java.lang.Override - public int getIndustryNaicsCodeOfAudio() { - return industryNaicsCodeOfAudio_; - } - - public static final int MICROPHONE_DISTANCE_FIELD_NUMBER = 4; - private int microphoneDistance_; - /** - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return The enum numeric value on the wire for microphoneDistance. - */ - @java.lang.Override public int getMicrophoneDistanceValue() { - return microphoneDistance_; - } - /** - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return The microphoneDistance. - */ - @java.lang.Override public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.valueOf(microphoneDistance_); - return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.UNRECOGNIZED : result; - } - - public static final int ORIGINAL_MEDIA_TYPE_FIELD_NUMBER = 5; - private int originalMediaType_; - /** - *
-   * The original media the speech was recorded on.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return The enum numeric value on the wire for originalMediaType. - */ - @java.lang.Override public int getOriginalMediaTypeValue() { - return originalMediaType_; - } - /** - *
-   * The original media the speech was recorded on.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return The originalMediaType. - */ - @java.lang.Override public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType getOriginalMediaType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.valueOf(originalMediaType_); - return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.UNRECOGNIZED : result; - } - - public static final int RECORDING_DEVICE_TYPE_FIELD_NUMBER = 6; - private int recordingDeviceType_; - /** - *
-   * The type of device the speech was recorded with.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return The enum numeric value on the wire for recordingDeviceType. - */ - @java.lang.Override public int getRecordingDeviceTypeValue() { - return recordingDeviceType_; - } - /** - *
-   * The type of device the speech was recorded with.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return The recordingDeviceType. - */ - @java.lang.Override public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.valueOf(recordingDeviceType_); - return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.UNRECOGNIZED : result; - } - - public static final int RECORDING_DEVICE_NAME_FIELD_NUMBER = 7; - private volatile java.lang.Object recordingDeviceName_; - /** - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * @return The recordingDeviceName. - */ - @java.lang.Override - public java.lang.String getRecordingDeviceName() { - java.lang.Object ref = recordingDeviceName_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - recordingDeviceName_ = s; - return s; - } - } - /** - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * @return The bytes for recordingDeviceName. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getRecordingDeviceNameBytes() { - java.lang.Object ref = recordingDeviceName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - recordingDeviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int ORIGINAL_MIME_TYPE_FIELD_NUMBER = 8; - private volatile java.lang.Object originalMimeType_; - /** - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * @return The originalMimeType. - */ - @java.lang.Override - public java.lang.String getOriginalMimeType() { - java.lang.Object ref = originalMimeType_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - originalMimeType_ = s; - return s; - } - } - /** - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * @return The bytes for originalMimeType. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getOriginalMimeTypeBytes() { - java.lang.Object ref = originalMimeType_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - originalMimeType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OBFUSCATED_ID_FIELD_NUMBER = 9; - private long obfuscatedId_; - /** - *
-   * Obfuscated (privacy-protected) ID of the user, to identify number of
-   * unique users using the service.
-   * 
- * - * int64 obfuscated_id = 9 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612 - * @return The obfuscatedId. - */ - @java.lang.Override - @java.lang.Deprecated public long getObfuscatedId() { - return obfuscatedId_; - } - - public static final int AUDIO_TOPIC_FIELD_NUMBER = 10; - private volatile java.lang.Object audioTopic_; - /** - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * @return The audioTopic. - */ - @java.lang.Override - public java.lang.String getAudioTopic() { - java.lang.Object ref = audioTopic_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - audioTopic_ = s; - return s; - } - } - /** - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * @return The bytes for audioTopic. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getAudioTopicBytes() { - java.lang.Object ref = audioTopic_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - audioTopic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (interactionType_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.INTERACTION_TYPE_UNSPECIFIED.getNumber()) { - output.writeEnum(1, interactionType_); - } - if (industryNaicsCodeOfAudio_ != 0) { - output.writeUInt32(3, industryNaicsCodeOfAudio_); - } - if (microphoneDistance_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.MICROPHONE_DISTANCE_UNSPECIFIED.getNumber()) { - output.writeEnum(4, microphoneDistance_); - } - if (originalMediaType_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.ORIGINAL_MEDIA_TYPE_UNSPECIFIED.getNumber()) { - output.writeEnum(5, originalMediaType_); - } - if (recordingDeviceType_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.RECORDING_DEVICE_TYPE_UNSPECIFIED.getNumber()) { - output.writeEnum(6, recordingDeviceType_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordingDeviceName_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 7, recordingDeviceName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalMimeType_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 8, originalMimeType_); - } - if (obfuscatedId_ != 0L) { - output.writeInt64(9, obfuscatedId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audioTopic_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 10, audioTopic_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (interactionType_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.INTERACTION_TYPE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, interactionType_); - } - if (industryNaicsCodeOfAudio_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(3, industryNaicsCodeOfAudio_); - } - if (microphoneDistance_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.MICROPHONE_DISTANCE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, microphoneDistance_); - } - if (originalMediaType_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.ORIGINAL_MEDIA_TYPE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(5, originalMediaType_); - } - if (recordingDeviceType_ != com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.RECORDING_DEVICE_TYPE_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(6, recordingDeviceType_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(recordingDeviceName_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, recordingDeviceName_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(originalMimeType_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, originalMimeType_); - } - if (obfuscatedId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(9, obfuscatedId_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(audioTopic_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, audioTopic_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.RecognitionMetadata)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.RecognitionMetadata other = (com.google.cloud.speech.v1p1beta1.RecognitionMetadata) obj; - - if (interactionType_ != other.interactionType_) return false; - if (getIndustryNaicsCodeOfAudio() - != other.getIndustryNaicsCodeOfAudio()) return false; - if (microphoneDistance_ != other.microphoneDistance_) return false; - if (originalMediaType_ != other.originalMediaType_) return false; - if (recordingDeviceType_ != other.recordingDeviceType_) return false; - if (!getRecordingDeviceName() - .equals(other.getRecordingDeviceName())) return false; - if (!getOriginalMimeType() - .equals(other.getOriginalMimeType())) return false; - if (getObfuscatedId() - != other.getObfuscatedId()) return false; - if (!getAudioTopic() - .equals(other.getAudioTopic())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + INTERACTION_TYPE_FIELD_NUMBER; - hash = (53 * hash) + interactionType_; - hash = (37 * hash) + INDUSTRY_NAICS_CODE_OF_AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getIndustryNaicsCodeOfAudio(); - hash = (37 * hash) + MICROPHONE_DISTANCE_FIELD_NUMBER; - hash = (53 * hash) + microphoneDistance_; - hash = (37 * hash) + ORIGINAL_MEDIA_TYPE_FIELD_NUMBER; - hash = (53 * hash) + originalMediaType_; - hash = (37 * hash) + RECORDING_DEVICE_TYPE_FIELD_NUMBER; - hash = (53 * hash) + recordingDeviceType_; - hash = (37 * hash) + RECORDING_DEVICE_NAME_FIELD_NUMBER; - hash = (53 * hash) + getRecordingDeviceName().hashCode(); - hash = (37 * hash) + ORIGINAL_MIME_TYPE_FIELD_NUMBER; - hash = (53 * hash) + getOriginalMimeType().hashCode(); - hash = (37 * hash) + OBFUSCATED_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getObfuscatedId()); - hash = (37 * hash) + AUDIO_TOPIC_FIELD_NUMBER; - hash = (53 * hash) + getAudioTopic().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.RecognitionMetadata prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Description of audio data to be recognized.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognitionMetadata} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognitionMetadata) - com.google.cloud.speech.v1p1beta1.RecognitionMetadataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.class, com.google.cloud.speech.v1p1beta1.RecognitionMetadata.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.RecognitionMetadata.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - interactionType_ = 0; - - industryNaicsCodeOfAudio_ = 0; - - microphoneDistance_ = 0; - - originalMediaType_ = 0; - - recordingDeviceType_ = 0; - - recordingDeviceName_ = ""; - - originalMimeType_ = ""; - - obfuscatedId_ = 0L; - - audioTopic_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata build() { - com.google.cloud.speech.v1p1beta1.RecognitionMetadata result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata buildPartial() { - com.google.cloud.speech.v1p1beta1.RecognitionMetadata result = new com.google.cloud.speech.v1p1beta1.RecognitionMetadata(this); - result.interactionType_ = interactionType_; - result.industryNaicsCodeOfAudio_ = industryNaicsCodeOfAudio_; - result.microphoneDistance_ = microphoneDistance_; - result.originalMediaType_ = originalMediaType_; - result.recordingDeviceType_ = recordingDeviceType_; - result.recordingDeviceName_ = recordingDeviceName_; - result.originalMimeType_ = originalMimeType_; - result.obfuscatedId_ = obfuscatedId_; - result.audioTopic_ = audioTopic_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.RecognitionMetadata) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognitionMetadata)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognitionMetadata other) { - if (other == com.google.cloud.speech.v1p1beta1.RecognitionMetadata.getDefaultInstance()) return this; - if (other.interactionType_ != 0) { - setInteractionTypeValue(other.getInteractionTypeValue()); - } - if (other.getIndustryNaicsCodeOfAudio() != 0) { - setIndustryNaicsCodeOfAudio(other.getIndustryNaicsCodeOfAudio()); - } - if (other.microphoneDistance_ != 0) { - setMicrophoneDistanceValue(other.getMicrophoneDistanceValue()); - } - if (other.originalMediaType_ != 0) { - setOriginalMediaTypeValue(other.getOriginalMediaTypeValue()); - } - if (other.recordingDeviceType_ != 0) { - setRecordingDeviceTypeValue(other.getRecordingDeviceTypeValue()); - } - if (!other.getRecordingDeviceName().isEmpty()) { - recordingDeviceName_ = other.recordingDeviceName_; - onChanged(); - } - if (!other.getOriginalMimeType().isEmpty()) { - originalMimeType_ = other.originalMimeType_; - onChanged(); - } - if (other.getObfuscatedId() != 0L) { - setObfuscatedId(other.getObfuscatedId()); - } - if (!other.getAudioTopic().isEmpty()) { - audioTopic_ = other.audioTopic_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.RecognitionMetadata parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.RecognitionMetadata) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int interactionType_ = 0; - /** - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return The enum numeric value on the wire for interactionType. - */ - @java.lang.Override public int getInteractionTypeValue() { - return interactionType_; - } - /** - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * @param value The enum numeric value on the wire for interactionType to set. - * @return This builder for chaining. - */ - public Builder setInteractionTypeValue(int value) { - - interactionType_ = value; - onChanged(); - return this; - } - /** - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return The interactionType. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType getInteractionType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.valueOf(interactionType_); - return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType.UNRECOGNIZED : result; - } - /** - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * @param value The interactionType to set. - * @return This builder for chaining. - */ - public Builder setInteractionType(com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType value) { - if (value == null) { - throw new NullPointerException(); - } - - interactionType_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-     * The use case most closely describing the audio content to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return This builder for chaining. - */ - public Builder clearInteractionType() { - - interactionType_ = 0; - onChanged(); - return this; - } - - private int industryNaicsCodeOfAudio_ ; - /** - *
-     * The industry vertical to which this speech recognition request most
-     * closely applies. This is most indicative of the topics contained
-     * in the audio.  Use the 6-digit NAICS code to identify the industry
-     * vertical - see https://www.naics.com/search/.
-     * 
- * - * uint32 industry_naics_code_of_audio = 3; - * @return The industryNaicsCodeOfAudio. - */ - @java.lang.Override - public int getIndustryNaicsCodeOfAudio() { - return industryNaicsCodeOfAudio_; - } - /** - *
-     * The industry vertical to which this speech recognition request most
-     * closely applies. This is most indicative of the topics contained
-     * in the audio.  Use the 6-digit NAICS code to identify the industry
-     * vertical - see https://www.naics.com/search/.
-     * 
- * - * uint32 industry_naics_code_of_audio = 3; - * @param value The industryNaicsCodeOfAudio to set. - * @return This builder for chaining. - */ - public Builder setIndustryNaicsCodeOfAudio(int value) { - - industryNaicsCodeOfAudio_ = value; - onChanged(); - return this; - } - /** - *
-     * The industry vertical to which this speech recognition request most
-     * closely applies. This is most indicative of the topics contained
-     * in the audio.  Use the 6-digit NAICS code to identify the industry
-     * vertical - see https://www.naics.com/search/.
-     * 
- * - * uint32 industry_naics_code_of_audio = 3; - * @return This builder for chaining. - */ - public Builder clearIndustryNaicsCodeOfAudio() { - - industryNaicsCodeOfAudio_ = 0; - onChanged(); - return this; - } - - private int microphoneDistance_ = 0; - /** - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return The enum numeric value on the wire for microphoneDistance. - */ - @java.lang.Override public int getMicrophoneDistanceValue() { - return microphoneDistance_; - } - /** - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @param value The enum numeric value on the wire for microphoneDistance to set. - * @return This builder for chaining. - */ - public Builder setMicrophoneDistanceValue(int value) { - - microphoneDistance_ = value; - onChanged(); - return this; - } - /** - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return The microphoneDistance. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.valueOf(microphoneDistance_); - return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance.UNRECOGNIZED : result; - } - /** - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @param value The microphoneDistance to set. - * @return This builder for chaining. - */ - public Builder setMicrophoneDistance(com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance value) { - if (value == null) { - throw new NullPointerException(); - } - - microphoneDistance_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-     * The audio type that most closely describes the audio being recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return This builder for chaining. - */ - public Builder clearMicrophoneDistance() { - - microphoneDistance_ = 0; - onChanged(); - return this; - } - - private int originalMediaType_ = 0; - /** - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return The enum numeric value on the wire for originalMediaType. - */ - @java.lang.Override public int getOriginalMediaTypeValue() { - return originalMediaType_; - } - /** - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @param value The enum numeric value on the wire for originalMediaType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMediaTypeValue(int value) { - - originalMediaType_ = value; - onChanged(); - return this; - } - /** - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return The originalMediaType. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType getOriginalMediaType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.valueOf(originalMediaType_); - return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType.UNRECOGNIZED : result; - } - /** - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @param value The originalMediaType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMediaType(com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType value) { - if (value == null) { - throw new NullPointerException(); - } - - originalMediaType_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-     * The original media the speech was recorded on.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return This builder for chaining. - */ - public Builder clearOriginalMediaType() { - - originalMediaType_ = 0; - onChanged(); - return this; - } - - private int recordingDeviceType_ = 0; - /** - *
-     * The type of device the speech was recorded with.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return The enum numeric value on the wire for recordingDeviceType. - */ - @java.lang.Override public int getRecordingDeviceTypeValue() { - return recordingDeviceType_; - } - /** - *
-     * The type of device the speech was recorded with.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @param value The enum numeric value on the wire for recordingDeviceType to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceTypeValue(int value) { - - recordingDeviceType_ = value; - onChanged(); - return this; - } - /** - *
-     * The type of device the speech was recorded with.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return The recordingDeviceType. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType result = com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.valueOf(recordingDeviceType_); - return result == null ? com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType.UNRECOGNIZED : result; - } - /** - *
-     * The type of device the speech was recorded with.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @param value The recordingDeviceType to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceType(com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType value) { - if (value == null) { - throw new NullPointerException(); - } - - recordingDeviceType_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-     * The type of device the speech was recorded with.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return This builder for chaining. - */ - public Builder clearRecordingDeviceType() { - - recordingDeviceType_ = 0; - onChanged(); - return this; - } - - private java.lang.Object recordingDeviceName_ = ""; - /** - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * @return The recordingDeviceName. - */ - public java.lang.String getRecordingDeviceName() { - java.lang.Object ref = recordingDeviceName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - recordingDeviceName_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * @return The bytes for recordingDeviceName. - */ - public com.google.protobuf.ByteString - getRecordingDeviceNameBytes() { - java.lang.Object ref = recordingDeviceName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - recordingDeviceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * @param value The recordingDeviceName to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - recordingDeviceName_ = value; - onChanged(); - return this; - } - /** - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * @return This builder for chaining. - */ - public Builder clearRecordingDeviceName() { - - recordingDeviceName_ = getDefaultInstance().getRecordingDeviceName(); - onChanged(); - return this; - } - /** - *
-     * The device used to make the recording.  Examples 'Nexus 5X' or
-     * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-     * 'Cardioid Microphone'.
-     * 
- * - * string recording_device_name = 7; - * @param value The bytes for recordingDeviceName to set. - * @return This builder for chaining. - */ - public Builder setRecordingDeviceNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - recordingDeviceName_ = value; - onChanged(); - return this; - } - - private java.lang.Object originalMimeType_ = ""; - /** - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * @return The originalMimeType. - */ - public java.lang.String getOriginalMimeType() { - java.lang.Object ref = originalMimeType_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - originalMimeType_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * @return The bytes for originalMimeType. - */ - public com.google.protobuf.ByteString - getOriginalMimeTypeBytes() { - java.lang.Object ref = originalMimeType_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - originalMimeType_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * @param value The originalMimeType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMimeType( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - originalMimeType_ = value; - onChanged(); - return this; - } - /** - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * @return This builder for chaining. - */ - public Builder clearOriginalMimeType() { - - originalMimeType_ = getDefaultInstance().getOriginalMimeType(); - onChanged(); - return this; - } - /** - *
-     * Mime type of the original audio file.  For example `audio/m4a`,
-     * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-     * A list of possible audio mime types is maintained at
-     * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-     * 
- * - * string original_mime_type = 8; - * @param value The bytes for originalMimeType to set. - * @return This builder for chaining. - */ - public Builder setOriginalMimeTypeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - originalMimeType_ = value; - onChanged(); - return this; - } - - private long obfuscatedId_ ; - /** - *
-     * Obfuscated (privacy-protected) ID of the user, to identify number of
-     * unique users using the service.
-     * 
- * - * int64 obfuscated_id = 9 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612 - * @return The obfuscatedId. - */ - @java.lang.Override - @java.lang.Deprecated public long getObfuscatedId() { - return obfuscatedId_; - } - /** - *
-     * Obfuscated (privacy-protected) ID of the user, to identify number of
-     * unique users using the service.
-     * 
- * - * int64 obfuscated_id = 9 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612 - * @param value The obfuscatedId to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated public Builder setObfuscatedId(long value) { - - obfuscatedId_ = value; - onChanged(); - return this; - } - /** - *
-     * Obfuscated (privacy-protected) ID of the user, to identify number of
-     * unique users using the service.
-     * 
- * - * int64 obfuscated_id = 9 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612 - * @return This builder for chaining. - */ - @java.lang.Deprecated public Builder clearObfuscatedId() { - - obfuscatedId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object audioTopic_ = ""; - /** - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * @return The audioTopic. - */ - public java.lang.String getAudioTopic() { - java.lang.Object ref = audioTopic_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - audioTopic_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * @return The bytes for audioTopic. - */ - public com.google.protobuf.ByteString - getAudioTopicBytes() { - java.lang.Object ref = audioTopic_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - audioTopic_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * @param value The audioTopic to set. - * @return This builder for chaining. - */ - public Builder setAudioTopic( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - audioTopic_ = value; - onChanged(); - return this; - } - /** - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * @return This builder for chaining. - */ - public Builder clearAudioTopic() { - - audioTopic_ = getDefaultInstance().getAudioTopic(); - onChanged(); - return this; - } - /** - *
-     * Description of the content. Eg. "Recordings of federal supreme court
-     * hearings from 2012".
-     * 
- * - * string audio_topic = 10; - * @param value The bytes for audioTopic to set. - * @return This builder for chaining. - */ - public Builder setAudioTopicBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - audioTopic_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata) - private static final com.google.cloud.speech.v1p1beta1.RecognitionMetadata DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognitionMetadata(); - } - - public static com.google.cloud.speech.v1p1beta1.RecognitionMetadata getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognitionMetadata parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognitionMetadata(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionMetadata getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java deleted file mode 100644 index 64e8e2e34a38..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognitionMetadataOrBuilder.java +++ /dev/null @@ -1,183 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -@java.lang.Deprecated public interface RecognitionMetadataOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognitionMetadata) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return The enum numeric value on the wire for interactionType. - */ - int getInteractionTypeValue(); - /** - *
-   * The use case most closely describing the audio content to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType interaction_type = 1; - * @return The interactionType. - */ - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType getInteractionType(); - - /** - *
-   * The industry vertical to which this speech recognition request most
-   * closely applies. This is most indicative of the topics contained
-   * in the audio.  Use the 6-digit NAICS code to identify the industry
-   * vertical - see https://www.naics.com/search/.
-   * 
- * - * uint32 industry_naics_code_of_audio = 3; - * @return The industryNaicsCodeOfAudio. - */ - int getIndustryNaicsCodeOfAudio(); - - /** - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return The enum numeric value on the wire for microphoneDistance. - */ - int getMicrophoneDistanceValue(); - /** - *
-   * The audio type that most closely describes the audio being recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance microphone_distance = 4; - * @return The microphoneDistance. - */ - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance getMicrophoneDistance(); - - /** - *
-   * The original media the speech was recorded on.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return The enum numeric value on the wire for originalMediaType. - */ - int getOriginalMediaTypeValue(); - /** - *
-   * The original media the speech was recorded on.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType original_media_type = 5; - * @return The originalMediaType. - */ - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType getOriginalMediaType(); - - /** - *
-   * The type of device the speech was recorded with.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return The enum numeric value on the wire for recordingDeviceType. - */ - int getRecordingDeviceTypeValue(); - /** - *
-   * The type of device the speech was recorded with.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType recording_device_type = 6; - * @return The recordingDeviceType. - */ - com.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType getRecordingDeviceType(); - - /** - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * @return The recordingDeviceName. - */ - java.lang.String getRecordingDeviceName(); - /** - *
-   * The device used to make the recording.  Examples 'Nexus 5X' or
-   * 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or
-   * 'Cardioid Microphone'.
-   * 
- * - * string recording_device_name = 7; - * @return The bytes for recordingDeviceName. - */ - com.google.protobuf.ByteString - getRecordingDeviceNameBytes(); - - /** - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * @return The originalMimeType. - */ - java.lang.String getOriginalMimeType(); - /** - *
-   * Mime type of the original audio file.  For example `audio/m4a`,
-   * `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`.
-   * A list of possible audio mime types is maintained at
-   * http://www.iana.org/assignments/media-types/media-types.xhtml#audio
-   * 
- * - * string original_mime_type = 8; - * @return The bytes for originalMimeType. - */ - com.google.protobuf.ByteString - getOriginalMimeTypeBytes(); - - /** - *
-   * Obfuscated (privacy-protected) ID of the user, to identify number of
-   * unique users using the service.
-   * 
- * - * int64 obfuscated_id = 9 [deprecated = true]; - * @deprecated google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=612 - * @return The obfuscatedId. - */ - @java.lang.Deprecated long getObfuscatedId(); - - /** - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * @return The audioTopic. - */ - java.lang.String getAudioTopic(); - /** - *
-   * Description of the content. Eg. "Recordings of federal supreme court
-   * hearings from 2012".
-   * 
- * - * string audio_topic = 10; - * @return The bytes for audioTopic. - */ - com.google.protobuf.ByteString - getAudioTopicBytes(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequest.java deleted file mode 100644 index b8acfd307170..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequest.java +++ /dev/null @@ -1,913 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * The top-level message sent by the client for the `Recognize` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognizeRequest} - */ -public final class RecognizeRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognizeRequest) - RecognizeRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use RecognizeRequest.newBuilder() to construct. - private RecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RecognizeRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RecognizeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = input.readMessage(com.google.cloud.speech.v1p1beta1.RecognitionConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder subBuilder = null; - if (audio_ != null) { - subBuilder = audio_.toBuilder(); - } - audio_ = input.readMessage(com.google.cloud.speech.v1p1beta1.RecognitionAudio.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(audio_); - audio_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognizeRequest.class, com.google.cloud.speech.v1p1beta1.RecognizeRequest.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { - return config_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; - } - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int AUDIO_FIELD_NUMBER = 2; - private com.google.cloud.speech.v1p1beta1.RecognitionAudio audio_; - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the audio field is set. - */ - @java.lang.Override - public boolean hasAudio() { - return audio_ != null; - } - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The audio. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio() { - return audio_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() : audio_; - } - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { - return getAudio(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (audio_ != null) { - output.writeMessage(2, getAudio()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getConfig()); - } - if (audio_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getAudio()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.RecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.RecognizeRequest other = (com.google.cloud.speech.v1p1beta1.RecognizeRequest) obj; - - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig() - .equals(other.getConfig())) return false; - } - if (hasAudio() != other.hasAudio()) return false; - if (hasAudio()) { - if (!getAudio() - .equals(other.getAudio())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - if (hasAudio()) { - hash = (37 * hash) + AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getAudio().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.RecognizeRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * The top-level message sent by the client for the `Recognize` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognizeRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognizeRequest) - com.google.cloud.speech.v1p1beta1.RecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognizeRequest.class, com.google.cloud.speech.v1p1beta1.RecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.RecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - if (audioBuilder_ == null) { - audio_ = null; - } else { - audio_ = null; - audioBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.RecognizeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeRequest build() { - com.google.cloud.speech.v1p1beta1.RecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.RecognizeRequest result = new com.google.cloud.speech.v1p1beta1.RecognizeRequest(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - if (audioBuilder_ == null) { - result.audio_ = audio_; - } else { - result.audio_ = audioBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.RecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognizeRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognizeRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.RecognizeRequest.getDefaultInstance()) return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.hasAudio()) { - mergeAudio(other.getAudio()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.RecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.RecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> configBuilder_; - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setConfig( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1p1beta1.RecognitionConfig.newBuilder(config_).mergeFrom(value).buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null ? - com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; - } - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder>( - getConfig(), - getParentForChildren(), - isClean()); - config_ = null; - } - return configBuilder_; - } - - private com.google.cloud.speech.v1p1beta1.RecognitionAudio audio_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionAudio, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder> audioBuilder_; - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the audio field is set. - */ - public boolean hasAudio() { - return audioBuilder_ != null || audio_ != null; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The audio. - */ - public com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio() { - if (audioBuilder_ == null) { - return audio_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() : audio_; - } else { - return audioBuilder_.getMessage(); - } - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setAudio(com.google.cloud.speech.v1p1beta1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - audio_ = value; - onChanged(); - } else { - audioBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setAudio( - com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder builderForValue) { - if (audioBuilder_ == null) { - audio_ = builderForValue.build(); - onChanged(); - } else { - audioBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeAudio(com.google.cloud.speech.v1p1beta1.RecognitionAudio value) { - if (audioBuilder_ == null) { - if (audio_ != null) { - audio_ = - com.google.cloud.speech.v1p1beta1.RecognitionAudio.newBuilder(audio_).mergeFrom(value).buildPartial(); - } else { - audio_ = value; - } - onChanged(); - } else { - audioBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearAudio() { - if (audioBuilder_ == null) { - audio_ = null; - onChanged(); - } else { - audio_ = null; - audioBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder getAudioBuilder() { - - onChanged(); - return getAudioFieldBuilder().getBuilder(); - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder() { - if (audioBuilder_ != null) { - return audioBuilder_.getMessageOrBuilder(); - } else { - return audio_ == null ? - com.google.cloud.speech.v1p1beta1.RecognitionAudio.getDefaultInstance() : audio_; - } - } - /** - *
-     * Required. The audio data to be recognized.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionAudio, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder> - getAudioFieldBuilder() { - if (audioBuilder_ == null) { - audioBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionAudio, com.google.cloud.speech.v1p1beta1.RecognitionAudio.Builder, com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder>( - getAudio(), - getParentForChildren(), - isClean()); - audio_ = null; - } - return audioBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.RecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognizeRequest) - private static final com.google.cloud.speech.v1p1beta1.RecognizeRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognizeRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognizeRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequestOrBuilder.java deleted file mode 100644 index 2e594dfddc8f..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeRequestOrBuilder.java +++ /dev/null @@ -1,66 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface RecognizeRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig(); - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the audio field is set. - */ - boolean hasAudio(); - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return The audio. - */ - com.google.cloud.speech.v1p1beta1.RecognitionAudio getAudio(); - /** - *
-   * Required. The audio data to be recognized.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionAudio audio = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1p1beta1.RecognitionAudioOrBuilder getAudioOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java deleted file mode 100644 index fe9f8b28c09e..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponse.java +++ /dev/null @@ -1,1135 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * The only message returned to the client by the `Recognize` method. It
- * contains the result as zero or more sequential `SpeechRecognitionResult`
- * messages.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognizeResponse} - */ -public final class RecognizeResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.RecognizeResponse) - RecognizeResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use RecognizeResponse.newBuilder() to construct. - private RecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private RecognizeResponse() { - results_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new RecognizeResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private RecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.parser(), extensionRegistry)); - break; - } - case 26: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (totalBilledTime_ != null) { - subBuilder = totalBilledTime_.toBuilder(); - } - totalBilledTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(totalBilledTime_); - totalBilledTime_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognizeResponse.class, com.google.cloud.speech.v1p1beta1.RecognizeResponse.Builder.class); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List getResultsList() { - return results_; - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List - getResultsOrBuilderList() { - return results_; - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public int getResultsCount() { - return results_.size(); - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - public static final int TOTAL_BILLED_TIME_FIELD_NUMBER = 3; - private com.google.protobuf.Duration totalBilledTime_; - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return Whether the totalBilledTime field is set. - */ - @java.lang.Override - public boolean hasTotalBilledTime() { - return totalBilledTime_ != null; - } - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return The totalBilledTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getTotalBilledTime() { - return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { - return getTotalBilledTime(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - if (totalBilledTime_ != null) { - output.writeMessage(3, getTotalBilledTime()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, results_.get(i)); - } - if (totalBilledTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, getTotalBilledTime()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.RecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.RecognizeResponse other = (com.google.cloud.speech.v1p1beta1.RecognizeResponse) obj; - - if (!getResultsList() - .equals(other.getResultsList())) return false; - if (hasTotalBilledTime() != other.hasTotalBilledTime()) return false; - if (hasTotalBilledTime()) { - if (!getTotalBilledTime() - .equals(other.getTotalBilledTime())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - if (hasTotalBilledTime()) { - hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; - hash = (53 * hash) + getTotalBilledTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.RecognizeResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * The only message returned to the client by the `Recognize` method. It
-   * contains the result as zero or more sequential `SpeechRecognitionResult`
-   * messages.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.RecognizeResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.RecognizeResponse) - com.google.cloud.speech.v1p1beta1.RecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.RecognizeResponse.class, com.google.cloud.speech.v1p1beta1.RecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.RecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = null; - } else { - totalBilledTime_ = null; - totalBilledTimeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.RecognizeResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeResponse build() { - com.google.cloud.speech.v1p1beta1.RecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeResponse buildPartial() { - com.google.cloud.speech.v1p1beta1.RecognizeResponse result = new com.google.cloud.speech.v1p1beta1.RecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - if (totalBilledTimeBuilder_ == null) { - result.totalBilledTime_ = totalBilledTime_; - } else { - result.totalBilledTime_ = totalBilledTimeBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.RecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.RecognizeResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.RecognizeResponse other) { - if (other == com.google.cloud.speech.v1p1beta1.RecognizeResponse.getDefaultInstance()) return this; - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResultsFieldBuilder() : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - if (other.hasTotalBilledTime()) { - mergeTotalBilledTime(other.getTotalBilledTime()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.RecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.RecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List results_ = - java.util.Collections.emptyList(); - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = new java.util.ArrayList(results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> resultsBuilder_; - - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()); - } - /** - *
-     * Sequential list of transcription results corresponding to
-     * sequential portions of audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder>( - results_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - results_ = null; - } - return resultsBuilder_; - } - - private com.google.protobuf.Duration totalBilledTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalBilledTimeBuilder_; - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return Whether the totalBilledTime field is set. - */ - public boolean hasTotalBilledTime() { - return totalBilledTimeBuilder_ != null || totalBilledTime_ != null; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return The totalBilledTime. - */ - public com.google.protobuf.Duration getTotalBilledTime() { - if (totalBilledTimeBuilder_ == null) { - return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } else { - return totalBilledTimeBuilder_.getMessage(); - } - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder setTotalBilledTime(com.google.protobuf.Duration value) { - if (totalBilledTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - totalBilledTime_ = value; - onChanged(); - } else { - totalBilledTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder setTotalBilledTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = builderForValue.build(); - onChanged(); - } else { - totalBilledTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder mergeTotalBilledTime(com.google.protobuf.Duration value) { - if (totalBilledTimeBuilder_ == null) { - if (totalBilledTime_ != null) { - totalBilledTime_ = - com.google.protobuf.Duration.newBuilder(totalBilledTime_).mergeFrom(value).buildPartial(); - } else { - totalBilledTime_ = value; - } - onChanged(); - } else { - totalBilledTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public Builder clearTotalBilledTime() { - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = null; - onChanged(); - } else { - totalBilledTime_ = null; - totalBilledTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public com.google.protobuf.Duration.Builder getTotalBilledTimeBuilder() { - - onChanged(); - return getTotalBilledTimeFieldBuilder().getBuilder(); - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { - if (totalBilledTimeBuilder_ != null) { - return totalBilledTimeBuilder_.getMessageOrBuilder(); - } else { - return totalBilledTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } - } - /** - *
-     * When available, billed audio seconds for the corresponding request.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getTotalBilledTimeFieldBuilder() { - if (totalBilledTimeBuilder_ == null) { - totalBilledTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getTotalBilledTime(), - getParentForChildren(), - isClean()); - totalBilledTime_ = null; - } - return totalBilledTimeBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.RecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognizeResponse) - private static final com.google.cloud.speech.v1p1beta1.RecognizeResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.RecognizeResponse(); - } - - public static com.google.cloud.speech.v1p1beta1.RecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public RecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new RecognizeResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java deleted file mode 100644 index d558c9d50911..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/RecognizeResponseOrBuilder.java +++ /dev/null @@ -1,85 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface RecognizeResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.RecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsList(); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getResults(int index); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - int getResultsCount(); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - *
-   * Sequential list of transcription results corresponding to
-   * sequential portions of audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionResult results = 2; - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder getResultsOrBuilder( - int index); - - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return Whether the totalBilledTime field is set. - */ - boolean hasTotalBilledTime(); - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - * @return The totalBilledTime. - */ - com.google.protobuf.Duration getTotalBilledTime(); - /** - *
-   * When available, billed audio seconds for the corresponding request.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 3; - */ - com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java deleted file mode 100644 index 936d082585e2..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfig.java +++ /dev/null @@ -1,782 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Config to enable speaker diarization.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} - */ -public final class SpeakerDiarizationConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) - SpeakerDiarizationConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use SpeakerDiarizationConfig.newBuilder() to construct. - private SpeakerDiarizationConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SpeakerDiarizationConfig() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SpeakerDiarizationConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SpeakerDiarizationConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - enableSpeakerDiarization_ = input.readBool(); - break; - } - case 16: { - - minSpeakerCount_ = input.readInt32(); - break; - } - case 24: { - - maxSpeakerCount_ = input.readInt32(); - break; - } - case 40: { - - speakerTag_ = input.readInt32(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.class, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder.class); - } - - public static final int ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER = 1; - private boolean enableSpeakerDiarization_; - /** - *
-   * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
-   * 
- * - * bool enable_speaker_diarization = 1; - * @return The enableSpeakerDiarization. - */ - @java.lang.Override - public boolean getEnableSpeakerDiarization() { - return enableSpeakerDiarization_; - } - - public static final int MIN_SPEAKER_COUNT_FIELD_NUMBER = 2; - private int minSpeakerCount_; - /** - *
-   * Minimum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 2.
-   * 
- * - * int32 min_speaker_count = 2; - * @return The minSpeakerCount. - */ - @java.lang.Override - public int getMinSpeakerCount() { - return minSpeakerCount_; - } - - public static final int MAX_SPEAKER_COUNT_FIELD_NUMBER = 3; - private int maxSpeakerCount_; - /** - *
-   * Maximum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 6.
-   * 
- * - * int32 max_speaker_count = 3; - * @return The maxSpeakerCount. - */ - @java.lang.Override - public int getMaxSpeakerCount() { - return maxSpeakerCount_; - } - - public static final int SPEAKER_TAG_FIELD_NUMBER = 5; - private int speakerTag_; - /** - *
-   * Output only. Unused.
-   * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 - * @return The speakerTag. - */ - @java.lang.Override - @java.lang.Deprecated public int getSpeakerTag() { - return speakerTag_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (enableSpeakerDiarization_ != false) { - output.writeBool(1, enableSpeakerDiarization_); - } - if (minSpeakerCount_ != 0) { - output.writeInt32(2, minSpeakerCount_); - } - if (maxSpeakerCount_ != 0) { - output.writeInt32(3, maxSpeakerCount_); - } - if (speakerTag_ != 0) { - output.writeInt32(5, speakerTag_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (enableSpeakerDiarization_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(1, enableSpeakerDiarization_); - } - if (minSpeakerCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, minSpeakerCount_); - } - if (maxSpeakerCount_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, maxSpeakerCount_); - } - if (speakerTag_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, speakerTag_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig other = (com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) obj; - - if (getEnableSpeakerDiarization() - != other.getEnableSpeakerDiarization()) return false; - if (getMinSpeakerCount() - != other.getMinSpeakerCount()) return false; - if (getMaxSpeakerCount() - != other.getMaxSpeakerCount()) return false; - if (getSpeakerTag() - != other.getSpeakerTag()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ENABLE_SPEAKER_DIARIZATION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getEnableSpeakerDiarization()); - hash = (37 * hash) + MIN_SPEAKER_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getMinSpeakerCount(); - hash = (37 * hash) + MAX_SPEAKER_COUNT_FIELD_NUMBER; - hash = (53 * hash) + getMaxSpeakerCount(); - hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; - hash = (53 * hash) + getSpeakerTag(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Config to enable speaker diarization.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.class, com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - enableSpeakerDiarization_ = false; - - minSpeakerCount_ = 0; - - maxSpeakerCount_ = 0; - - speakerTag_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig build() { - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig buildPartial() { - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig result = new com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig(this); - result.enableSpeakerDiarization_ = enableSpeakerDiarization_; - result.minSpeakerCount_ = minSpeakerCount_; - result.maxSpeakerCount_ = maxSpeakerCount_; - result.speakerTag_ = speakerTag_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig other) { - if (other == com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.getDefaultInstance()) return this; - if (other.getEnableSpeakerDiarization() != false) { - setEnableSpeakerDiarization(other.getEnableSpeakerDiarization()); - } - if (other.getMinSpeakerCount() != 0) { - setMinSpeakerCount(other.getMinSpeakerCount()); - } - if (other.getMaxSpeakerCount() != 0) { - setMaxSpeakerCount(other.getMaxSpeakerCount()); - } - if (other.getSpeakerTag() != 0) { - setSpeakerTag(other.getSpeakerTag()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private boolean enableSpeakerDiarization_ ; - /** - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * 
- * - * bool enable_speaker_diarization = 1; - * @return The enableSpeakerDiarization. - */ - @java.lang.Override - public boolean getEnableSpeakerDiarization() { - return enableSpeakerDiarization_; - } - /** - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * 
- * - * bool enable_speaker_diarization = 1; - * @param value The enableSpeakerDiarization to set. - * @return This builder for chaining. - */ - public Builder setEnableSpeakerDiarization(boolean value) { - - enableSpeakerDiarization_ = value; - onChanged(); - return this; - } - /** - *
-     * If 'true', enables speaker detection for each recognized word in
-     * the top alternative of the recognition result using a speaker_tag provided
-     * in the WordInfo.
-     * 
- * - * bool enable_speaker_diarization = 1; - * @return This builder for chaining. - */ - public Builder clearEnableSpeakerDiarization() { - - enableSpeakerDiarization_ = false; - onChanged(); - return this; - } - - private int minSpeakerCount_ ; - /** - *
-     * Minimum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 2.
-     * 
- * - * int32 min_speaker_count = 2; - * @return The minSpeakerCount. - */ - @java.lang.Override - public int getMinSpeakerCount() { - return minSpeakerCount_; - } - /** - *
-     * Minimum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 2.
-     * 
- * - * int32 min_speaker_count = 2; - * @param value The minSpeakerCount to set. - * @return This builder for chaining. - */ - public Builder setMinSpeakerCount(int value) { - - minSpeakerCount_ = value; - onChanged(); - return this; - } - /** - *
-     * Minimum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 2.
-     * 
- * - * int32 min_speaker_count = 2; - * @return This builder for chaining. - */ - public Builder clearMinSpeakerCount() { - - minSpeakerCount_ = 0; - onChanged(); - return this; - } - - private int maxSpeakerCount_ ; - /** - *
-     * Maximum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 6.
-     * 
- * - * int32 max_speaker_count = 3; - * @return The maxSpeakerCount. - */ - @java.lang.Override - public int getMaxSpeakerCount() { - return maxSpeakerCount_; - } - /** - *
-     * Maximum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 6.
-     * 
- * - * int32 max_speaker_count = 3; - * @param value The maxSpeakerCount to set. - * @return This builder for chaining. - */ - public Builder setMaxSpeakerCount(int value) { - - maxSpeakerCount_ = value; - onChanged(); - return this; - } - /** - *
-     * Maximum number of speakers in the conversation. This range gives you more
-     * flexibility by allowing the system to automatically determine the correct
-     * number of speakers. If not set, the default value is 6.
-     * 
- * - * int32 max_speaker_count = 3; - * @return This builder for chaining. - */ - public Builder clearMaxSpeakerCount() { - - maxSpeakerCount_ = 0; - onChanged(); - return this; - } - - private int speakerTag_ ; - /** - *
-     * Output only. Unused.
-     * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 - * @return The speakerTag. - */ - @java.lang.Override - @java.lang.Deprecated public int getSpeakerTag() { - return speakerTag_; - } - /** - *
-     * Output only. Unused.
-     * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 - * @param value The speakerTag to set. - * @return This builder for chaining. - */ - @java.lang.Deprecated public Builder setSpeakerTag(int value) { - - speakerTag_ = value; - onChanged(); - return this; - } - /** - *
-     * Output only. Unused.
-     * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 - * @return This builder for chaining. - */ - @java.lang.Deprecated public Builder clearSpeakerTag() { - - speakerTag_ = 0; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) - private static final com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig(); - } - - public static com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeakerDiarizationConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeakerDiarizationConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java deleted file mode 100644 index bc23982ea934..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeakerDiarizationConfigOrBuilder.java +++ /dev/null @@ -1,57 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface SpeakerDiarizationConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * If 'true', enables speaker detection for each recognized word in
-   * the top alternative of the recognition result using a speaker_tag provided
-   * in the WordInfo.
-   * 
- * - * bool enable_speaker_diarization = 1; - * @return The enableSpeakerDiarization. - */ - boolean getEnableSpeakerDiarization(); - - /** - *
-   * Minimum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 2.
-   * 
- * - * int32 min_speaker_count = 2; - * @return The minSpeakerCount. - */ - int getMinSpeakerCount(); - - /** - *
-   * Maximum number of speakers in the conversation. This range gives you more
-   * flexibility by allowing the system to automatically determine the correct
-   * number of speakers. If not set, the default value is 6.
-   * 
- * - * int32 max_speaker_count = 3; - * @return The maxSpeakerCount. - */ - int getMaxSpeakerCount(); - - /** - *
-   * Output only. Unused.
-   * 
- * - * int32 speaker_tag = 5 [deprecated = true, (.google.api.field_behavior) = OUTPUT_ONLY]; - * @deprecated google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.speaker_tag is deprecated. - * See google/cloud/speech/v1p1beta1/cloud_speech.proto;l=480 - * @return The speakerTag. - */ - @java.lang.Deprecated int getSpeakerTag(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java deleted file mode 100644 index 020d93047180..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptation.java +++ /dev/null @@ -1,1671 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Speech adaptation configuration.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechAdaptation} - */ -public final class SpeechAdaptation extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechAdaptation) - SpeechAdaptationOrBuilder { -private static final long serialVersionUID = 0L; - // Use SpeechAdaptation.newBuilder() to construct. - private SpeechAdaptation(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SpeechAdaptation() { - phraseSets_ = java.util.Collections.emptyList(); - phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; - customClasses_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SpeechAdaptation(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SpeechAdaptation( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - phraseSets_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phraseSets_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.PhraseSet.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - phraseSetReferences_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - phraseSetReferences_.add(s); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - customClasses_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; - } - customClasses_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.CustomClass.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - phraseSetReferences_ = phraseSetReferences_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - customClasses_ = java.util.Collections.unmodifiableList(customClasses_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.class, com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder.class); - } - - public static final int PHRASE_SETS_FIELD_NUMBER = 1; - private java.util.List phraseSets_; - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public java.util.List getPhraseSetsList() { - return phraseSets_; - } - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public java.util.List - getPhraseSetsOrBuilderList() { - return phraseSets_; - } - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public int getPhraseSetsCount() { - return phraseSets_.size(); - } - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index) { - return phraseSets_.get(index); - } - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder( - int index) { - return phraseSets_.get(index); - } - - public static final int PHRASE_SET_REFERENCES_FIELD_NUMBER = 2; - private com.google.protobuf.LazyStringList phraseSetReferences_; - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return A list containing the phraseSetReferences. - */ - public com.google.protobuf.ProtocolStringList - getPhraseSetReferencesList() { - return phraseSetReferences_; - } - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return The count of phraseSetReferences. - */ - public int getPhraseSetReferencesCount() { - return phraseSetReferences_.size(); - } - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index of the element to return. - * @return The phraseSetReferences at the given index. - */ - public java.lang.String getPhraseSetReferences(int index) { - return phraseSetReferences_.get(index); - } - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index of the value to return. - * @return The bytes of the phraseSetReferences at the given index. - */ - public com.google.protobuf.ByteString - getPhraseSetReferencesBytes(int index) { - return phraseSetReferences_.getByteString(index); - } - - public static final int CUSTOM_CLASSES_FIELD_NUMBER = 3; - private java.util.List customClasses_; - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - @java.lang.Override - public java.util.List getCustomClassesList() { - return customClasses_; - } - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - @java.lang.Override - public java.util.List - getCustomClassesOrBuilderList() { - return customClasses_; - } - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - @java.lang.Override - public int getCustomClassesCount() { - return customClasses_.size(); - } - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { - return customClasses_.get(index); - } - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index) { - return customClasses_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < phraseSets_.size(); i++) { - output.writeMessage(1, phraseSets_.get(i)); - } - for (int i = 0; i < phraseSetReferences_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, phraseSetReferences_.getRaw(i)); - } - for (int i = 0; i < customClasses_.size(); i++) { - output.writeMessage(3, customClasses_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < phraseSets_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, phraseSets_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < phraseSetReferences_.size(); i++) { - dataSize += computeStringSizeNoTag(phraseSetReferences_.getRaw(i)); - } - size += dataSize; - size += 1 * getPhraseSetReferencesList().size(); - } - for (int i = 0; i < customClasses_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, customClasses_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.SpeechAdaptation)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.SpeechAdaptation other = (com.google.cloud.speech.v1p1beta1.SpeechAdaptation) obj; - - if (!getPhraseSetsList() - .equals(other.getPhraseSetsList())) return false; - if (!getPhraseSetReferencesList() - .equals(other.getPhraseSetReferencesList())) return false; - if (!getCustomClassesList() - .equals(other.getCustomClassesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPhraseSetsCount() > 0) { - hash = (37 * hash) + PHRASE_SETS_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSetsList().hashCode(); - } - if (getPhraseSetReferencesCount() > 0) { - hash = (37 * hash) + PHRASE_SET_REFERENCES_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSetReferencesList().hashCode(); - } - if (getCustomClassesCount() > 0) { - hash = (37 * hash) + CUSTOM_CLASSES_FIELD_NUMBER; - hash = (53 * hash) + getCustomClassesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.SpeechAdaptation prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Speech adaptation configuration.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechAdaptation} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechAdaptation) - com.google.cloud.speech.v1p1beta1.SpeechAdaptationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechAdaptation.class, com.google.cloud.speech.v1p1beta1.SpeechAdaptation.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.SpeechAdaptation.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getPhraseSetsFieldBuilder(); - getCustomClassesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (phraseSetsBuilder_ == null) { - phraseSets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - phraseSetsBuilder_.clear(); - } - phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - if (customClassesBuilder_ == null) { - customClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - } else { - customClassesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation build() { - com.google.cloud.speech.v1p1beta1.SpeechAdaptation result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation buildPartial() { - com.google.cloud.speech.v1p1beta1.SpeechAdaptation result = new com.google.cloud.speech.v1p1beta1.SpeechAdaptation(this); - int from_bitField0_ = bitField0_; - if (phraseSetsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - phraseSets_ = java.util.Collections.unmodifiableList(phraseSets_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phraseSets_ = phraseSets_; - } else { - result.phraseSets_ = phraseSetsBuilder_.build(); - } - if (((bitField0_ & 0x00000002) != 0)) { - phraseSetReferences_ = phraseSetReferences_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.phraseSetReferences_ = phraseSetReferences_; - if (customClassesBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - customClasses_ = java.util.Collections.unmodifiableList(customClasses_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.customClasses_ = customClasses_; - } else { - result.customClasses_ = customClassesBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.SpeechAdaptation) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechAdaptation)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechAdaptation other) { - if (other == com.google.cloud.speech.v1p1beta1.SpeechAdaptation.getDefaultInstance()) return this; - if (phraseSetsBuilder_ == null) { - if (!other.phraseSets_.isEmpty()) { - if (phraseSets_.isEmpty()) { - phraseSets_ = other.phraseSets_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhraseSetsIsMutable(); - phraseSets_.addAll(other.phraseSets_); - } - onChanged(); - } - } else { - if (!other.phraseSets_.isEmpty()) { - if (phraseSetsBuilder_.isEmpty()) { - phraseSetsBuilder_.dispose(); - phraseSetsBuilder_ = null; - phraseSets_ = other.phraseSets_; - bitField0_ = (bitField0_ & ~0x00000001); - phraseSetsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPhraseSetsFieldBuilder() : null; - } else { - phraseSetsBuilder_.addAllMessages(other.phraseSets_); - } - } - } - if (!other.phraseSetReferences_.isEmpty()) { - if (phraseSetReferences_.isEmpty()) { - phraseSetReferences_ = other.phraseSetReferences_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensurePhraseSetReferencesIsMutable(); - phraseSetReferences_.addAll(other.phraseSetReferences_); - } - onChanged(); - } - if (customClassesBuilder_ == null) { - if (!other.customClasses_.isEmpty()) { - if (customClasses_.isEmpty()) { - customClasses_ = other.customClasses_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensureCustomClassesIsMutable(); - customClasses_.addAll(other.customClasses_); - } - onChanged(); - } - } else { - if (!other.customClasses_.isEmpty()) { - if (customClassesBuilder_.isEmpty()) { - customClassesBuilder_.dispose(); - customClassesBuilder_ = null; - customClasses_ = other.customClasses_; - bitField0_ = (bitField0_ & ~0x00000004); - customClassesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getCustomClassesFieldBuilder() : null; - } else { - customClassesBuilder_.addAllMessages(other.customClasses_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.SpeechAdaptation parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.SpeechAdaptation) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List phraseSets_ = - java.util.Collections.emptyList(); - private void ensurePhraseSetsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - phraseSets_ = new java.util.ArrayList(phraseSets_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> phraseSetsBuilder_; - - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public java.util.List getPhraseSetsList() { - if (phraseSetsBuilder_ == null) { - return java.util.Collections.unmodifiableList(phraseSets_); - } else { - return phraseSetsBuilder_.getMessageList(); - } - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public int getPhraseSetsCount() { - if (phraseSetsBuilder_ == null) { - return phraseSets_.size(); - } else { - return phraseSetsBuilder_.getCount(); - } - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index) { - if (phraseSetsBuilder_ == null) { - return phraseSets_.get(index); - } else { - return phraseSetsBuilder_.getMessage(index); - } - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder setPhraseSets( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.set(index, value); - onChanged(); - } else { - phraseSetsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder setPhraseSets( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.set(index, builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets(com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.add(value); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetsIsMutable(); - phraseSets_.add(index, value); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.add(builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addPhraseSets( - int index, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.add(index, builderForValue.build()); - onChanged(); - } else { - phraseSetsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder addAllPhraseSets( - java.lang.Iterable values) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, phraseSets_); - onChanged(); - } else { - phraseSetsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder clearPhraseSets() { - if (phraseSetsBuilder_ == null) { - phraseSets_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - phraseSetsBuilder_.clear(); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public Builder removePhraseSets(int index) { - if (phraseSetsBuilder_ == null) { - ensurePhraseSetsIsMutable(); - phraseSets_.remove(index); - onChanged(); - } else { - phraseSetsBuilder_.remove(index); - } - return this; - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder getPhraseSetsBuilder( - int index) { - return getPhraseSetsFieldBuilder().getBuilder(index); - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder( - int index) { - if (phraseSetsBuilder_ == null) { - return phraseSets_.get(index); } else { - return phraseSetsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public java.util.List - getPhraseSetsOrBuilderList() { - if (phraseSetsBuilder_ != null) { - return phraseSetsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(phraseSets_); - } - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder() { - return getPhraseSetsFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()); - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder addPhraseSetsBuilder( - int index) { - return getPhraseSetsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance()); - } - /** - *
-     * A collection of phrase sets. To specify the hints inline, leave the
-     * phrase set's `name` blank and fill in the rest of its fields. Any
-     * phrase set can use any custom class.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - public java.util.List - getPhraseSetsBuilderList() { - return getPhraseSetsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> - getPhraseSetsFieldBuilder() { - if (phraseSetsBuilder_ == null) { - phraseSetsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder>( - phraseSets_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - phraseSets_ = null; - } - return phraseSetsBuilder_; - } - - private com.google.protobuf.LazyStringList phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensurePhraseSetReferencesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - phraseSetReferences_ = new com.google.protobuf.LazyStringArrayList(phraseSetReferences_); - bitField0_ |= 0x00000002; - } - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return A list containing the phraseSetReferences. - */ - public com.google.protobuf.ProtocolStringList - getPhraseSetReferencesList() { - return phraseSetReferences_.getUnmodifiableView(); - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return The count of phraseSetReferences. - */ - public int getPhraseSetReferencesCount() { - return phraseSetReferences_.size(); - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index of the element to return. - * @return The phraseSetReferences at the given index. - */ - public java.lang.String getPhraseSetReferences(int index) { - return phraseSetReferences_.get(index); - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index of the value to return. - * @return The bytes of the phraseSetReferences at the given index. - */ - public com.google.protobuf.ByteString - getPhraseSetReferencesBytes(int index) { - return phraseSetReferences_.getByteString(index); - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index to set the value at. - * @param value The phraseSetReferences to set. - * @return This builder for chaining. - */ - public Builder setPhraseSetReferences( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetReferencesIsMutable(); - phraseSetReferences_.set(index, value); - onChanged(); - return this; - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param value The phraseSetReferences to add. - * @return This builder for chaining. - */ - public Builder addPhraseSetReferences( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhraseSetReferencesIsMutable(); - phraseSetReferences_.add(value); - onChanged(); - return this; - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param values The phraseSetReferences to add. - * @return This builder for chaining. - */ - public Builder addAllPhraseSetReferences( - java.lang.Iterable values) { - ensurePhraseSetReferencesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, phraseSetReferences_); - onChanged(); - return this; - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return This builder for chaining. - */ - public Builder clearPhraseSetReferences() { - phraseSetReferences_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - *
-     * A collection of phrase set resource names to use.
-     * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param value The bytes of the phraseSetReferences to add. - * @return This builder for chaining. - */ - public Builder addPhraseSetReferencesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensurePhraseSetReferencesIsMutable(); - phraseSetReferences_.add(value); - onChanged(); - return this; - } - - private java.util.List customClasses_ = - java.util.Collections.emptyList(); - private void ensureCustomClassesIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - customClasses_ = new java.util.ArrayList(customClasses_); - bitField0_ |= 0x00000004; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> customClassesBuilder_; - - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public java.util.List getCustomClassesList() { - if (customClassesBuilder_ == null) { - return java.util.Collections.unmodifiableList(customClasses_); - } else { - return customClassesBuilder_.getMessageList(); - } - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public int getCustomClassesCount() { - if (customClassesBuilder_ == null) { - return customClasses_.size(); - } else { - return customClassesBuilder_.getCount(); - } - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index) { - if (customClassesBuilder_ == null) { - return customClasses_.get(index); - } else { - return customClassesBuilder_.getMessage(index); - } - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public Builder setCustomClasses( - int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.set(index, value); - onChanged(); - } else { - customClassesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public Builder setCustomClasses( - int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.set(index, builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public Builder addCustomClasses(com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.add(value); - onChanged(); - } else { - customClassesBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public Builder addCustomClasses( - int index, com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCustomClassesIsMutable(); - customClasses_.add(index, value); - onChanged(); - } else { - customClassesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public Builder addCustomClasses( - com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.add(builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public Builder addCustomClasses( - int index, com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.add(index, builderForValue.build()); - onChanged(); - } else { - customClassesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public Builder addAllCustomClasses( - java.lang.Iterable values) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, customClasses_); - onChanged(); - } else { - customClassesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public Builder clearCustomClasses() { - if (customClassesBuilder_ == null) { - customClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - customClassesBuilder_.clear(); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public Builder removeCustomClasses(int index) { - if (customClassesBuilder_ == null) { - ensureCustomClassesIsMutable(); - customClasses_.remove(index); - onChanged(); - } else { - customClassesBuilder_.remove(index); - } - return this; - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassesBuilder( - int index) { - return getCustomClassesFieldBuilder().getBuilder(index); - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index) { - if (customClassesBuilder_ == null) { - return customClasses_.get(index); } else { - return customClassesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public java.util.List - getCustomClassesOrBuilderList() { - if (customClassesBuilder_ != null) { - return customClassesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(customClasses_); - } - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder() { - return getCustomClassesFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()); - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.Builder addCustomClassesBuilder( - int index) { - return getCustomClassesFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance()); - } - /** - *
-     * A collection of custom classes. To specify the classes inline, leave the
-     * class' `name` blank and fill in the rest of its fields, giving it a unique
-     * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-     * `custom_class_id`.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - public java.util.List - getCustomClassesBuilderList() { - return getCustomClassesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> - getCustomClassesFieldBuilder() { - if (customClassesBuilder_ == null) { - customClassesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( - customClasses_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - customClasses_ = null; - } - return customClassesBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.SpeechAdaptation) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechAdaptation) - private static final com.google.cloud.speech.v1p1beta1.SpeechAdaptation DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechAdaptation(); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechAdaptation getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechAdaptation parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechAdaptation(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechAdaptation getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java deleted file mode 100644 index 64b0f0cb1359..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationOrBuilder.java +++ /dev/null @@ -1,163 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface SpeechAdaptationOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechAdaptation) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - java.util.List - getPhraseSetsList(); - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSets(int index); - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - int getPhraseSetsCount(); - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - java.util.List - getPhraseSetsOrBuilderList(); - /** - *
-   * A collection of phrase sets. To specify the hints inline, leave the
-   * phrase set's `name` blank and fill in the rest of its fields. Any
-   * phrase set can use any custom class.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.PhraseSet phrase_sets = 1; - */ - com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetsOrBuilder( - int index); - - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return A list containing the phraseSetReferences. - */ - java.util.List - getPhraseSetReferencesList(); - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @return The count of phraseSetReferences. - */ - int getPhraseSetReferencesCount(); - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index of the element to return. - * @return The phraseSetReferences at the given index. - */ - java.lang.String getPhraseSetReferences(int index); - /** - *
-   * A collection of phrase set resource names to use.
-   * 
- * - * repeated string phrase_set_references = 2 [(.google.api.resource_reference) = { ... } - * @param index The index of the value to return. - * @return The bytes of the phraseSetReferences at the given index. - */ - com.google.protobuf.ByteString - getPhraseSetReferencesBytes(int index); - - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - java.util.List - getCustomClassesList(); - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - com.google.cloud.speech.v1p1beta1.CustomClass getCustomClasses(int index); - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - int getCustomClassesCount(); - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - java.util.List - getCustomClassesOrBuilderList(); - /** - *
-   * A collection of custom classes. To specify the classes inline, leave the
-   * class' `name` blank and fill in the rest of its fields, giving it a unique
-   * `custom_class_id`. Refer to the inline defined class in phrase hints by its
-   * `custom_class_id`.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.CustomClass custom_classes = 3; - */ - com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassesOrBuilder( - int index); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java deleted file mode 100644 index 0322b2c20ba1..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechAdaptationProto.java +++ /dev/null @@ -1,292 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public final class SpeechAdaptationProto { - private SpeechAdaptationProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n;google/cloud/speech/v1p1beta1/cloud_sp" + - "eech_adaptation.proto\022\035google.cloud.spee" + - "ch.v1p1beta1\032\034google/api/annotations.pro" + - "to\032\027google/api/client.proto\032\037google/api/" + - "field_behavior.proto\032\031google/api/resourc" + - "e.proto\032,google/cloud/speech/v1p1beta1/r" + - "esource.proto\032\033google/protobuf/empty.pro" + - "to\032 google/protobuf/field_mask.proto\"\260\001\n" + - "\026CreatePhraseSetRequest\0227\n\006parent\030\001 \001(\tB" + - "\'\340A\002\372A!\022\037speech.googleapis.com/PhraseSet" + - "\022\032\n\rphrase_set_id\030\002 \001(\tB\003\340A\002\022A\n\nphrase_s" + - "et\030\003 \001(\0132(.google.cloud.speech.v1p1beta1" + - ".PhraseSetB\003\340A\002\"\214\001\n\026UpdatePhraseSetReque" + - "st\022A\n\nphrase_set\030\001 \001(\0132(.google.cloud.sp" + - "eech.v1p1beta1.PhraseSetB\003\340A\002\022/\n\013update_" + - "mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"L" + - "\n\023GetPhraseSetRequest\0225\n\004name\030\001 \001(\tB\'\340A\002" + - "\372A!\n\037speech.googleapis.com/PhraseSet\"v\n\024" + - "ListPhraseSetRequest\0227\n\006parent\030\001 \001(\tB\'\340A" + - "\002\372A!\022\037speech.googleapis.com/PhraseSet\022\021\n" + - "\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"o\n\025" + - "ListPhraseSetResponse\022=\n\013phrase_sets\030\001 \003" + - "(\0132(.google.cloud.speech.v1p1beta1.Phras" + - "eSet\022\027\n\017next_page_token\030\002 \001(\t\"O\n\026DeleteP" + - "hraseSetRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037s" + - "peech.googleapis.com/PhraseSet\"\272\001\n\030Creat" + - "eCustomClassRequest\0229\n\006parent\030\001 \001(\tB)\340A\002" + - "\372A#\022!speech.googleapis.com/CustomClass\022\034" + - "\n\017custom_class_id\030\002 \001(\tB\003\340A\002\022E\n\014custom_c" + - "lass\030\003 \001(\0132*.google.cloud.speech.v1p1bet" + - "a1.CustomClassB\003\340A\002\"\222\001\n\030UpdateCustomClas" + - "sRequest\022E\n\014custom_class\030\001 \001(\0132*.google." + - "cloud.speech.v1p1beta1.CustomClassB\003\340A\002\022" + - "/\n\013update_mask\030\002 \001(\0132\032.google.protobuf.F" + - "ieldMask\"P\n\025GetCustomClassRequest\0227\n\004nam" + - "e\030\001 \001(\tB)\340A\002\372A#\n!speech.googleapis.com/C" + - "ustomClass\"|\n\030ListCustomClassesRequest\0229" + - "\n\006parent\030\001 \001(\tB)\340A\002\372A#\022!speech.googleapi" + - "s.com/CustomClass\022\021\n\tpage_size\030\002 \001(\005\022\022\n\n" + - "page_token\030\003 \001(\t\"x\n\031ListCustomClassesRes" + - "ponse\022B\n\016custom_classes\030\001 \003(\0132*.google.c" + - "loud.speech.v1p1beta1.CustomClass\022\027\n\017nex" + - "t_page_token\030\002 \001(\t\"S\n\030DeleteCustomClassR" + - "equest\0227\n\004name\030\001 \001(\tB)\340A\002\372A#\n!speech.goo" + - "gleapis.com/CustomClass2\322\020\n\nAdaptation\022\326" + - "\001\n\017CreatePhraseSet\0225.google.cloud.speech" + - ".v1p1beta1.CreatePhraseSetRequest\032(.goog" + - "le.cloud.speech.v1p1beta1.PhraseSet\"b\202\323\344" + - "\223\002:\"5/v1p1beta1/{parent=projects/*/locat" + - "ions/*}/phraseSets:\001*\332A\037parent,phrase_se" + - "t,phrase_set_id\022\262\001\n\014GetPhraseSet\0222.googl" + - "e.cloud.speech.v1p1beta1.GetPhraseSetReq" + - "uest\032(.google.cloud.speech.v1p1beta1.Phr" + - "aseSet\"D\202\323\344\223\0027\0225/v1p1beta1/{name=project" + - "s/*/locations/*/phraseSets/*}\332A\004name\022\302\001\n" + - "\rListPhraseSet\0223.google.cloud.speech.v1p" + - "1beta1.ListPhraseSetRequest\0324.google.clo" + - "ud.speech.v1p1beta1.ListPhraseSetRespons" + - "e\"F\202\323\344\223\0027\0225/v1p1beta1/{parent=projects/*" + - "/locations/*}/phraseSets\332A\006parent\022\341\001\n\017Up" + - "datePhraseSet\0225.google.cloud.speech.v1p1" + - "beta1.UpdatePhraseSetRequest\032(.google.cl" + - "oud.speech.v1p1beta1.PhraseSet\"m\202\323\344\223\002N2@" + - "/v1p1beta1/{phrase_set.name=projects/*/l" + - "ocations/*/phraseSets/*}:\nphrase_set\332A\026p" + - "hrase_set,update_mask\022\246\001\n\017DeletePhraseSe" + - "t\0225.google.cloud.speech.v1p1beta1.Delete" + - "PhraseSetRequest\032\026.google.protobuf.Empty" + - "\"D\202\323\344\223\0027*5/v1p1beta1/{name=projects/*/lo" + - "cations/*/phraseSets/*}\332A\004name\022\343\001\n\021Creat" + - "eCustomClass\0227.google.cloud.speech.v1p1b" + - "eta1.CreateCustomClassRequest\032*.google.c" + - "loud.speech.v1p1beta1.CustomClass\"i\202\323\344\223\002" + - "=\"8/v1p1beta1/{parent=projects/*/locatio" + - "ns/*}/customClasses:\001*\332A#parent,custom_c" + - "lass,custom_class_id\022\273\001\n\016GetCustomClass\022" + - "4.google.cloud.speech.v1p1beta1.GetCusto" + - "mClassRequest\032*.google.cloud.speech.v1p1" + - "beta1.CustomClass\"G\202\323\344\223\002:\0228/v1p1beta1/{n" + - "ame=projects/*/locations/*/customClasses" + - "/*}\332A\004name\022\321\001\n\021ListCustomClasses\0227.googl" + - "e.cloud.speech.v1p1beta1.ListCustomClass" + - "esRequest\0328.google.cloud.speech.v1p1beta" + - "1.ListCustomClassesResponse\"I\202\323\344\223\002:\0228/v1" + - "p1beta1/{parent=projects/*/locations/*}/" + - "customClasses\332A\006parent\022\360\001\n\021UpdateCustomC" + - "lass\0227.google.cloud.speech.v1p1beta1.Upd" + - "ateCustomClassRequest\032*.google.cloud.spe" + - "ech.v1p1beta1.CustomClass\"v\202\323\344\223\002U2E/v1p1" + - "beta1/{custom_class.name=projects/*/loca" + - "tions/*/customClasses/*}:\014custom_class\332A" + - "\030custom_class,update_mask\022\255\001\n\021DeleteCust" + - "omClass\0227.google.cloud.speech.v1p1beta1." + - "DeleteCustomClassRequest\032\026.google.protob" + - "uf.Empty\"G\202\323\344\223\002:*8/v1p1beta1/{name=proje" + - "cts/*/locations/*/customClasses/*}\332A\004nam" + - "e\032I\312A\025speech.googleapis.com\322A.https://ww" + - "w.googleapis.com/auth/cloud-platformB\212\001\n" + - "!com.google.cloud.speech.v1p1beta1B\025Spee" + - "chAdaptationProtoP\001ZCgoogle.golang.org/g" + - "enproto/googleapis/cloud/speech/v1p1beta" + - "1;speech\370\001\001\242\002\003GCSb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.ClientProto.getDescriptor(), - com.google.api.FieldBehaviorProto.getDescriptor(), - com.google.api.ResourceProto.getDescriptor(), - com.google.cloud.speech.v1p1beta1.SpeechResourceProto.getDescriptor(), - com.google.protobuf.EmptyProto.getDescriptor(), - com.google.protobuf.FieldMaskProto.getDescriptor(), - }); - internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_CreatePhraseSetRequest_descriptor, - new java.lang.String[] { "Parent", "PhraseSetId", "PhraseSet", }); - internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor, - new java.lang.String[] { "PhraseSet", "UpdateMask", }); - internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_GetPhraseSetRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetRequest_descriptor, - new java.lang.String[] { "Parent", "PageSize", "PageToken", }); - internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_ListPhraseSetResponse_descriptor, - new java.lang.String[] { "PhraseSets", "NextPageToken", }); - internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_DeletePhraseSetRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_CreateCustomClassRequest_descriptor, - new java.lang.String[] { "Parent", "CustomClassId", "CustomClass", }); - internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor, - new java.lang.String[] { "CustomClass", "UpdateMask", }); - internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_GetCustomClassRequest_descriptor, - new java.lang.String[] { "Name", }); - internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesRequest_descriptor, - new java.lang.String[] { "Parent", "PageSize", "PageToken", }); - internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_ListCustomClassesResponse_descriptor, - new java.lang.String[] { "CustomClasses", "NextPageToken", }); - internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_DeleteCustomClassRequest_descriptor, - new java.lang.String[] { "Name", }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.ClientProto.defaultHost); - registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); - registry.add(com.google.api.AnnotationsProto.http); - registry.add(com.google.api.ClientProto.methodSignature); - registry.add(com.google.api.ClientProto.oauthScopes); - registry.add(com.google.api.ResourceProto.resourceReference); - com.google.protobuf.Descriptors.FileDescriptor - .internalUpdateFileDescriptor(descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.ClientProto.getDescriptor(); - com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.api.ResourceProto.getDescriptor(); - com.google.cloud.speech.v1p1beta1.SpeechResourceProto.getDescriptor(); - com.google.protobuf.EmptyProto.getDescriptor(); - com.google.protobuf.FieldMaskProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java deleted file mode 100644 index b4cbb679d573..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContext.java +++ /dev/null @@ -1,918 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Provides "hints" to the speech recognizer to favor specific words and phrases
- * in the results.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechContext} - */ -public final class SpeechContext extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechContext) - SpeechContextOrBuilder { -private static final long serialVersionUID = 0L; - // Use SpeechContext.newBuilder() to construct. - private SpeechContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SpeechContext() { - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SpeechContext(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SpeechContext( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000001; - } - phrases_.add(s); - break; - } - case 37: { - - boost_ = input.readFloat(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - phrases_ = phrases_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechContext_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechContext.class, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder.class); - } - - public static final int PHRASES_FIELD_NUMBER = 1; - private com.google.protobuf.LazyStringList phrases_; - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @return A list containing the phrases. - */ - public com.google.protobuf.ProtocolStringList - getPhrasesList() { - return phrases_; - } - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @return The count of phrases. - */ - public int getPhrasesCount() { - return phrases_.size(); - } - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @param index The index of the element to return. - * @return The phrases at the given index. - */ - public java.lang.String getPhrases(int index) { - return phrases_.get(index); - } - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @param index The index of the value to return. - * @return The bytes of the phrases at the given index. - */ - public com.google.protobuf.ByteString - getPhrasesBytes(int index) { - return phrases_.getByteString(index); - } - - public static final int BOOST_FIELD_NUMBER = 4; - private float boost_; - /** - *
-   * Hint Boost. Positive value will increase the probability that a specific
-   * phrase will be recognized over other similar sounding phrases. The higher
-   * the boost, the higher the chance of false positive recognition as well.
-   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-   * enabled, so negative boost will simply be ignored. Though `boost` can
-   * accept a wide range of positive values, most use cases are best served with
-   * values between 0 and 20. We recommend using a binary search approach to
-   * finding the optimal value for your use case.
-   * 
- * - * float boost = 4; - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < phrases_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, phrases_.getRaw(i)); - } - if (java.lang.Float.floatToRawIntBits(boost_) != 0) { - output.writeFloat(4, boost_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - for (int i = 0; i < phrases_.size(); i++) { - dataSize += computeStringSizeNoTag(phrases_.getRaw(i)); - } - size += dataSize; - size += 1 * getPhrasesList().size(); - } - if (java.lang.Float.floatToRawIntBits(boost_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(4, boost_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.SpeechContext)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.SpeechContext other = (com.google.cloud.speech.v1p1beta1.SpeechContext) obj; - - if (!getPhrasesList() - .equals(other.getPhrasesList())) return false; - if (java.lang.Float.floatToIntBits(getBoost()) - != java.lang.Float.floatToIntBits( - other.getBoost())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPhrasesCount() > 0) { - hash = (37 * hash) + PHRASES_FIELD_NUMBER; - hash = (53 * hash) + getPhrasesList().hashCode(); - } - hash = (37 * hash) + BOOST_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getBoost()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeechContext parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.SpeechContext prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Provides "hints" to the speech recognizer to favor specific words and phrases
-   * in the results.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechContext} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechContext) - com.google.cloud.speech.v1p1beta1.SpeechContextOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechContext_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechContext.class, com.google.cloud.speech.v1p1beta1.SpeechContext.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.SpeechContext.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - boost_ = 0F; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechContext getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.SpeechContext.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechContext build() { - com.google.cloud.speech.v1p1beta1.SpeechContext result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechContext buildPartial() { - com.google.cloud.speech.v1p1beta1.SpeechContext result = new com.google.cloud.speech.v1p1beta1.SpeechContext(this); - int from_bitField0_ = bitField0_; - if (((bitField0_ & 0x00000001) != 0)) { - phrases_ = phrases_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.phrases_ = phrases_; - result.boost_ = boost_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.SpeechContext) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechContext)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechContext other) { - if (other == com.google.cloud.speech.v1p1beta1.SpeechContext.getDefaultInstance()) return this; - if (!other.phrases_.isEmpty()) { - if (phrases_.isEmpty()) { - phrases_ = other.phrases_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePhrasesIsMutable(); - phrases_.addAll(other.phrases_); - } - onChanged(); - } - if (other.getBoost() != 0F) { - setBoost(other.getBoost()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.SpeechContext parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.SpeechContext) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.protobuf.LazyStringList phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - private void ensurePhrasesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - phrases_ = new com.google.protobuf.LazyStringArrayList(phrases_); - bitField0_ |= 0x00000001; - } - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @return A list containing the phrases. - */ - public com.google.protobuf.ProtocolStringList - getPhrasesList() { - return phrases_.getUnmodifiableView(); - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @return The count of phrases. - */ - public int getPhrasesCount() { - return phrases_.size(); - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @param index The index of the element to return. - * @return The phrases at the given index. - */ - public java.lang.String getPhrases(int index) { - return phrases_.get(index); - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @param index The index of the value to return. - * @return The bytes of the phrases at the given index. - */ - public com.google.protobuf.ByteString - getPhrasesBytes(int index) { - return phrases_.getByteString(index); - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @param index The index to set the value at. - * @param value The phrases to set. - * @return This builder for chaining. - */ - public Builder setPhrases( - int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.set(index, value); - onChanged(); - return this; - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @param value The phrases to add. - * @return This builder for chaining. - */ - public Builder addPhrases( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensurePhrasesIsMutable(); - phrases_.add(value); - onChanged(); - return this; - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @param values The phrases to add. - * @return This builder for chaining. - */ - public Builder addAllPhrases( - java.lang.Iterable values) { - ensurePhrasesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, phrases_); - onChanged(); - return this; - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @return This builder for chaining. - */ - public Builder clearPhrases() { - phrases_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - /** - *
-     * A list of strings containing words and phrases "hints" so that
-     * the speech recognition is more likely to recognize them. This can be used
-     * to improve the accuracy for specific words and phrases, for example, if
-     * specific commands are typically spoken by the user. This can also be used
-     * to add additional words to the vocabulary of the recognizer. See
-     * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * List items can also be set to classes for groups of words that represent
-     * common concepts that occur in natural language. For example, rather than
-     * providing phrase hints for every month of the year, using the $MONTH class
-     * improves the likelihood of correctly transcribing audio that includes
-     * months.
-     * 
- * - * repeated string phrases = 1; - * @param value The bytes of the phrases to add. - * @return This builder for chaining. - */ - public Builder addPhrasesBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensurePhrasesIsMutable(); - phrases_.add(value); - onChanged(); - return this; - } - - private float boost_ ; - /** - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 and 20. We recommend using a binary search approach to
-     * finding the optimal value for your use case.
-     * 
- * - * float boost = 4; - * @return The boost. - */ - @java.lang.Override - public float getBoost() { - return boost_; - } - /** - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 and 20. We recommend using a binary search approach to
-     * finding the optimal value for your use case.
-     * 
- * - * float boost = 4; - * @param value The boost to set. - * @return This builder for chaining. - */ - public Builder setBoost(float value) { - - boost_ = value; - onChanged(); - return this; - } - /** - *
-     * Hint Boost. Positive value will increase the probability that a specific
-     * phrase will be recognized over other similar sounding phrases. The higher
-     * the boost, the higher the chance of false positive recognition as well.
-     * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-     * enabled, so negative boost will simply be ignored. Though `boost` can
-     * accept a wide range of positive values, most use cases are best served with
-     * values between 0 and 20. We recommend using a binary search approach to
-     * finding the optimal value for your use case.
-     * 
- * - * float boost = 4; - * @return This builder for chaining. - */ - public Builder clearBoost() { - - boost_ = 0F; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.SpeechContext) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechContext) - private static final com.google.cloud.speech.v1p1beta1.SpeechContext DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechContext(); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechContext getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechContext parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechContext(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechContext getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java deleted file mode 100644 index 1daae97d3d7c..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechContextOrBuilder.java +++ /dev/null @@ -1,107 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface SpeechContextOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechContext) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @return A list containing the phrases. - */ - java.util.List - getPhrasesList(); - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @return The count of phrases. - */ - int getPhrasesCount(); - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @param index The index of the element to return. - * @return The phrases at the given index. - */ - java.lang.String getPhrases(int index); - /** - *
-   * A list of strings containing words and phrases "hints" so that
-   * the speech recognition is more likely to recognize them. This can be used
-   * to improve the accuracy for specific words and phrases, for example, if
-   * specific commands are typically spoken by the user. This can also be used
-   * to add additional words to the vocabulary of the recognizer. See
-   * [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * List items can also be set to classes for groups of words that represent
-   * common concepts that occur in natural language. For example, rather than
-   * providing phrase hints for every month of the year, using the $MONTH class
-   * improves the likelihood of correctly transcribing audio that includes
-   * months.
-   * 
- * - * repeated string phrases = 1; - * @param index The index of the value to return. - * @return The bytes of the phrases at the given index. - */ - com.google.protobuf.ByteString - getPhrasesBytes(int index); - - /** - *
-   * Hint Boost. Positive value will increase the probability that a specific
-   * phrase will be recognized over other similar sounding phrases. The higher
-   * the boost, the higher the chance of false positive recognition as well.
-   * Negative boost values would correspond to anti-biasing. Anti-biasing is not
-   * enabled, so negative boost will simply be ignored. Though `boost` can
-   * accept a wide range of positive values, most use cases are best served with
-   * values between 0 and 20. We recommend using a binary search approach to
-   * finding the optimal value for your use case.
-   * 
- * - * float boost = 4; - * @return The boost. - */ - float getBoost(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java deleted file mode 100644 index 914c6bec3435..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechProto.java +++ /dev/null @@ -1,420 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public final class SpeechProto { - private SpeechProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_SpeechContext_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n0google/cloud/speech/v1p1beta1/cloud_sp" + - "eech.proto\022\035google.cloud.speech.v1p1beta" + - "1\032\034google/api/annotations.proto\032\027google/" + - "api/client.proto\032\037google/api/field_behav" + - "ior.proto\032,google/cloud/speech/v1p1beta1" + - "/resource.proto\032#google/longrunning/oper" + - "ations.proto\032\036google/protobuf/duration.p" + - "roto\032\037google/protobuf/timestamp.proto\032\036g" + - "oogle/protobuf/wrappers.proto\032\027google/rp" + - "c/status.proto\"\236\001\n\020RecognizeRequest\022E\n\006c" + - "onfig\030\001 \001(\01320.google.cloud.speech.v1p1be" + - "ta1.RecognitionConfigB\003\340A\002\022C\n\005audio\030\002 \001(" + - "\0132/.google.cloud.speech.v1p1beta1.Recogn" + - "itionAudioB\003\340A\002\"\374\001\n\033LongRunningRecognize" + - "Request\022E\n\006config\030\001 \001(\01320.google.cloud.s" + - "peech.v1p1beta1.RecognitionConfigB\003\340A\002\022C" + - "\n\005audio\030\002 \001(\0132/.google.cloud.speech.v1p1" + - "beta1.RecognitionAudioB\003\340A\002\022Q\n\routput_co" + - "nfig\030\004 \001(\01325.google.cloud.speech.v1p1bet" + - "a1.TranscriptOutputConfigB\003\340A\001\":\n\026Transc" + - "riptOutputConfig\022\021\n\007gcs_uri\030\001 \001(\tH\000B\r\n\013o" + - "utput_type\"\240\001\n\031StreamingRecognizeRequest" + - "\022U\n\020streaming_config\030\001 \001(\01329.google.clou" + - "d.speech.v1p1beta1.StreamingRecognitionC" + - "onfigH\000\022\027\n\raudio_content\030\002 \001(\014H\000B\023\n\021stre" + - "aming_request\"\226\001\n\032StreamingRecognitionCo" + - "nfig\022E\n\006config\030\001 \001(\01320.google.cloud.spee" + - "ch.v1p1beta1.RecognitionConfigB\003\340A\002\022\030\n\020s" + - "ingle_utterance\030\002 \001(\010\022\027\n\017interim_results" + - "\030\003 \001(\010\"\276\t\n\021RecognitionConfig\022P\n\010encoding" + - "\030\001 \001(\0162>.google.cloud.speech.v1p1beta1.R" + - "ecognitionConfig.AudioEncoding\022\031\n\021sample" + - "_rate_hertz\030\002 \001(\005\022\033\n\023audio_channel_count" + - "\030\007 \001(\005\022/\n\'enable_separate_recognition_pe" + - "r_channel\030\014 \001(\010\022\032\n\rlanguage_code\030\003 \001(\tB\003" + - "\340A\002\022\"\n\032alternative_language_codes\030\022 \003(\t\022" + - "\030\n\020max_alternatives\030\004 \001(\005\022\030\n\020profanity_f" + - "ilter\030\005 \001(\010\022C\n\nadaptation\030\024 \001(\0132/.google" + - ".cloud.speech.v1p1beta1.SpeechAdaptation" + - "\022X\n\030transcript_normalization\030\030 \001(\01326.goo" + - "gle.cloud.speech.v1p1beta1.TranscriptNor" + - "malization\022E\n\017speech_contexts\030\006 \003(\0132,.go" + - "ogle.cloud.speech.v1p1beta1.SpeechContex" + - "t\022 \n\030enable_word_time_offsets\030\010 \001(\010\022\036\n\026e" + - "nable_word_confidence\030\017 \001(\010\022$\n\034enable_au" + - "tomatic_punctuation\030\013 \001(\010\022=\n\031enable_spok" + - "en_punctuation\030\026 \001(\0132\032.google.protobuf.B" + - "oolValue\0228\n\024enable_spoken_emojis\030\027 \001(\0132\032" + - ".google.protobuf.BoolValue\022&\n\032enable_spe" + - "aker_diarization\030\020 \001(\010B\002\030\001\022%\n\031diarizatio" + - "n_speaker_count\030\021 \001(\005B\002\030\001\022S\n\022diarization" + - "_config\030\023 \001(\01327.google.cloud.speech.v1p1" + - "beta1.SpeakerDiarizationConfig\022D\n\010metada" + - "ta\030\t \001(\01322.google.cloud.speech.v1p1beta1" + - ".RecognitionMetadata\022\r\n\005model\030\r \001(\t\022\024\n\014u" + - "se_enhanced\030\016 \001(\010\"\243\001\n\rAudioEncoding\022\030\n\024E" + - "NCODING_UNSPECIFIED\020\000\022\014\n\010LINEAR16\020\001\022\010\n\004F" + - "LAC\020\002\022\t\n\005MULAW\020\003\022\007\n\003AMR\020\004\022\n\n\006AMR_WB\020\005\022\014\n" + - "\010OGG_OPUS\020\006\022\032\n\026SPEEX_WITH_HEADER_BYTE\020\007\022" + - "\007\n\003MP3\020\010\022\r\n\tWEBM_OPUS\020\t\"\220\001\n\030SpeakerDiari" + - "zationConfig\022\"\n\032enable_speaker_diarizati" + - "on\030\001 \001(\010\022\031\n\021min_speaker_count\030\002 \001(\005\022\031\n\021m" + - "ax_speaker_count\030\003 \001(\005\022\032\n\013speaker_tag\030\005 " + - "\001(\005B\005\030\001\340A\003\"\333\010\n\023RecognitionMetadata\022\\\n\020in" + - "teraction_type\030\001 \001(\0162B.google.cloud.spee" + - "ch.v1p1beta1.RecognitionMetadata.Interac" + - "tionType\022$\n\034industry_naics_code_of_audio" + - "\030\003 \001(\r\022b\n\023microphone_distance\030\004 \001(\0162E.go" + - "ogle.cloud.speech.v1p1beta1.RecognitionM" + - "etadata.MicrophoneDistance\022a\n\023original_m" + - "edia_type\030\005 \001(\0162D.google.cloud.speech.v1" + - "p1beta1.RecognitionMetadata.OriginalMedi" + - "aType\022e\n\025recording_device_type\030\006 \001(\0162F.g" + - "oogle.cloud.speech.v1p1beta1.Recognition" + - "Metadata.RecordingDeviceType\022\035\n\025recordin" + - "g_device_name\030\007 \001(\t\022\032\n\022original_mime_typ" + - "e\030\010 \001(\t\022\031\n\robfuscated_id\030\t \001(\003B\002\030\001\022\023\n\013au" + - "dio_topic\030\n \001(\t\"\305\001\n\017InteractionType\022 \n\034I" + - "NTERACTION_TYPE_UNSPECIFIED\020\000\022\016\n\nDISCUSS" + - "ION\020\001\022\020\n\014PRESENTATION\020\002\022\016\n\nPHONE_CALL\020\003\022" + - "\r\n\tVOICEMAIL\020\004\022\033\n\027PROFESSIONALLY_PRODUCE" + - "D\020\005\022\020\n\014VOICE_SEARCH\020\006\022\021\n\rVOICE_COMMAND\020\007" + - "\022\r\n\tDICTATION\020\010\"d\n\022MicrophoneDistance\022#\n" + - "\037MICROPHONE_DISTANCE_UNSPECIFIED\020\000\022\r\n\tNE" + - "ARFIELD\020\001\022\014\n\010MIDFIELD\020\002\022\014\n\010FARFIELD\020\003\"N\n" + - "\021OriginalMediaType\022#\n\037ORIGINAL_MEDIA_TYP" + - "E_UNSPECIFIED\020\000\022\t\n\005AUDIO\020\001\022\t\n\005VIDEO\020\002\"\244\001" + - "\n\023RecordingDeviceType\022%\n!RECORDING_DEVIC" + - "E_TYPE_UNSPECIFIED\020\000\022\016\n\nSMARTPHONE\020\001\022\006\n\002" + - "PC\020\002\022\016\n\nPHONE_LINE\020\003\022\013\n\007VEHICLE\020\004\022\030\n\024OTH" + - "ER_OUTDOOR_DEVICE\020\005\022\027\n\023OTHER_INDOOR_DEVI" + - "CE\020\006:\002\030\001\"/\n\rSpeechContext\022\017\n\007phrases\030\001 \003" + - "(\t\022\r\n\005boost\030\004 \001(\002\"D\n\020RecognitionAudio\022\021\n" + - "\007content\030\001 \001(\014H\000\022\r\n\003uri\030\002 \001(\tH\000B\016\n\014audio" + - "_source\"\222\001\n\021RecognizeResponse\022G\n\007results" + - "\030\002 \003(\01326.google.cloud.speech.v1p1beta1.S" + - "peechRecognitionResult\0224\n\021total_billed_t" + - "ime\030\003 \001(\0132\031.google.protobuf.Duration\"\225\002\n" + - "\034LongRunningRecognizeResponse\022G\n\007results" + - "\030\002 \003(\01326.google.cloud.speech.v1p1beta1.S" + - "peechRecognitionResult\0224\n\021total_billed_t" + - "ime\030\003 \001(\0132\031.google.protobuf.Duration\022L\n\r" + - "output_config\030\006 \001(\01325.google.cloud.speec" + - "h.v1p1beta1.TranscriptOutputConfig\022(\n\014ou" + - "tput_error\030\007 \001(\0132\022.google.rpc.Status\"\203\002\n" + - "\034LongRunningRecognizeMetadata\022\030\n\020progres" + - "s_percent\030\001 \001(\005\022.\n\nstart_time\030\002 \001(\0132\032.go" + - "ogle.protobuf.Timestamp\0224\n\020last_update_t" + - "ime\030\003 \001(\0132\032.google.protobuf.Timestamp\022\020\n" + - "\003uri\030\004 \001(\tB\003\340A\003\022Q\n\routput_config\030\005 \001(\01325" + - ".google.cloud.speech.v1p1beta1.Transcrip" + - "tOutputConfigB\003\340A\003\"\365\002\n\032StreamingRecogniz" + - "eResponse\022!\n\005error\030\001 \001(\0132\022.google.rpc.St" + - "atus\022J\n\007results\030\002 \003(\01329.google.cloud.spe" + - "ech.v1p1beta1.StreamingRecognitionResult" + - "\022d\n\021speech_event_type\030\004 \001(\0162I.google.clo" + - "ud.speech.v1p1beta1.StreamingRecognizeRe" + - "sponse.SpeechEventType\0224\n\021total_billed_t" + - "ime\030\005 \001(\0132\031.google.protobuf.Duration\"L\n\017" + - "SpeechEventType\022\034\n\030SPEECH_EVENT_UNSPECIF" + - "IED\020\000\022\033\n\027END_OF_SINGLE_UTTERANCE\020\001\"\371\001\n\032S" + - "treamingRecognitionResult\022Q\n\014alternative" + - "s\030\001 \003(\0132;.google.cloud.speech.v1p1beta1." + - "SpeechRecognitionAlternative\022\020\n\010is_final" + - "\030\002 \001(\010\022\021\n\tstability\030\003 \001(\002\0222\n\017result_end_" + - "time\030\004 \001(\0132\031.google.protobuf.Duration\022\023\n" + - "\013channel_tag\030\005 \001(\005\022\032\n\rlanguage_code\030\006 \001(" + - "\tB\003\340A\003\"\321\001\n\027SpeechRecognitionResult\022Q\n\014al" + - "ternatives\030\001 \003(\0132;.google.cloud.speech.v" + - "1p1beta1.SpeechRecognitionAlternative\022\023\n" + - "\013channel_tag\030\002 \001(\005\0222\n\017result_end_time\030\004 " + - "\001(\0132\031.google.protobuf.Duration\022\032\n\rlangua" + - "ge_code\030\005 \001(\tB\003\340A\003\"~\n\034SpeechRecognitionA" + - "lternative\022\022\n\ntranscript\030\001 \001(\t\022\022\n\nconfid" + - "ence\030\002 \001(\002\0226\n\005words\030\003 \003(\0132\'.google.cloud" + - ".speech.v1p1beta1.WordInfo\"\242\001\n\010WordInfo\022" + - "-\n\nstart_time\030\001 \001(\0132\031.google.protobuf.Du" + - "ration\022+\n\010end_time\030\002 \001(\0132\031.google.protob" + - "uf.Duration\022\014\n\004word\030\003 \001(\t\022\022\n\nconfidence\030" + - "\004 \001(\002\022\030\n\013speaker_tag\030\005 \001(\005B\003\340A\0032\202\005\n\006Spee" + - "ch\022\245\001\n\tRecognize\022/.google.cloud.speech.v" + - "1p1beta1.RecognizeRequest\0320.google.cloud" + - ".speech.v1p1beta1.RecognizeResponse\"5\202\323\344" + - "\223\002 \"\033/v1p1beta1/speech:recognize:\001*\332A\014co" + - "nfig,audio\022\362\001\n\024LongRunningRecognize\022:.go" + - "ogle.cloud.speech.v1p1beta1.LongRunningR" + - "ecognizeRequest\032\035.google.longrunning.Ope" + - "ration\"\177\202\323\344\223\002+\"&/v1p1beta1/speech:longru" + - "nningrecognize:\001*\332A\014config,audio\312A<\n\034Lon" + - "gRunningRecognizeResponse\022\034LongRunningRe" + - "cognizeMetadata\022\217\001\n\022StreamingRecognize\0228" + - ".google.cloud.speech.v1p1beta1.Streaming" + - "RecognizeRequest\0329.google.cloud.speech.v" + - "1p1beta1.StreamingRecognizeResponse\"\000(\0010" + - "\001\032I\312A\025speech.googleapis.com\322A.https://ww" + - "w.googleapis.com/auth/cloud-platformB\200\001\n" + - "!com.google.cloud.speech.v1p1beta1B\013Spee" + - "chProtoP\001ZCgoogle.golang.org/genproto/go" + - "ogleapis/cloud/speech/v1p1beta1;speech\370\001" + - "\001\242\002\003GCSb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.api.ClientProto.getDescriptor(), - com.google.api.FieldBehaviorProto.getDescriptor(), - com.google.cloud.speech.v1p1beta1.SpeechResourceProto.getDescriptor(), - com.google.longrunning.OperationsProto.getDescriptor(), - com.google.protobuf.DurationProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - com.google.protobuf.WrappersProto.getDescriptor(), - com.google.rpc.StatusProto.getDescriptor(), - }); - internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_RecognizeRequest_descriptor, - new java.lang.String[] { "Config", "Audio", }); - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeRequest_descriptor, - new java.lang.String[] { "Config", "Audio", "OutputConfig", }); - internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_descriptor, - new java.lang.String[] { "GcsUri", "OutputType", }); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor, - new java.lang.String[] { "StreamingConfig", "AudioContent", "StreamingRequest", }); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor, - new java.lang.String[] { "Config", "SingleUtterance", "InterimResults", }); - internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_RecognitionConfig_descriptor, - new java.lang.String[] { "Encoding", "SampleRateHertz", "AudioChannelCount", "EnableSeparateRecognitionPerChannel", "LanguageCode", "AlternativeLanguageCodes", "MaxAlternatives", "ProfanityFilter", "Adaptation", "TranscriptNormalization", "SpeechContexts", "EnableWordTimeOffsets", "EnableWordConfidence", "EnableAutomaticPunctuation", "EnableSpokenPunctuation", "EnableSpokenEmojis", "EnableSpeakerDiarization", "DiarizationSpeakerCount", "DiarizationConfig", "Metadata", "Model", "UseEnhanced", }); - internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor = - getDescriptor().getMessageTypes().get(6); - internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_SpeakerDiarizationConfig_descriptor, - new java.lang.String[] { "EnableSpeakerDiarization", "MinSpeakerCount", "MaxSpeakerCount", "SpeakerTag", }); - internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_RecognitionMetadata_descriptor, - new java.lang.String[] { "InteractionType", "IndustryNaicsCodeOfAudio", "MicrophoneDistance", "OriginalMediaType", "RecordingDeviceType", "RecordingDeviceName", "OriginalMimeType", "ObfuscatedId", "AudioTopic", }); - internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor = - getDescriptor().getMessageTypes().get(8); - internal_static_google_cloud_speech_v1p1beta1_SpeechContext_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_SpeechContext_descriptor, - new java.lang.String[] { "Phrases", "Boost", }); - internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor = - getDescriptor().getMessageTypes().get(9); - internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_RecognitionAudio_descriptor, - new java.lang.String[] { "Content", "Uri", "AudioSource", }); - internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_RecognizeResponse_descriptor, - new java.lang.String[] { "Results", "TotalBilledTime", }); - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor = - getDescriptor().getMessageTypes().get(11); - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeResponse_descriptor, - new java.lang.String[] { "Results", "TotalBilledTime", "OutputConfig", "OutputError", }); - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor = - getDescriptor().getMessageTypes().get(12); - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_LongRunningRecognizeMetadata_descriptor, - new java.lang.String[] { "ProgressPercent", "StartTime", "LastUpdateTime", "Uri", "OutputConfig", }); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor = - getDescriptor().getMessageTypes().get(13); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor, - new java.lang.String[] { "Error", "Results", "SpeechEventType", "TotalBilledTime", }); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor = - getDescriptor().getMessageTypes().get(14); - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor, - new java.lang.String[] { "Alternatives", "IsFinal", "Stability", "ResultEndTime", "ChannelTag", "LanguageCode", }); - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor = - getDescriptor().getMessageTypes().get(15); - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor, - new java.lang.String[] { "Alternatives", "ChannelTag", "ResultEndTime", "LanguageCode", }); - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor = - getDescriptor().getMessageTypes().get(16); - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor, - new java.lang.String[] { "Transcript", "Confidence", "Words", }); - internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor = - getDescriptor().getMessageTypes().get(17); - internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor, - new java.lang.String[] { "StartTime", "EndTime", "Word", "Confidence", "SpeakerTag", }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.ClientProto.defaultHost); - registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); - registry.add(com.google.api.AnnotationsProto.http); - registry.add(com.google.api.ClientProto.methodSignature); - registry.add(com.google.api.ClientProto.oauthScopes); - registry.add(com.google.longrunning.OperationsProto.operationInfo); - com.google.protobuf.Descriptors.FileDescriptor - .internalUpdateFileDescriptor(descriptor, registry); - com.google.api.AnnotationsProto.getDescriptor(); - com.google.api.ClientProto.getDescriptor(); - com.google.api.FieldBehaviorProto.getDescriptor(); - com.google.cloud.speech.v1p1beta1.SpeechResourceProto.getDescriptor(); - com.google.longrunning.OperationsProto.getDescriptor(); - com.google.protobuf.DurationProto.getDescriptor(); - com.google.protobuf.TimestampProto.getDescriptor(); - com.google.protobuf.WrappersProto.getDescriptor(); - com.google.rpc.StatusProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternative.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternative.java deleted file mode 100644 index d016049a2b08..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternative.java +++ /dev/null @@ -1,1211 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Alternative hypotheses (a.k.a. n-best list).
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} - */ -public final class SpeechRecognitionAlternative extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) - SpeechRecognitionAlternativeOrBuilder { -private static final long serialVersionUID = 0L; - // Use SpeechRecognitionAlternative.newBuilder() to construct. - private SpeechRecognitionAlternative(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SpeechRecognitionAlternative() { - transcript_ = ""; - words_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SpeechRecognitionAlternative(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SpeechRecognitionAlternative( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - transcript_ = s; - break; - } - case 21: { - - confidence_ = input.readFloat(); - break; - } - case 26: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - words_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - words_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.WordInfo.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - words_ = java.util.Collections.unmodifiableList(words_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.class, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder.class); - } - - public static final int TRANSCRIPT_FIELD_NUMBER = 1; - private volatile java.lang.Object transcript_; - /** - *
-   * Transcript text representing the words that the user spoke.
-   * In languages that use spaces to separate words, the transcript might have a
-   * leading space if it isn't the first result. You can concatenate each result
-   * to obtain the full transcript without using a separator.
-   * 
- * - * string transcript = 1; - * @return The transcript. - */ - @java.lang.Override - public java.lang.String getTranscript() { - java.lang.Object ref = transcript_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - transcript_ = s; - return s; - } - } - /** - *
-   * Transcript text representing the words that the user spoke.
-   * In languages that use spaces to separate words, the transcript might have a
-   * leading space if it isn't the first result. You can concatenate each result
-   * to obtain the full transcript without using a separator.
-   * 
- * - * string transcript = 1; - * @return The bytes for transcript. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getTranscriptBytes() { - java.lang.Object ref = transcript_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - transcript_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONFIDENCE_FIELD_NUMBER = 2; - private float confidence_; - /** - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 2; - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - - public static final int WORDS_FIELD_NUMBER = 3; - private java.util.List words_; - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - @java.lang.Override - public java.util.List getWordsList() { - return words_; - } - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - @java.lang.Override - public java.util.List - getWordsOrBuilderList() { - return words_; - } - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - @java.lang.Override - public int getWordsCount() { - return words_.size(); - } - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.WordInfo getWords(int index) { - return words_.get(index); - } - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder getWordsOrBuilder( - int index) { - return words_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(transcript_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, transcript_); - } - if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { - output.writeFloat(2, confidence_); - } - for (int i = 0; i < words_.size(); i++) { - output.writeMessage(3, words_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(transcript_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, transcript_); - } - if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(2, confidence_); - } - for (int i = 0; i < words_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, words_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative other = (com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) obj; - - if (!getTranscript() - .equals(other.getTranscript())) return false; - if (java.lang.Float.floatToIntBits(getConfidence()) - != java.lang.Float.floatToIntBits( - other.getConfidence())) return false; - if (!getWordsList() - .equals(other.getWordsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TRANSCRIPT_FIELD_NUMBER; - hash = (53 * hash) + getTranscript().hashCode(); - hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getConfidence()); - if (getWordsCount() > 0) { - hash = (37 * hash) + WORDS_FIELD_NUMBER; - hash = (53 * hash) + getWordsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Alternative hypotheses (a.k.a. n-best list).
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.class, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getWordsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - transcript_ = ""; - - confidence_ = 0F; - - if (wordsBuilder_ == null) { - words_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - wordsBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionAlternative_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative build() { - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative buildPartial() { - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative result = new com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative(this); - int from_bitField0_ = bitField0_; - result.transcript_ = transcript_; - result.confidence_ = confidence_; - if (wordsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - words_ = java.util.Collections.unmodifiableList(words_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.words_ = words_; - } else { - result.words_ = wordsBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative other) { - if (other == com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()) return this; - if (!other.getTranscript().isEmpty()) { - transcript_ = other.transcript_; - onChanged(); - } - if (other.getConfidence() != 0F) { - setConfidence(other.getConfidence()); - } - if (wordsBuilder_ == null) { - if (!other.words_.isEmpty()) { - if (words_.isEmpty()) { - words_ = other.words_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureWordsIsMutable(); - words_.addAll(other.words_); - } - onChanged(); - } - } else { - if (!other.words_.isEmpty()) { - if (wordsBuilder_.isEmpty()) { - wordsBuilder_.dispose(); - wordsBuilder_ = null; - words_ = other.words_; - bitField0_ = (bitField0_ & ~0x00000001); - wordsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getWordsFieldBuilder() : null; - } else { - wordsBuilder_.addAllMessages(other.words_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.lang.Object transcript_ = ""; - /** - *
-     * Transcript text representing the words that the user spoke.
-     * In languages that use spaces to separate words, the transcript might have a
-     * leading space if it isn't the first result. You can concatenate each result
-     * to obtain the full transcript without using a separator.
-     * 
- * - * string transcript = 1; - * @return The transcript. - */ - public java.lang.String getTranscript() { - java.lang.Object ref = transcript_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - transcript_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Transcript text representing the words that the user spoke.
-     * In languages that use spaces to separate words, the transcript might have a
-     * leading space if it isn't the first result. You can concatenate each result
-     * to obtain the full transcript without using a separator.
-     * 
- * - * string transcript = 1; - * @return The bytes for transcript. - */ - public com.google.protobuf.ByteString - getTranscriptBytes() { - java.lang.Object ref = transcript_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - transcript_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Transcript text representing the words that the user spoke.
-     * In languages that use spaces to separate words, the transcript might have a
-     * leading space if it isn't the first result. You can concatenate each result
-     * to obtain the full transcript without using a separator.
-     * 
- * - * string transcript = 1; - * @param value The transcript to set. - * @return This builder for chaining. - */ - public Builder setTranscript( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - transcript_ = value; - onChanged(); - return this; - } - /** - *
-     * Transcript text representing the words that the user spoke.
-     * In languages that use spaces to separate words, the transcript might have a
-     * leading space if it isn't the first result. You can concatenate each result
-     * to obtain the full transcript without using a separator.
-     * 
- * - * string transcript = 1; - * @return This builder for chaining. - */ - public Builder clearTranscript() { - - transcript_ = getDefaultInstance().getTranscript(); - onChanged(); - return this; - } - /** - *
-     * Transcript text representing the words that the user spoke.
-     * In languages that use spaces to separate words, the transcript might have a
-     * leading space if it isn't the first result. You can concatenate each result
-     * to obtain the full transcript without using a separator.
-     * 
- * - * string transcript = 1; - * @param value The bytes for transcript to set. - * @return This builder for chaining. - */ - public Builder setTranscriptBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - transcript_ = value; - onChanged(); - return this; - } - - private float confidence_ ; - /** - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - /** - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - * @param value The confidence to set. - * @return This builder for chaining. - */ - public Builder setConfidence(float value) { - - confidence_ = value; - onChanged(); - return this; - } - /** - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 2; - * @return This builder for chaining. - */ - public Builder clearConfidence() { - - confidence_ = 0F; - onChanged(); - return this; - } - - private java.util.List words_ = - java.util.Collections.emptyList(); - private void ensureWordsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - words_ = new java.util.ArrayList(words_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.WordInfo, com.google.cloud.speech.v1p1beta1.WordInfo.Builder, com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder> wordsBuilder_; - - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public java.util.List getWordsList() { - if (wordsBuilder_ == null) { - return java.util.Collections.unmodifiableList(words_); - } else { - return wordsBuilder_.getMessageList(); - } - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public int getWordsCount() { - if (wordsBuilder_ == null) { - return words_.size(); - } else { - return wordsBuilder_.getCount(); - } - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1p1beta1.WordInfo getWords(int index) { - if (wordsBuilder_ == null) { - return words_.get(index); - } else { - return wordsBuilder_.getMessage(index); - } - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder setWords( - int index, com.google.cloud.speech.v1p1beta1.WordInfo value) { - if (wordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.set(index, value); - onChanged(); - } else { - wordsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder setWords( - int index, com.google.cloud.speech.v1p1beta1.WordInfo.Builder builderForValue) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.set(index, builderForValue.build()); - onChanged(); - } else { - wordsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder addWords(com.google.cloud.speech.v1p1beta1.WordInfo value) { - if (wordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.add(value); - onChanged(); - } else { - wordsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder addWords( - int index, com.google.cloud.speech.v1p1beta1.WordInfo value) { - if (wordsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureWordsIsMutable(); - words_.add(index, value); - onChanged(); - } else { - wordsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder addWords( - com.google.cloud.speech.v1p1beta1.WordInfo.Builder builderForValue) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.add(builderForValue.build()); - onChanged(); - } else { - wordsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder addWords( - int index, com.google.cloud.speech.v1p1beta1.WordInfo.Builder builderForValue) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.add(index, builderForValue.build()); - onChanged(); - } else { - wordsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder addAllWords( - java.lang.Iterable values) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, words_); - onChanged(); - } else { - wordsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder clearWords() { - if (wordsBuilder_ == null) { - words_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - wordsBuilder_.clear(); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public Builder removeWords(int index) { - if (wordsBuilder_ == null) { - ensureWordsIsMutable(); - words_.remove(index); - onChanged(); - } else { - wordsBuilder_.remove(index); - } - return this; - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1p1beta1.WordInfo.Builder getWordsBuilder( - int index) { - return getWordsFieldBuilder().getBuilder(index); - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder getWordsOrBuilder( - int index) { - if (wordsBuilder_ == null) { - return words_.get(index); } else { - return wordsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public java.util.List - getWordsOrBuilderList() { - if (wordsBuilder_ != null) { - return wordsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(words_); - } - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1p1beta1.WordInfo.Builder addWordsBuilder() { - return getWordsFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.WordInfo.getDefaultInstance()); - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public com.google.cloud.speech.v1p1beta1.WordInfo.Builder addWordsBuilder( - int index) { - return getWordsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.WordInfo.getDefaultInstance()); - } - /** - *
-     * A list of word-specific information for each recognized word.
-     * Note: When `enable_speaker_diarization` is true, you will see all the words
-     * from the beginning of the audio.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - public java.util.List - getWordsBuilderList() { - return getWordsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.WordInfo, com.google.cloud.speech.v1p1beta1.WordInfo.Builder, com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder> - getWordsFieldBuilder() { - if (wordsBuilder_ == null) { - wordsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.WordInfo, com.google.cloud.speech.v1p1beta1.WordInfo.Builder, com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder>( - words_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - words_ = null; - } - return wordsBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) - private static final com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative(); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechRecognitionAlternative parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechRecognitionAlternative(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternativeOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternativeOrBuilder.java deleted file mode 100644 index 24dc349ab976..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionAlternativeOrBuilder.java +++ /dev/null @@ -1,105 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface SpeechRecognitionAlternativeOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Transcript text representing the words that the user spoke.
-   * In languages that use spaces to separate words, the transcript might have a
-   * leading space if it isn't the first result. You can concatenate each result
-   * to obtain the full transcript without using a separator.
-   * 
- * - * string transcript = 1; - * @return The transcript. - */ - java.lang.String getTranscript(); - /** - *
-   * Transcript text representing the words that the user spoke.
-   * In languages that use spaces to separate words, the transcript might have a
-   * leading space if it isn't the first result. You can concatenate each result
-   * to obtain the full transcript without using a separator.
-   * 
- * - * string transcript = 1; - * @return The bytes for transcript. - */ - com.google.protobuf.ByteString - getTranscriptBytes(); - - /** - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 2; - * @return The confidence. - */ - float getConfidence(); - - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - java.util.List - getWordsList(); - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - com.google.cloud.speech.v1p1beta1.WordInfo getWords(int index); - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - int getWordsCount(); - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - java.util.List - getWordsOrBuilderList(); - /** - *
-   * A list of word-specific information for each recognized word.
-   * Note: When `enable_speaker_diarization` is true, you will see all the words
-   * from the beginning of the audio.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.WordInfo words = 3; - */ - com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder getWordsOrBuilder( - int index); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResult.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResult.java deleted file mode 100644 index 9636912bbe44..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResult.java +++ /dev/null @@ -1,1457 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * A speech recognition result corresponding to a portion of the audio.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechRecognitionResult} - */ -public final class SpeechRecognitionResult extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) - SpeechRecognitionResultOrBuilder { -private static final long serialVersionUID = 0L; - // Use SpeechRecognitionResult.newBuilder() to construct. - private SpeechRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private SpeechRecognitionResult() { - alternatives_ = java.util.Collections.emptyList(); - languageCode_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new SpeechRecognitionResult(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private SpeechRecognitionResult( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - alternatives_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.parser(), extensionRegistry)); - break; - } - case 16: { - - channelTag_ = input.readInt32(); - break; - } - case 34: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (resultEndTime_ != null) { - subBuilder = resultEndTime_.toBuilder(); - } - resultEndTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(resultEndTime_); - resultEndTime_ = subBuilder.buildPartial(); - } - - break; - } - case 42: { - java.lang.String s = input.readStringRequireUtf8(); - - languageCode_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.class, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder.class); - } - - public static final int ALTERNATIVES_FIELD_NUMBER = 1; - private java.util.List alternatives_; - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public java.util.List getAlternativesList() { - return alternatives_; - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public java.util.List - getAlternativesOrBuilderList() { - return alternatives_; - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public int getAlternativesCount() { - return alternatives_.size(); - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index) { - return alternatives_.get(index); - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index) { - return alternatives_.get(index); - } - - public static final int CHANNEL_TAG_FIELD_NUMBER = 2; - private int channelTag_; - /** - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 2; - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - - public static final int RESULT_END_TIME_FIELD_NUMBER = 4; - private com.google.protobuf.Duration resultEndTime_; - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return Whether the resultEndTime field is set. - */ - @java.lang.Override - public boolean hasResultEndTime() { - return resultEndTime_ != null; - } - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return The resultEndTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getResultEndTime() { - return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; - } - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { - return getResultEndTime(); - } - - public static final int LANGUAGE_CODE_FIELD_NUMBER = 5; - private volatile java.lang.Object languageCode_; - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The languageCode. - */ - @java.lang.Override - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } - } - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for languageCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < alternatives_.size(); i++) { - output.writeMessage(1, alternatives_.get(i)); - } - if (channelTag_ != 0) { - output.writeInt32(2, channelTag_); - } - if (resultEndTime_ != null) { - output.writeMessage(4, getResultEndTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, languageCode_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < alternatives_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, alternatives_.get(i)); - } - if (channelTag_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, channelTag_); - } - if (resultEndTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getResultEndTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, languageCode_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult other = (com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult) obj; - - if (!getAlternativesList() - .equals(other.getAlternativesList())) return false; - if (getChannelTag() - != other.getChannelTag()) return false; - if (hasResultEndTime() != other.hasResultEndTime()) return false; - if (hasResultEndTime()) { - if (!getResultEndTime() - .equals(other.getResultEndTime())) return false; - } - if (!getLanguageCode() - .equals(other.getLanguageCode())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAlternativesCount() > 0) { - hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativesList().hashCode(); - } - hash = (37 * hash) + CHANNEL_TAG_FIELD_NUMBER; - hash = (53 * hash) + getChannelTag(); - if (hasResultEndTime()) { - hash = (37 * hash) + RESULT_END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getResultEndTime().hashCode(); - } - hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getLanguageCode().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * A speech recognition result corresponding to a portion of the audio.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.SpeechRecognitionResult} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResultOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.class, com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getAlternativesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - alternativesBuilder_.clear(); - } - channelTag_ = 0; - - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = null; - } else { - resultEndTime_ = null; - resultEndTimeBuilder_ = null; - } - languageCode_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_SpeechRecognitionResult_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult build() { - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult buildPartial() { - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult result = new com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult(this); - int from_bitField0_ = bitField0_; - if (alternativesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternatives_ = alternatives_; - } else { - result.alternatives_ = alternativesBuilder_.build(); - } - result.channelTag_ = channelTag_; - if (resultEndTimeBuilder_ == null) { - result.resultEndTime_ = resultEndTime_; - } else { - result.resultEndTime_ = resultEndTimeBuilder_.build(); - } - result.languageCode_ = languageCode_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult other) { - if (other == com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult.getDefaultInstance()) return this; - if (alternativesBuilder_ == null) { - if (!other.alternatives_.isEmpty()) { - if (alternatives_.isEmpty()) { - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativesIsMutable(); - alternatives_.addAll(other.alternatives_); - } - onChanged(); - } - } else { - if (!other.alternatives_.isEmpty()) { - if (alternativesBuilder_.isEmpty()) { - alternativesBuilder_.dispose(); - alternativesBuilder_ = null; - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - alternativesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAlternativesFieldBuilder() : null; - } else { - alternativesBuilder_.addAllMessages(other.alternatives_); - } - } - } - if (other.getChannelTag() != 0) { - setChannelTag(other.getChannelTag()); - } - if (other.hasResultEndTime()) { - mergeResultEndTime(other.getResultEndTime()); - } - if (!other.getLanguageCode().isEmpty()) { - languageCode_ = other.languageCode_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List alternatives_ = - java.util.Collections.emptyList(); - private void ensureAlternativesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - alternatives_ = new java.util.ArrayList(alternatives_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> alternativesBuilder_; - - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List getAlternativesList() { - if (alternativesBuilder_ == null) { - return java.util.Collections.unmodifiableList(alternatives_); - } else { - return alternativesBuilder_.getMessageList(); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public int getAlternativesCount() { - if (alternativesBuilder_ == null) { - return alternatives_.size(); - } else { - return alternativesBuilder_.getCount(); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessage(index); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.set(index, value); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.set(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(value); - onChanged(); - } else { - alternativesBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(index, value); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAllAlternatives( - java.lang.Iterable values) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, alternatives_); - onChanged(); - } else { - alternativesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder clearAlternatives() { - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - alternativesBuilder_.clear(); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder removeAlternatives(int index) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.remove(index); - onChanged(); - } else { - alternativesBuilder_.remove(index); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder getAlternativesBuilder( - int index) { - return getAlternativesFieldBuilder().getBuilder(index); - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); } else { - return alternativesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List - getAlternativesOrBuilderList() { - if (alternativesBuilder_ != null) { - return alternativesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(alternatives_); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder addAlternativesBuilder() { - return getAlternativesFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder addAlternativesBuilder( - int index) { - return getAlternativesFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List - getAlternativesBuilderList() { - return getAlternativesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesFieldBuilder() { - if (alternativesBuilder_ == null) { - alternativesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder>( - alternatives_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - alternatives_ = null; - } - return alternativesBuilder_; - } - - private int channelTag_ ; - /** - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 2; - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - /** - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 2; - * @param value The channelTag to set. - * @return This builder for chaining. - */ - public Builder setChannelTag(int value) { - - channelTag_ = value; - onChanged(); - return this; - } - /** - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 2; - * @return This builder for chaining. - */ - public Builder clearChannelTag() { - - channelTag_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Duration resultEndTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> resultEndTimeBuilder_; - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return Whether the resultEndTime field is set. - */ - public boolean hasResultEndTime() { - return resultEndTimeBuilder_ != null || resultEndTime_ != null; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return The resultEndTime. - */ - public com.google.protobuf.Duration getResultEndTime() { - if (resultEndTimeBuilder_ == null) { - return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; - } else { - return resultEndTimeBuilder_.getMessage(); - } - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder setResultEndTime(com.google.protobuf.Duration value) { - if (resultEndTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - resultEndTime_ = value; - onChanged(); - } else { - resultEndTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder setResultEndTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = builderForValue.build(); - onChanged(); - } else { - resultEndTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder mergeResultEndTime(com.google.protobuf.Duration value) { - if (resultEndTimeBuilder_ == null) { - if (resultEndTime_ != null) { - resultEndTime_ = - com.google.protobuf.Duration.newBuilder(resultEndTime_).mergeFrom(value).buildPartial(); - } else { - resultEndTime_ = value; - } - onChanged(); - } else { - resultEndTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder clearResultEndTime() { - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = null; - onChanged(); - } else { - resultEndTime_ = null; - resultEndTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public com.google.protobuf.Duration.Builder getResultEndTimeBuilder() { - - onChanged(); - return getResultEndTimeFieldBuilder().getBuilder(); - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { - if (resultEndTimeBuilder_ != null) { - return resultEndTimeBuilder_.getMessageOrBuilder(); - } else { - return resultEndTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; - } - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getResultEndTimeFieldBuilder() { - if (resultEndTimeBuilder_ == null) { - resultEndTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getResultEndTime(), - getParentForChildren(), - isClean()); - resultEndTime_ = null; - } - return resultEndTimeBuilder_; - } - - private java.lang.Object languageCode_ = ""; - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The languageCode. - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for languageCode. - */ - public com.google.protobuf.ByteString - getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCode( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - languageCode_ = value; - onChanged(); - return this; - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return This builder for chaining. - */ - public Builder clearLanguageCode() { - - languageCode_ = getDefaultInstance().getLanguageCode(); - onChanged(); - return this; - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The bytes for languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCodeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - languageCode_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) - private static final com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult(); - } - - public static com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public SpeechRecognitionResult parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new SpeechRecognitionResult(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResultOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResultOrBuilder.java deleted file mode 100644 index 55e3c978e3c9..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechRecognitionResultOrBuilder.java +++ /dev/null @@ -1,134 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface SpeechRecognitionResultOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - java.util.List - getAlternativesList(); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - int getAlternativesCount(); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - java.util.List - getAlternativesOrBuilderList(); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index); - - /** - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 2; - * @return The channelTag. - */ - int getChannelTag(); - - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return Whether the resultEndTime field is set. - */ - boolean hasResultEndTime(); - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return The resultEndTime. - */ - com.google.protobuf.Duration getResultEndTime(); - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder(); - - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The languageCode. - */ - java.lang.String getLanguageCode(); - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for languageCode. - */ - com.google.protobuf.ByteString - getLanguageCodeBytes(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java deleted file mode 100644 index 64362624dc97..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/SpeechResourceProto.java +++ /dev/null @@ -1,148 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -public final class SpeechResourceProto { - private SpeechResourceProto() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_CustomClass_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n,google/cloud/speech/v1p1beta1/resource" + - ".proto\022\035google.cloud.speech.v1p1beta1\032\031g" + - "oogle/api/resource.proto\"\203\002\n\013CustomClass" + - "\022\014\n\004name\030\001 \001(\t\022\027\n\017custom_class_id\030\002 \001(\t\022" + - "C\n\005items\030\003 \003(\01324.google.cloud.speech.v1p" + - "1beta1.CustomClass.ClassItem\032\032\n\tClassIte" + - "m\022\r\n\005value\030\001 \001(\t:l\352Ai\n!speech.googleapis" + - ".com/CustomClass\022Dprojects/{project}/loc" + - "ations/{location}/customClasses/{custom_" + - "class}\"\371\001\n\tPhraseSet\022\014\n\004name\030\001 \001(\t\022@\n\007ph" + - "rases\030\002 \003(\0132/.google.cloud.speech.v1p1be" + - "ta1.PhraseSet.Phrase\022\r\n\005boost\030\004 \001(\002\032&\n\006P" + - "hrase\022\r\n\005value\030\001 \001(\t\022\r\n\005boost\030\002 \001(\002:e\352Ab" + - "\n\037speech.googleapis.com/PhraseSet\022?proje" + - "cts/{project}/locations/{location}/phras" + - "eSets/{phrase_set}\"\332\001\n\020SpeechAdaptation\022" + - "=\n\013phrase_sets\030\001 \003(\0132(.google.cloud.spee" + - "ch.v1p1beta1.PhraseSet\022C\n\025phrase_set_ref" + - "erences\030\002 \003(\tB$\372A!\n\037speech.googleapis.co" + - "m/PhraseSet\022B\n\016custom_classes\030\003 \003(\0132*.go" + - "ogle.cloud.speech.v1p1beta1.CustomClass\"" + - "\252\001\n\027TranscriptNormalization\022M\n\007entries\030\001" + - " \003(\0132<.google.cloud.speech.v1p1beta1.Tra" + - "nscriptNormalization.Entry\032@\n\005Entry\022\016\n\006s" + - "earch\030\001 \001(\t\022\017\n\007replace\030\002 \001(\t\022\026\n\016case_sen" + - "sitive\030\003 \001(\010B\210\001\n!com.google.cloud.speech" + - ".v1p1beta1B\023SpeechResourceProtoP\001ZCgoogl" + - "e.golang.org/genproto/googleapis/cloud/s" + - "peech/v1p1beta1;speech\370\001\001\242\002\003GCSb\006proto3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.ResourceProto.getDescriptor(), - }); - internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_google_cloud_speech_v1p1beta1_CustomClass_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor, - new java.lang.String[] { "Name", "CustomClassId", "Items", }); - internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor = - internal_static_google_cloud_speech_v1p1beta1_CustomClass_descriptor.getNestedTypes().get(0); - internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_CustomClass_ClassItem_descriptor, - new java.lang.String[] { "Value", }); - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor, - new java.lang.String[] { "Name", "Phrases", "Boost", }); - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor = - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_descriptor.getNestedTypes().get(0); - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_PhraseSet_Phrase_descriptor, - new java.lang.String[] { "Value", "Boost", }); - internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_SpeechAdaptation_descriptor, - new java.lang.String[] { "PhraseSets", "PhraseSetReferences", "CustomClasses", }); - internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor, - new java.lang.String[] { "Entries", }); - internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_descriptor = - internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor.getNestedTypes().get(0); - internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_descriptor, - new java.lang.String[] { "Search", "Replace", "CaseSensitive", }); - com.google.protobuf.ExtensionRegistry registry = - com.google.protobuf.ExtensionRegistry.newInstance(); - registry.add(com.google.api.ResourceProto.resource); - registry.add(com.google.api.ResourceProto.resourceReference); - com.google.protobuf.Descriptors.FileDescriptor - .internalUpdateFileDescriptor(descriptor, registry); - com.google.api.ResourceProto.getDescriptor(); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java deleted file mode 100644 index cdf053e413d7..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfig.java +++ /dev/null @@ -1,921 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Provides information to the recognizer that specifies how to process the
- * request.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} - */ -public final class StreamingRecognitionConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - StreamingRecognitionConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use StreamingRecognitionConfig.newBuilder() to construct. - private StreamingRecognitionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamingRecognitionConfig() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StreamingRecognitionConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamingRecognitionConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder subBuilder = null; - if (config_ != null) { - subBuilder = config_.toBuilder(); - } - config_ = input.readMessage(com.google.cloud.speech.v1p1beta1.RecognitionConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(config_); - config_ = subBuilder.buildPartial(); - } - - break; - } - case 16: { - - singleUtterance_ = input.readBool(); - break; - } - case 24: { - - interimResults_ = input.readBool(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.class, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder.class); - } - - public static final int CONFIG_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - @java.lang.Override - public boolean hasConfig() { - return config_ != null; - } - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { - return config_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; - } - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - return getConfig(); - } - - public static final int SINGLE_UTTERANCE_FIELD_NUMBER = 2; - private boolean singleUtterance_; - /** - *
-   * If `false` or omitted, the recognizer will perform continuous
-   * recognition (continuing to wait for and process audio even if the user
-   * pauses speaking) until the client closes the input stream (gRPC API) or
-   * until the maximum time limit has been reached. May return multiple
-   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-   * If `true`, the recognizer will detect a single spoken utterance. When it
-   * detects that the user has paused or stopped speaking, it will return an
-   * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-   * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-   * `true`.
-   * The `single_utterance` field can only be used with specified models,
-   * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
-   * must be set to:
-   * * `command_and_search`
-   * * `phone_call` AND additional field `useEnhanced`=`true`
-   * * The `model` field is left undefined. In this case the API auto-selects
-   *   a model based on any other parameters that you set in
-   *   `RecognitionConfig`.
-   * 
- * - * bool single_utterance = 2; - * @return The singleUtterance. - */ - @java.lang.Override - public boolean getSingleUtterance() { - return singleUtterance_; - } - - public static final int INTERIM_RESULTS_FIELD_NUMBER = 3; - private boolean interimResults_; - /** - *
-   * If `true`, interim results (tentative hypotheses) may be
-   * returned as they become available (these interim results are indicated with
-   * the `is_final=false` flag).
-   * If `false` or omitted, only `is_final=true` result(s) are returned.
-   * 
- * - * bool interim_results = 3; - * @return The interimResults. - */ - @java.lang.Override - public boolean getInterimResults() { - return interimResults_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (config_ != null) { - output.writeMessage(1, getConfig()); - } - if (singleUtterance_ != false) { - output.writeBool(2, singleUtterance_); - } - if (interimResults_ != false) { - output.writeBool(3, interimResults_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (config_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getConfig()); - } - if (singleUtterance_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, singleUtterance_); - } - if (interimResults_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, interimResults_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig other = (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) obj; - - if (hasConfig() != other.hasConfig()) return false; - if (hasConfig()) { - if (!getConfig() - .equals(other.getConfig())) return false; - } - if (getSingleUtterance() - != other.getSingleUtterance()) return false; - if (getInterimResults() - != other.getInterimResults()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasConfig()) { - hash = (37 * hash) + CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getConfig().hashCode(); - } - hash = (37 * hash) + SINGLE_UTTERANCE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSingleUtterance()); - hash = (37 * hash) + INTERIM_RESULTS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getInterimResults()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognitionConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.class, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (configBuilder_ == null) { - config_ = null; - } else { - config_ = null; - configBuilder_ = null; - } - singleUtterance_ = false; - - interimResults_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig build() { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig buildPartial() { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig result = new com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig(this); - if (configBuilder_ == null) { - result.config_ = config_; - } else { - result.config_ = configBuilder_.build(); - } - result.singleUtterance_ = singleUtterance_; - result.interimResults_ = interimResults_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig other) { - if (other == com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance()) return this; - if (other.hasConfig()) { - mergeConfig(other.getConfig()); - } - if (other.getSingleUtterance() != false) { - setSingleUtterance(other.getSingleUtterance()); - } - if (other.getInterimResults() != false) { - setInterimResults(other.getInterimResults()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1p1beta1.RecognitionConfig config_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> configBuilder_; - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - public boolean hasConfig() { - return configBuilder_ != null || config_ != null; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig() { - if (configBuilder_ == null) { - return config_ == null ? com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; - } else { - return configBuilder_.getMessage(); - } - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - config_ = value; - onChanged(); - } else { - configBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setConfig( - com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder builderForValue) { - if (configBuilder_ == null) { - config_ = builderForValue.build(); - onChanged(); - } else { - configBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeConfig(com.google.cloud.speech.v1p1beta1.RecognitionConfig value) { - if (configBuilder_ == null) { - if (config_ != null) { - config_ = - com.google.cloud.speech.v1p1beta1.RecognitionConfig.newBuilder(config_).mergeFrom(value).buildPartial(); - } else { - config_ = value; - } - onChanged(); - } else { - configBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearConfig() { - if (configBuilder_ == null) { - config_ = null; - onChanged(); - } else { - config_ = null; - configBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder getConfigBuilder() { - - onChanged(); - return getConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder() { - if (configBuilder_ != null) { - return configBuilder_.getMessageOrBuilder(); - } else { - return config_ == null ? - com.google.cloud.speech.v1p1beta1.RecognitionConfig.getDefaultInstance() : config_; - } - } - /** - *
-     * Required. Provides information to the recognizer that specifies how to
-     * process the request.
-     * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder> - getConfigFieldBuilder() { - if (configBuilder_ == null) { - configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.RecognitionConfig, com.google.cloud.speech.v1p1beta1.RecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder>( - getConfig(), - getParentForChildren(), - isClean()); - config_ = null; - } - return configBuilder_; - } - - private boolean singleUtterance_ ; - /** - *
-     * If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-     * `true`.
-     * The `single_utterance` field can only be used with specified models,
-     * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
-     * must be set to:
-     * * `command_and_search`
-     * * `phone_call` AND additional field `useEnhanced`=`true`
-     * * The `model` field is left undefined. In this case the API auto-selects
-     *   a model based on any other parameters that you set in
-     *   `RecognitionConfig`.
-     * 
- * - * bool single_utterance = 2; - * @return The singleUtterance. - */ - @java.lang.Override - public boolean getSingleUtterance() { - return singleUtterance_; - } - /** - *
-     * If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-     * `true`.
-     * The `single_utterance` field can only be used with specified models,
-     * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
-     * must be set to:
-     * * `command_and_search`
-     * * `phone_call` AND additional field `useEnhanced`=`true`
-     * * The `model` field is left undefined. In this case the API auto-selects
-     *   a model based on any other parameters that you set in
-     *   `RecognitionConfig`.
-     * 
- * - * bool single_utterance = 2; - * @param value The singleUtterance to set. - * @return This builder for chaining. - */ - public Builder setSingleUtterance(boolean value) { - - singleUtterance_ = value; - onChanged(); - return this; - } - /** - *
-     * If `false` or omitted, the recognizer will perform continuous
-     * recognition (continuing to wait for and process audio even if the user
-     * pauses speaking) until the client closes the input stream (gRPC API) or
-     * until the maximum time limit has been reached. May return multiple
-     * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-     * If `true`, the recognizer will detect a single spoken utterance. When it
-     * detects that the user has paused or stopped speaking, it will return an
-     * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-     * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-     * `true`.
-     * The `single_utterance` field can only be used with specified models,
-     * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
-     * must be set to:
-     * * `command_and_search`
-     * * `phone_call` AND additional field `useEnhanced`=`true`
-     * * The `model` field is left undefined. In this case the API auto-selects
-     *   a model based on any other parameters that you set in
-     *   `RecognitionConfig`.
-     * 
- * - * bool single_utterance = 2; - * @return This builder for chaining. - */ - public Builder clearSingleUtterance() { - - singleUtterance_ = false; - onChanged(); - return this; - } - - private boolean interimResults_ ; - /** - *
-     * If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - * @return The interimResults. - */ - @java.lang.Override - public boolean getInterimResults() { - return interimResults_; - } - /** - *
-     * If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - * @param value The interimResults to set. - * @return This builder for chaining. - */ - public Builder setInterimResults(boolean value) { - - interimResults_ = value; - onChanged(); - return this; - } - /** - *
-     * If `true`, interim results (tentative hypotheses) may be
-     * returned as they become available (these interim results are indicated with
-     * the `is_final=false` flag).
-     * If `false` or omitted, only `is_final=true` result(s) are returned.
-     * 
- * - * bool interim_results = 3; - * @return This builder for chaining. - */ - public Builder clearInterimResults() { - - interimResults_ = false; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - private static final com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig(); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognitionConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognitionConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java deleted file mode 100644 index 73a8d60b1e89..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionConfigOrBuilder.java +++ /dev/null @@ -1,79 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface StreamingRecognitionConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the config field is set. - */ - boolean hasConfig(); - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The config. - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfig getConfig(); - /** - *
-   * Required. Provides information to the recognizer that specifies how to
-   * process the request.
-   * 
- * - * .google.cloud.speech.v1p1beta1.RecognitionConfig config = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1p1beta1.RecognitionConfigOrBuilder getConfigOrBuilder(); - - /** - *
-   * If `false` or omitted, the recognizer will perform continuous
-   * recognition (continuing to wait for and process audio even if the user
-   * pauses speaking) until the client closes the input stream (gRPC API) or
-   * until the maximum time limit has been reached. May return multiple
-   * `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
-   * If `true`, the recognizer will detect a single spoken utterance. When it
-   * detects that the user has paused or stopped speaking, it will return an
-   * `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
-   * more than one `StreamingRecognitionResult` with the `is_final` flag set to
-   * `true`.
-   * The `single_utterance` field can only be used with specified models,
-   * otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
-   * must be set to:
-   * * `command_and_search`
-   * * `phone_call` AND additional field `useEnhanced`=`true`
-   * * The `model` field is left undefined. In this case the API auto-selects
-   *   a model based on any other parameters that you set in
-   *   `RecognitionConfig`.
-   * 
- * - * bool single_utterance = 2; - * @return The singleUtterance. - */ - boolean getSingleUtterance(); - - /** - *
-   * If `true`, interim results (tentative hypotheses) may be
-   * returned as they become available (these interim results are indicated with
-   * the `is_final=false` flag).
-   * If `false` or omitted, only `is_final=true` result(s) are returned.
-   * 
- * - * bool interim_results = 3; - * @return The interimResults. - */ - boolean getInterimResults(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResult.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResult.java deleted file mode 100644 index 21fdf7d844b0..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResult.java +++ /dev/null @@ -1,1654 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * A streaming speech recognition result corresponding to a portion of the audio
- * that is currently being processed.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognitionResult} - */ -public final class StreamingRecognitionResult extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) - StreamingRecognitionResultOrBuilder { -private static final long serialVersionUID = 0L; - // Use StreamingRecognitionResult.newBuilder() to construct. - private StreamingRecognitionResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamingRecognitionResult() { - alternatives_ = java.util.Collections.emptyList(); - languageCode_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StreamingRecognitionResult(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamingRecognitionResult( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - alternatives_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.parser(), extensionRegistry)); - break; - } - case 16: { - - isFinal_ = input.readBool(); - break; - } - case 29: { - - stability_ = input.readFloat(); - break; - } - case 34: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (resultEndTime_ != null) { - subBuilder = resultEndTime_.toBuilder(); - } - resultEndTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(resultEndTime_); - resultEndTime_ = subBuilder.buildPartial(); - } - - break; - } - case 40: { - - channelTag_ = input.readInt32(); - break; - } - case 50: { - java.lang.String s = input.readStringRequireUtf8(); - - languageCode_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.class, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder.class); - } - - public static final int ALTERNATIVES_FIELD_NUMBER = 1; - private java.util.List alternatives_; - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public java.util.List getAlternativesList() { - return alternatives_; - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public java.util.List - getAlternativesOrBuilderList() { - return alternatives_; - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public int getAlternativesCount() { - return alternatives_.size(); - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index) { - return alternatives_.get(index); - } - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index) { - return alternatives_.get(index); - } - - public static final int IS_FINAL_FIELD_NUMBER = 2; - private boolean isFinal_; - /** - *
-   * If `false`, this `StreamingRecognitionResult` represents an
-   * interim result that may change. If `true`, this is the final time the
-   * speech service will return this particular `StreamingRecognitionResult`,
-   * the recognizer will not return any further hypotheses for this portion of
-   * the transcript and corresponding audio.
-   * 
- * - * bool is_final = 2; - * @return The isFinal. - */ - @java.lang.Override - public boolean getIsFinal() { - return isFinal_; - } - - public static final int STABILITY_FIELD_NUMBER = 3; - private float stability_; - /** - *
-   * An estimate of the likelihood that the recognizer will not
-   * change its guess about this interim result. Values range from 0.0
-   * (completely unstable) to 1.0 (completely stable).
-   * This field is only provided for interim results (`is_final=false`).
-   * The default of 0.0 is a sentinel value indicating `stability` was not set.
-   * 
- * - * float stability = 3; - * @return The stability. - */ - @java.lang.Override - public float getStability() { - return stability_; - } - - public static final int RESULT_END_TIME_FIELD_NUMBER = 4; - private com.google.protobuf.Duration resultEndTime_; - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return Whether the resultEndTime field is set. - */ - @java.lang.Override - public boolean hasResultEndTime() { - return resultEndTime_ != null; - } - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return The resultEndTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getResultEndTime() { - return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; - } - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { - return getResultEndTime(); - } - - public static final int CHANNEL_TAG_FIELD_NUMBER = 5; - private int channelTag_; - /** - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 5; - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - - public static final int LANGUAGE_CODE_FIELD_NUMBER = 6; - private volatile java.lang.Object languageCode_; - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The languageCode. - */ - @java.lang.Override - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } - } - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for languageCode. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < alternatives_.size(); i++) { - output.writeMessage(1, alternatives_.get(i)); - } - if (isFinal_ != false) { - output.writeBool(2, isFinal_); - } - if (java.lang.Float.floatToRawIntBits(stability_) != 0) { - output.writeFloat(3, stability_); - } - if (resultEndTime_ != null) { - output.writeMessage(4, getResultEndTime()); - } - if (channelTag_ != 0) { - output.writeInt32(5, channelTag_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, languageCode_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < alternatives_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, alternatives_.get(i)); - } - if (isFinal_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, isFinal_); - } - if (java.lang.Float.floatToRawIntBits(stability_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(3, stability_); - } - if (resultEndTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getResultEndTime()); - } - if (channelTag_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, channelTag_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, languageCode_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult other = (com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult) obj; - - if (!getAlternativesList() - .equals(other.getAlternativesList())) return false; - if (getIsFinal() - != other.getIsFinal()) return false; - if (java.lang.Float.floatToIntBits(getStability()) - != java.lang.Float.floatToIntBits( - other.getStability())) return false; - if (hasResultEndTime() != other.hasResultEndTime()) return false; - if (hasResultEndTime()) { - if (!getResultEndTime() - .equals(other.getResultEndTime())) return false; - } - if (getChannelTag() - != other.getChannelTag()) return false; - if (!getLanguageCode() - .equals(other.getLanguageCode())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getAlternativesCount() > 0) { - hash = (37 * hash) + ALTERNATIVES_FIELD_NUMBER; - hash = (53 * hash) + getAlternativesList().hashCode(); - } - hash = (37 * hash) + IS_FINAL_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getIsFinal()); - hash = (37 * hash) + STABILITY_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getStability()); - if (hasResultEndTime()) { - hash = (37 * hash) + RESULT_END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getResultEndTime().hashCode(); - } - hash = (37 * hash) + CHANNEL_TAG_FIELD_NUMBER; - hash = (53 * hash) + getChannelTag(); - hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; - hash = (53 * hash) + getLanguageCode().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * A streaming speech recognition result corresponding to a portion of the audio
-   * that is currently being processed.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognitionResult} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.class, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getAlternativesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - alternativesBuilder_.clear(); - } - isFinal_ = false; - - stability_ = 0F; - - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = null; - } else { - resultEndTime_ = null; - resultEndTimeBuilder_ = null; - } - channelTag_ = 0; - - languageCode_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognitionResult_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult build() { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult buildPartial() { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult result = new com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult(this); - int from_bitField0_ = bitField0_; - if (alternativesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - alternatives_ = java.util.Collections.unmodifiableList(alternatives_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.alternatives_ = alternatives_; - } else { - result.alternatives_ = alternativesBuilder_.build(); - } - result.isFinal_ = isFinal_; - result.stability_ = stability_; - if (resultEndTimeBuilder_ == null) { - result.resultEndTime_ = resultEndTime_; - } else { - result.resultEndTime_ = resultEndTimeBuilder_.build(); - } - result.channelTag_ = channelTag_; - result.languageCode_ = languageCode_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult other) { - if (other == com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.getDefaultInstance()) return this; - if (alternativesBuilder_ == null) { - if (!other.alternatives_.isEmpty()) { - if (alternatives_.isEmpty()) { - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureAlternativesIsMutable(); - alternatives_.addAll(other.alternatives_); - } - onChanged(); - } - } else { - if (!other.alternatives_.isEmpty()) { - if (alternativesBuilder_.isEmpty()) { - alternativesBuilder_.dispose(); - alternativesBuilder_ = null; - alternatives_ = other.alternatives_; - bitField0_ = (bitField0_ & ~0x00000001); - alternativesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getAlternativesFieldBuilder() : null; - } else { - alternativesBuilder_.addAllMessages(other.alternatives_); - } - } - } - if (other.getIsFinal() != false) { - setIsFinal(other.getIsFinal()); - } - if (other.getStability() != 0F) { - setStability(other.getStability()); - } - if (other.hasResultEndTime()) { - mergeResultEndTime(other.getResultEndTime()); - } - if (other.getChannelTag() != 0) { - setChannelTag(other.getChannelTag()); - } - if (!other.getLanguageCode().isEmpty()) { - languageCode_ = other.languageCode_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List alternatives_ = - java.util.Collections.emptyList(); - private void ensureAlternativesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - alternatives_ = new java.util.ArrayList(alternatives_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> alternativesBuilder_; - - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List getAlternativesList() { - if (alternativesBuilder_ == null) { - return java.util.Collections.unmodifiableList(alternatives_); - } else { - return alternativesBuilder_.getMessageList(); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public int getAlternativesCount() { - if (alternativesBuilder_ == null) { - return alternatives_.size(); - } else { - return alternativesBuilder_.getCount(); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); - } else { - return alternativesBuilder_.getMessage(index); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.set(index, value); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder setAlternatives( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.set(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives(com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(value); - onChanged(); - } else { - alternativesBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative value) { - if (alternativesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureAlternativesIsMutable(); - alternatives_.add(index, value); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAlternatives( - int index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder builderForValue) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.add(index, builderForValue.build()); - onChanged(); - } else { - alternativesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder addAllAlternatives( - java.lang.Iterable values) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, alternatives_); - onChanged(); - } else { - alternativesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder clearAlternatives() { - if (alternativesBuilder_ == null) { - alternatives_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - alternativesBuilder_.clear(); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public Builder removeAlternatives(int index) { - if (alternativesBuilder_ == null) { - ensureAlternativesIsMutable(); - alternatives_.remove(index); - onChanged(); - } else { - alternativesBuilder_.remove(index); - } - return this; - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder getAlternativesBuilder( - int index) { - return getAlternativesFieldBuilder().getBuilder(index); - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index) { - if (alternativesBuilder_ == null) { - return alternatives_.get(index); } else { - return alternativesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List - getAlternativesOrBuilderList() { - if (alternativesBuilder_ != null) { - return alternativesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(alternatives_); - } - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder addAlternativesBuilder() { - return getAlternativesFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder addAlternativesBuilder( - int index) { - return getAlternativesFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.getDefaultInstance()); - } - /** - *
-     * May contain one or more recognition hypotheses (up to the
-     * maximum specified in `max_alternatives`).
-     * These alternatives are ordered in terms of accuracy, with the top (first)
-     * alternative being the most probable, as ranked by the recognizer.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - public java.util.List - getAlternativesBuilderList() { - return getAlternativesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder> - getAlternativesFieldBuilder() { - if (alternativesBuilder_ == null) { - alternativesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.Builder, com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder>( - alternatives_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - alternatives_ = null; - } - return alternativesBuilder_; - } - - private boolean isFinal_ ; - /** - *
-     * If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - * @return The isFinal. - */ - @java.lang.Override - public boolean getIsFinal() { - return isFinal_; - } - /** - *
-     * If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - * @param value The isFinal to set. - * @return This builder for chaining. - */ - public Builder setIsFinal(boolean value) { - - isFinal_ = value; - onChanged(); - return this; - } - /** - *
-     * If `false`, this `StreamingRecognitionResult` represents an
-     * interim result that may change. If `true`, this is the final time the
-     * speech service will return this particular `StreamingRecognitionResult`,
-     * the recognizer will not return any further hypotheses for this portion of
-     * the transcript and corresponding audio.
-     * 
- * - * bool is_final = 2; - * @return This builder for chaining. - */ - public Builder clearIsFinal() { - - isFinal_ = false; - onChanged(); - return this; - } - - private float stability_ ; - /** - *
-     * An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - * @return The stability. - */ - @java.lang.Override - public float getStability() { - return stability_; - } - /** - *
-     * An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - * @param value The stability to set. - * @return This builder for chaining. - */ - public Builder setStability(float value) { - - stability_ = value; - onChanged(); - return this; - } - /** - *
-     * An estimate of the likelihood that the recognizer will not
-     * change its guess about this interim result. Values range from 0.0
-     * (completely unstable) to 1.0 (completely stable).
-     * This field is only provided for interim results (`is_final=false`).
-     * The default of 0.0 is a sentinel value indicating `stability` was not set.
-     * 
- * - * float stability = 3; - * @return This builder for chaining. - */ - public Builder clearStability() { - - stability_ = 0F; - onChanged(); - return this; - } - - private com.google.protobuf.Duration resultEndTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> resultEndTimeBuilder_; - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return Whether the resultEndTime field is set. - */ - public boolean hasResultEndTime() { - return resultEndTimeBuilder_ != null || resultEndTime_ != null; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return The resultEndTime. - */ - public com.google.protobuf.Duration getResultEndTime() { - if (resultEndTimeBuilder_ == null) { - return resultEndTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; - } else { - return resultEndTimeBuilder_.getMessage(); - } - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder setResultEndTime(com.google.protobuf.Duration value) { - if (resultEndTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - resultEndTime_ = value; - onChanged(); - } else { - resultEndTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder setResultEndTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = builderForValue.build(); - onChanged(); - } else { - resultEndTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder mergeResultEndTime(com.google.protobuf.Duration value) { - if (resultEndTimeBuilder_ == null) { - if (resultEndTime_ != null) { - resultEndTime_ = - com.google.protobuf.Duration.newBuilder(resultEndTime_).mergeFrom(value).buildPartial(); - } else { - resultEndTime_ = value; - } - onChanged(); - } else { - resultEndTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public Builder clearResultEndTime() { - if (resultEndTimeBuilder_ == null) { - resultEndTime_ = null; - onChanged(); - } else { - resultEndTime_ = null; - resultEndTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public com.google.protobuf.Duration.Builder getResultEndTimeBuilder() { - - onChanged(); - return getResultEndTimeFieldBuilder().getBuilder(); - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - public com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder() { - if (resultEndTimeBuilder_ != null) { - return resultEndTimeBuilder_.getMessageOrBuilder(); - } else { - return resultEndTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : resultEndTime_; - } - } - /** - *
-     * Time offset of the end of this result relative to the
-     * beginning of the audio.
-     * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getResultEndTimeFieldBuilder() { - if (resultEndTimeBuilder_ == null) { - resultEndTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getResultEndTime(), - getParentForChildren(), - isClean()); - resultEndTime_ = null; - } - return resultEndTimeBuilder_; - } - - private int channelTag_ ; - /** - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 5; - * @return The channelTag. - */ - @java.lang.Override - public int getChannelTag() { - return channelTag_; - } - /** - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 5; - * @param value The channelTag to set. - * @return This builder for chaining. - */ - public Builder setChannelTag(int value) { - - channelTag_ = value; - onChanged(); - return this; - } - /** - *
-     * For multi-channel audio, this is the channel number corresponding to the
-     * recognized result for the audio from that channel.
-     * For audio_channel_count = N, its output values can range from '1' to 'N'.
-     * 
- * - * int32 channel_tag = 5; - * @return This builder for chaining. - */ - public Builder clearChannelTag() { - - channelTag_ = 0; - onChanged(); - return this; - } - - private java.lang.Object languageCode_ = ""; - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The languageCode. - */ - public java.lang.String getLanguageCode() { - java.lang.Object ref = languageCode_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - languageCode_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for languageCode. - */ - public com.google.protobuf.ByteString - getLanguageCodeBytes() { - java.lang.Object ref = languageCode_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - languageCode_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCode( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - languageCode_ = value; - onChanged(); - return this; - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return This builder for chaining. - */ - public Builder clearLanguageCode() { - - languageCode_ = getDefaultInstance().getLanguageCode(); - onChanged(); - return this; - } - /** - *
-     * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-     * of the language in this result. This language code was detected to have
-     * the most likelihood of being spoken in the audio.
-     * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The bytes for languageCode to set. - * @return This builder for chaining. - */ - public Builder setLanguageCodeBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - languageCode_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) - private static final com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult(); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognitionResult parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognitionResult(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResultOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResultOrBuilder.java deleted file mode 100644 index 3d6da9c0a6f4..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognitionResultOrBuilder.java +++ /dev/null @@ -1,162 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface StreamingRecognitionResultOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - java.util.List - getAlternativesList(); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative getAlternatives(int index); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - int getAlternativesCount(); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - java.util.List - getAlternativesOrBuilderList(); - /** - *
-   * May contain one or more recognition hypotheses (up to the
-   * maximum specified in `max_alternatives`).
-   * These alternatives are ordered in terms of accuracy, with the top (first)
-   * alternative being the most probable, as ranked by the recognizer.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative alternatives = 1; - */ - com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternativeOrBuilder getAlternativesOrBuilder( - int index); - - /** - *
-   * If `false`, this `StreamingRecognitionResult` represents an
-   * interim result that may change. If `true`, this is the final time the
-   * speech service will return this particular `StreamingRecognitionResult`,
-   * the recognizer will not return any further hypotheses for this portion of
-   * the transcript and corresponding audio.
-   * 
- * - * bool is_final = 2; - * @return The isFinal. - */ - boolean getIsFinal(); - - /** - *
-   * An estimate of the likelihood that the recognizer will not
-   * change its guess about this interim result. Values range from 0.0
-   * (completely unstable) to 1.0 (completely stable).
-   * This field is only provided for interim results (`is_final=false`).
-   * The default of 0.0 is a sentinel value indicating `stability` was not set.
-   * 
- * - * float stability = 3; - * @return The stability. - */ - float getStability(); - - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return Whether the resultEndTime field is set. - */ - boolean hasResultEndTime(); - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - * @return The resultEndTime. - */ - com.google.protobuf.Duration getResultEndTime(); - /** - *
-   * Time offset of the end of this result relative to the
-   * beginning of the audio.
-   * 
- * - * .google.protobuf.Duration result_end_time = 4; - */ - com.google.protobuf.DurationOrBuilder getResultEndTimeOrBuilder(); - - /** - *
-   * For multi-channel audio, this is the channel number corresponding to the
-   * recognized result for the audio from that channel.
-   * For audio_channel_count = N, its output values can range from '1' to 'N'.
-   * 
- * - * int32 channel_tag = 5; - * @return The channelTag. - */ - int getChannelTag(); - - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The languageCode. - */ - java.lang.String getLanguageCode(); - /** - *
-   * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
-   * of the language in this result. This language code was detected to have
-   * the most likelihood of being spoken in the audio.
-   * 
- * - * string language_code = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The bytes for languageCode. - */ - com.google.protobuf.ByteString - getLanguageCodeBytes(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequest.java deleted file mode 100644 index 5c7c200e1200..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequest.java +++ /dev/null @@ -1,955 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * The top-level message sent by the client for the `StreamingRecognize` method.
- * Multiple `StreamingRecognizeRequest` messages are sent. The first message
- * must contain a `streaming_config` message and must not contain
- * `audio_content`. All subsequent messages must contain `audio_content` and
- * must not contain a `streaming_config` message.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} - */ -public final class StreamingRecognizeRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) - StreamingRecognizeRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use StreamingRecognizeRequest.newBuilder() to construct. - private StreamingRecognizeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamingRecognizeRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StreamingRecognizeRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamingRecognizeRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder subBuilder = null; - if (streamingRequestCase_ == 1) { - subBuilder = ((com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_).toBuilder(); - } - streamingRequest_ = - input.readMessage(com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_); - streamingRequest_ = subBuilder.buildPartial(); - } - streamingRequestCase_ = 1; - break; - } - case 18: { - streamingRequest_ = input.readBytes(); - streamingRequestCase_ = 2; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.class, com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.Builder.class); - } - - private int streamingRequestCase_ = 0; - private java.lang.Object streamingRequest_; - public enum StreamingRequestCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - STREAMING_CONFIG(1), - AUDIO_CONTENT(2), - STREAMINGREQUEST_NOT_SET(0); - private final int value; - private StreamingRequestCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static StreamingRequestCase valueOf(int value) { - return forNumber(value); - } - - public static StreamingRequestCase forNumber(int value) { - switch (value) { - case 1: return STREAMING_CONFIG; - case 2: return AUDIO_CONTENT; - case 0: return STREAMINGREQUEST_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public StreamingRequestCase - getStreamingRequestCase() { - return StreamingRequestCase.forNumber( - streamingRequestCase_); - } - - public static final int STREAMING_CONFIG_FIELD_NUMBER = 1; - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - * @return Whether the streamingConfig field is set. - */ - @java.lang.Override - public boolean hasStreamingConfig() { - return streamingRequestCase_ == 1; - } - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - * @return The streamingConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getStreamingConfig() { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder() { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - - public static final int AUDIO_CONTENT_FIELD_NUMBER = 2; - /** - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation (not base64). See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * bytes audio_content = 2; - * @return Whether the audioContent field is set. - */ - @java.lang.Override - public boolean hasAudioContent() { - return streamingRequestCase_ == 2; - } - /** - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation (not base64). See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * bytes audio_content = 2; - * @return The audioContent. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAudioContent() { - if (streamingRequestCase_ == 2) { - return (com.google.protobuf.ByteString) streamingRequest_; - } - return com.google.protobuf.ByteString.EMPTY; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (streamingRequestCase_ == 1) { - output.writeMessage(1, (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_); - } - if (streamingRequestCase_ == 2) { - output.writeBytes( - 2, (com.google.protobuf.ByteString) streamingRequest_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (streamingRequestCase_ == 1) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_); - } - if (streamingRequestCase_ == 2) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize( - 2, (com.google.protobuf.ByteString) streamingRequest_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest other = (com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) obj; - - if (!getStreamingRequestCase().equals(other.getStreamingRequestCase())) return false; - switch (streamingRequestCase_) { - case 1: - if (!getStreamingConfig() - .equals(other.getStreamingConfig())) return false; - break; - case 2: - if (!getAudioContent() - .equals(other.getAudioContent())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (streamingRequestCase_) { - case 1: - hash = (37 * hash) + STREAMING_CONFIG_FIELD_NUMBER; - hash = (53 * hash) + getStreamingConfig().hashCode(); - break; - case 2: - hash = (37 * hash) + AUDIO_CONTENT_FIELD_NUMBER; - hash = (53 * hash) + getAudioContent().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * The top-level message sent by the client for the `StreamingRecognize` method.
-   * Multiple `StreamingRecognizeRequest` messages are sent. The first message
-   * must contain a `streaming_config` message and must not contain
-   * `audio_content`. All subsequent messages must contain `audio_content` and
-   * must not contain a `streaming_config` message.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognizeRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.class, com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - streamingRequestCase_ = 0; - streamingRequest_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest build() { - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest result = new com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest(this); - if (streamingRequestCase_ == 1) { - if (streamingConfigBuilder_ == null) { - result.streamingRequest_ = streamingRequest_; - } else { - result.streamingRequest_ = streamingConfigBuilder_.build(); - } - } - if (streamingRequestCase_ == 2) { - result.streamingRequest_ = streamingRequest_; - } - result.streamingRequestCase_ = streamingRequestCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.getDefaultInstance()) return this; - switch (other.getStreamingRequestCase()) { - case STREAMING_CONFIG: { - mergeStreamingConfig(other.getStreamingConfig()); - break; - } - case AUDIO_CONTENT: { - setAudioContent(other.getAudioContent()); - break; - } - case STREAMINGREQUEST_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int streamingRequestCase_ = 0; - private java.lang.Object streamingRequest_; - public StreamingRequestCase - getStreamingRequestCase() { - return StreamingRequestCase.forNumber( - streamingRequestCase_); - } - - public Builder clearStreamingRequest() { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - return this; - } - - - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder> streamingConfigBuilder_; - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - * @return Whether the streamingConfig field is set. - */ - @java.lang.Override - public boolean hasStreamingConfig() { - return streamingRequestCase_ == 1; - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - * @return The streamingConfig. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getStreamingConfig() { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } else { - if (streamingRequestCase_ == 1) { - return streamingConfigBuilder_.getMessage(); - } - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder setStreamingConfig(com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig value) { - if (streamingConfigBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - streamingRequest_ = value; - onChanged(); - } else { - streamingConfigBuilder_.setMessage(value); - } - streamingRequestCase_ = 1; - return this; - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder setStreamingConfig( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder builderForValue) { - if (streamingConfigBuilder_ == null) { - streamingRequest_ = builderForValue.build(); - onChanged(); - } else { - streamingConfigBuilder_.setMessage(builderForValue.build()); - } - streamingRequestCase_ = 1; - return this; - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder mergeStreamingConfig(com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig value) { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1 && - streamingRequest_ != com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance()) { - streamingRequest_ = com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.newBuilder((com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_) - .mergeFrom(value).buildPartial(); - } else { - streamingRequest_ = value; - } - onChanged(); - } else { - if (streamingRequestCase_ == 1) { - streamingConfigBuilder_.mergeFrom(value); - } else { - streamingConfigBuilder_.setMessage(value); - } - } - streamingRequestCase_ = 1; - return this; - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public Builder clearStreamingConfig() { - if (streamingConfigBuilder_ == null) { - if (streamingRequestCase_ == 1) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - } - } else { - if (streamingRequestCase_ == 1) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - } - streamingConfigBuilder_.clear(); - } - return this; - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder getStreamingConfigBuilder() { - return getStreamingConfigFieldBuilder().getBuilder(); - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder() { - if ((streamingRequestCase_ == 1) && (streamingConfigBuilder_ != null)) { - return streamingConfigBuilder_.getMessageOrBuilder(); - } else { - if (streamingRequestCase_ == 1) { - return (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_; - } - return com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - } - /** - *
-     * Provides information to the recognizer that specifies how to process the
-     * request. The first `StreamingRecognizeRequest` message must contain a
-     * `streaming_config`  message.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder> - getStreamingConfigFieldBuilder() { - if (streamingConfigBuilder_ == null) { - if (!(streamingRequestCase_ == 1)) { - streamingRequest_ = com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.getDefaultInstance(); - } - streamingConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.Builder, com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder>( - (com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) streamingRequest_, - getParentForChildren(), - isClean()); - streamingRequest_ = null; - } - streamingRequestCase_ = 1; - onChanged();; - return streamingConfigBuilder_; - } - - /** - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * @return Whether the audioContent field is set. - */ - public boolean hasAudioContent() { - return streamingRequestCase_ == 2; - } - /** - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * @return The audioContent. - */ - public com.google.protobuf.ByteString getAudioContent() { - if (streamingRequestCase_ == 2) { - return (com.google.protobuf.ByteString) streamingRequest_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * @param value The audioContent to set. - * @return This builder for chaining. - */ - public Builder setAudioContent(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - streamingRequestCase_ = 2; - streamingRequest_ = value; - onChanged(); - return this; - } - /** - *
-     * The audio data to be recognized. Sequential chunks of audio data are sent
-     * in sequential `StreamingRecognizeRequest` messages. The first
-     * `StreamingRecognizeRequest` message must not contain `audio_content` data
-     * and all subsequent `StreamingRecognizeRequest` messages must contain
-     * `audio_content` data. The audio bytes must be encoded as specified in
-     * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-     * pure binary representation (not base64). See
-     * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-     * 
- * - * bytes audio_content = 2; - * @return This builder for chaining. - */ - public Builder clearAudioContent() { - if (streamingRequestCase_ == 2) { - streamingRequestCase_ = 0; - streamingRequest_ = null; - onChanged(); - } - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) - private static final com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognizeRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognizeRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java deleted file mode 100644 index e77bf66cfcba..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeRequestOrBuilder.java +++ /dev/null @@ -1,77 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface StreamingRecognizeRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - * @return Whether the streamingConfig field is set. - */ - boolean hasStreamingConfig(); - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - * @return The streamingConfig. - */ - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfig getStreamingConfig(); - /** - *
-   * Provides information to the recognizer that specifies how to process the
-   * request. The first `StreamingRecognizeRequest` message must contain a
-   * `streaming_config`  message.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognitionConfig streaming_config = 1; - */ - com.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigOrBuilder getStreamingConfigOrBuilder(); - - /** - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation (not base64). See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * bytes audio_content = 2; - * @return Whether the audioContent field is set. - */ - boolean hasAudioContent(); - /** - *
-   * The audio data to be recognized. Sequential chunks of audio data are sent
-   * in sequential `StreamingRecognizeRequest` messages. The first
-   * `StreamingRecognizeRequest` message must not contain `audio_content` data
-   * and all subsequent `StreamingRecognizeRequest` messages must contain
-   * `audio_content` data. The audio bytes must be encoded as specified in
-   * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
-   * pure binary representation (not base64). See
-   * [content limits](https://cloud.google.com/speech-to-text/quotas#content).
-   * 
- * - * bytes audio_content = 2; - * @return The audioContent. - */ - com.google.protobuf.ByteString getAudioContent(); - - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.StreamingRequestCase getStreamingRequestCase(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java deleted file mode 100644 index cf81fdc8c87a..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponse.java +++ /dev/null @@ -1,1771 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * `StreamingRecognizeResponse` is the only message returned to the client by
- * `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
- * messages are streamed back to the client. If there is no recognizable
- * audio, and `single_utterance` is set to false, then no messages are streamed
- * back to the client.
- * Here's an example of a series of `StreamingRecognizeResponse`s that might be
- * returned while processing audio:
- * 1. results { alternatives { transcript: "tube" } stability: 0.01 }
- * 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
- * 3. results { alternatives { transcript: "to be" } stability: 0.9 }
- *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
- * 4. results { alternatives { transcript: "to be or not to be"
- *                             confidence: 0.92 }
- *              alternatives { transcript: "to bee or not to bee" }
- *              is_final: true }
- * 5. results { alternatives { transcript: " that's" } stability: 0.01 }
- * 6. results { alternatives { transcript: " that is" } stability: 0.9 }
- *    results { alternatives { transcript: " the question" } stability: 0.01 }
- * 7. results { alternatives { transcript: " that is the question"
- *                             confidence: 0.98 }
- *              alternatives { transcript: " that was the question" }
- *              is_final: true }
- * Notes:
- * - Only two of the above responses #4 and #7 contain final results; they are
- *   indicated by `is_final: true`. Concatenating these together generates the
- *   full transcript: "to be or not to be that is the question".
- * - The others contain interim `results`. #3 and #6 contain two interim
- *   `results`: the first portion has a high stability and is less likely to
- *   change; the second portion has a low stability and is very likely to
- *   change. A UI designer might choose to show only high stability `results`.
- * - The specific `stability` and `confidence` values shown above are only for
- *   illustrative purposes. Actual values may vary.
- * - In each response, only one of these fields will be set:
- *     `error`,
- *     `speech_event_type`, or
- *     one or more (repeated) `results`.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} - */ -public final class StreamingRecognizeResponse extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) - StreamingRecognizeResponseOrBuilder { -private static final long serialVersionUID = 0L; - // Use StreamingRecognizeResponse.newBuilder() to construct. - private StreamingRecognizeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private StreamingRecognizeResponse() { - results_ = java.util.Collections.emptyList(); - speechEventType_ = 0; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new StreamingRecognizeResponse(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private StreamingRecognizeResponse( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.rpc.Status.Builder subBuilder = null; - if (error_ != null) { - subBuilder = error_.toBuilder(); - } - error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(error_); - error_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - results_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.parser(), extensionRegistry)); - break; - } - case 32: { - int rawValue = input.readEnum(); - - speechEventType_ = rawValue; - break; - } - case 42: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (totalBilledTime_ != null) { - subBuilder = totalBilledTime_.toBuilder(); - } - totalBilledTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(totalBilledTime_); - totalBilledTime_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.class, com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.Builder.class); - } - - /** - *
-   * Indicates the type of speech event.
-   * 
- * - * Protobuf enum {@code google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType} - */ - public enum SpeechEventType - implements com.google.protobuf.ProtocolMessageEnum { - /** - *
-     * No speech event specified.
-     * 
- * - * SPEECH_EVENT_UNSPECIFIED = 0; - */ - SPEECH_EVENT_UNSPECIFIED(0), - /** - *
-     * This event indicates that the server has detected the end of the user's
-     * speech utterance and expects no additional speech. Therefore, the server
-     * will not process additional audio (although it may subsequently return
-     * additional results). The client should stop sending additional audio
-     * data, half-close the gRPC connection, and wait for any additional results
-     * until the server closes the gRPC connection. This event is only sent if
-     * `single_utterance` was set to `true`, and is not used otherwise.
-     * 
- * - * END_OF_SINGLE_UTTERANCE = 1; - */ - END_OF_SINGLE_UTTERANCE(1), - UNRECOGNIZED(-1), - ; - - /** - *
-     * No speech event specified.
-     * 
- * - * SPEECH_EVENT_UNSPECIFIED = 0; - */ - public static final int SPEECH_EVENT_UNSPECIFIED_VALUE = 0; - /** - *
-     * This event indicates that the server has detected the end of the user's
-     * speech utterance and expects no additional speech. Therefore, the server
-     * will not process additional audio (although it may subsequently return
-     * additional results). The client should stop sending additional audio
-     * data, half-close the gRPC connection, and wait for any additional results
-     * until the server closes the gRPC connection. This event is only sent if
-     * `single_utterance` was set to `true`, and is not used otherwise.
-     * 
- * - * END_OF_SINGLE_UTTERANCE = 1; - */ - public static final int END_OF_SINGLE_UTTERANCE_VALUE = 1; - - - public final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static SpeechEventType valueOf(int value) { - return forNumber(value); - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - */ - public static SpeechEventType forNumber(int value) { - switch (value) { - case 0: return SPEECH_EVENT_UNSPECIFIED; - case 1: return END_OF_SINGLE_UTTERANCE; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static final com.google.protobuf.Internal.EnumLiteMap< - SpeechEventType> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public SpeechEventType findValueByNumber(int number) { - return SpeechEventType.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.getDescriptor().getEnumTypes().get(0); - } - - private static final SpeechEventType[] VALUES = values(); - - public static SpeechEventType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - private final int value; - - private SpeechEventType(int value) { - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType) - } - - public static final int ERROR_FIELD_NUMBER = 1; - private com.google.rpc.Status error_; - /** - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * @return Whether the error field is set. - */ - @java.lang.Override - public boolean hasError() { - return error_ != null; - } - /** - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * @return The error. - */ - @java.lang.Override - public com.google.rpc.Status getError() { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } - /** - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - @java.lang.Override - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - return getError(); - } - - public static final int RESULTS_FIELD_NUMBER = 2; - private java.util.List results_; - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List getResultsList() { - return results_; - } - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public java.util.List - getResultsOrBuilderList() { - return results_; - } - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public int getResultsCount() { - return results_.size(); - } - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getResults(int index) { - return results_.get(index); - } - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - return results_.get(index); - } - - public static final int SPEECH_EVENT_TYPE_FIELD_NUMBER = 4; - private int speechEventType_; - /** - *
-   * Indicates the type of speech event.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return The enum numeric value on the wire for speechEventType. - */ - @java.lang.Override public int getSpeechEventTypeValue() { - return speechEventType_; - } - /** - *
-   * Indicates the type of speech event.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return The speechEventType. - */ - @java.lang.Override public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType result = com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.valueOf(speechEventType_); - return result == null ? com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.UNRECOGNIZED : result; - } - - public static final int TOTAL_BILLED_TIME_FIELD_NUMBER = 5; - private com.google.protobuf.Duration totalBilledTime_; - /** - *
-   * When available, billed audio seconds for the stream.
-   * Set only if this is the last response in the stream.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 5; - * @return Whether the totalBilledTime field is set. - */ - @java.lang.Override - public boolean hasTotalBilledTime() { - return totalBilledTime_ != null; - } - /** - *
-   * When available, billed audio seconds for the stream.
-   * Set only if this is the last response in the stream.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 5; - * @return The totalBilledTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getTotalBilledTime() { - return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } - /** - *
-   * When available, billed audio seconds for the stream.
-   * Set only if this is the last response in the stream.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { - return getTotalBilledTime(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (error_ != null) { - output.writeMessage(1, getError()); - } - for (int i = 0; i < results_.size(); i++) { - output.writeMessage(2, results_.get(i)); - } - if (speechEventType_ != com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.SPEECH_EVENT_UNSPECIFIED.getNumber()) { - output.writeEnum(4, speechEventType_); - } - if (totalBilledTime_ != null) { - output.writeMessage(5, getTotalBilledTime()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (error_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getError()); - } - for (int i = 0; i < results_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, results_.get(i)); - } - if (speechEventType_ != com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.SPEECH_EVENT_UNSPECIFIED.getNumber()) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(4, speechEventType_); - } - if (totalBilledTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getTotalBilledTime()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse other = (com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) obj; - - if (hasError() != other.hasError()) return false; - if (hasError()) { - if (!getError() - .equals(other.getError())) return false; - } - if (!getResultsList() - .equals(other.getResultsList())) return false; - if (speechEventType_ != other.speechEventType_) return false; - if (hasTotalBilledTime() != other.hasTotalBilledTime()) return false; - if (hasTotalBilledTime()) { - if (!getTotalBilledTime() - .equals(other.getTotalBilledTime())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasError()) { - hash = (37 * hash) + ERROR_FIELD_NUMBER; - hash = (53 * hash) + getError().hashCode(); - } - if (getResultsCount() > 0) { - hash = (37 * hash) + RESULTS_FIELD_NUMBER; - hash = (53 * hash) + getResultsList().hashCode(); - } - hash = (37 * hash) + SPEECH_EVENT_TYPE_FIELD_NUMBER; - hash = (53 * hash) + speechEventType_; - if (hasTotalBilledTime()) { - hash = (37 * hash) + TOTAL_BILLED_TIME_FIELD_NUMBER; - hash = (53 * hash) + getTotalBilledTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * `StreamingRecognizeResponse` is the only message returned to the client by
-   * `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
-   * messages are streamed back to the client. If there is no recognizable
-   * audio, and `single_utterance` is set to false, then no messages are streamed
-   * back to the client.
-   * Here's an example of a series of `StreamingRecognizeResponse`s that might be
-   * returned while processing audio:
-   * 1. results { alternatives { transcript: "tube" } stability: 0.01 }
-   * 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
-   * 3. results { alternatives { transcript: "to be" } stability: 0.9 }
-   *    results { alternatives { transcript: " or not to be" } stability: 0.01 }
-   * 4. results { alternatives { transcript: "to be or not to be"
-   *                             confidence: 0.92 }
-   *              alternatives { transcript: "to bee or not to bee" }
-   *              is_final: true }
-   * 5. results { alternatives { transcript: " that's" } stability: 0.01 }
-   * 6. results { alternatives { transcript: " that is" } stability: 0.9 }
-   *    results { alternatives { transcript: " the question" } stability: 0.01 }
-   * 7. results { alternatives { transcript: " that is the question"
-   *                             confidence: 0.98 }
-   *              alternatives { transcript: " that was the question" }
-   *              is_final: true }
-   * Notes:
-   * - Only two of the above responses #4 and #7 contain final results; they are
-   *   indicated by `is_final: true`. Concatenating these together generates the
-   *   full transcript: "to be or not to be that is the question".
-   * - The others contain interim `results`. #3 and #6 contain two interim
-   *   `results`: the first portion has a high stability and is less likely to
-   *   change; the second portion has a low stability and is very likely to
-   *   change. A UI designer might choose to show only high stability `results`.
-   * - The specific `stability` and `confidence` values shown above are only for
-   *   illustrative purposes. Actual values may vary.
-   * - In each response, only one of these fields will be set:
-   *     `error`,
-   *     `speech_event_type`, or
-   *     one or more (repeated) `results`.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.StreamingRecognizeResponse} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponseOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.class, com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getResultsFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (errorBuilder_ == null) { - error_ = null; - } else { - error_ = null; - errorBuilder_ = null; - } - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - resultsBuilder_.clear(); - } - speechEventType_ = 0; - - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = null; - } else { - totalBilledTime_ = null; - totalBilledTimeBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_StreamingRecognizeResponse_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse build() { - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse buildPartial() { - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse result = new com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse(this); - int from_bitField0_ = bitField0_; - if (errorBuilder_ == null) { - result.error_ = error_; - } else { - result.error_ = errorBuilder_.build(); - } - if (resultsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - results_ = java.util.Collections.unmodifiableList(results_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.results_ = results_; - } else { - result.results_ = resultsBuilder_.build(); - } - result.speechEventType_ = speechEventType_; - if (totalBilledTimeBuilder_ == null) { - result.totalBilledTime_ = totalBilledTime_; - } else { - result.totalBilledTime_ = totalBilledTimeBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse other) { - if (other == com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.getDefaultInstance()) return this; - if (other.hasError()) { - mergeError(other.getError()); - } - if (resultsBuilder_ == null) { - if (!other.results_.isEmpty()) { - if (results_.isEmpty()) { - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureResultsIsMutable(); - results_.addAll(other.results_); - } - onChanged(); - } - } else { - if (!other.results_.isEmpty()) { - if (resultsBuilder_.isEmpty()) { - resultsBuilder_.dispose(); - resultsBuilder_ = null; - results_ = other.results_; - bitField0_ = (bitField0_ & ~0x00000001); - resultsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getResultsFieldBuilder() : null; - } else { - resultsBuilder_.addAllMessages(other.results_); - } - } - } - if (other.speechEventType_ != 0) { - setSpeechEventTypeValue(other.getSpeechEventTypeValue()); - } - if (other.hasTotalBilledTime()) { - mergeTotalBilledTime(other.getTotalBilledTime()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private com.google.rpc.Status error_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - * @return Whether the error field is set. - */ - public boolean hasError() { - return errorBuilder_ != null || error_ != null; - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - * @return The error. - */ - public com.google.rpc.Status getError() { - if (errorBuilder_ == null) { - return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; - } else { - return errorBuilder_.getMessage(); - } - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder setError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - error_ = value; - onChanged(); - } else { - errorBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder setError( - com.google.rpc.Status.Builder builderForValue) { - if (errorBuilder_ == null) { - error_ = builderForValue.build(); - onChanged(); - } else { - errorBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder mergeError(com.google.rpc.Status value) { - if (errorBuilder_ == null) { - if (error_ != null) { - error_ = - com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); - } else { - error_ = value; - } - onChanged(); - } else { - errorBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public Builder clearError() { - if (errorBuilder_ == null) { - error_ = null; - onChanged(); - } else { - error_ = null; - errorBuilder_ = null; - } - - return this; - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.Status.Builder getErrorBuilder() { - - onChanged(); - return getErrorFieldBuilder().getBuilder(); - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { - if (errorBuilder_ != null) { - return errorBuilder_.getMessageOrBuilder(); - } else { - return error_ == null ? - com.google.rpc.Status.getDefaultInstance() : error_; - } - } - /** - *
-     * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-     * specifies the error for the operation.
-     * 
- * - * .google.rpc.Status error = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> - getErrorFieldBuilder() { - if (errorBuilder_ == null) { - errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( - getError(), - getParentForChildren(), - isClean()); - error_ = null; - } - return errorBuilder_; - } - - private java.util.List results_ = - java.util.Collections.emptyList(); - private void ensureResultsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - results_ = new java.util.ArrayList(results_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder> resultsBuilder_; - - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public java.util.List getResultsList() { - if (resultsBuilder_ == null) { - return java.util.Collections.unmodifiableList(results_); - } else { - return resultsBuilder_.getMessageList(); - } - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public int getResultsCount() { - if (resultsBuilder_ == null) { - return results_.size(); - } else { - return resultsBuilder_.getCount(); - } - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getResults(int index) { - if (resultsBuilder_ == null) { - return results_.get(index); - } else { - return resultsBuilder_.getMessage(index); - } - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.set(index, value); - onChanged(); - } else { - resultsBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder setResults( - int index, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.set(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addResults(com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(value); - onChanged(); - } else { - resultsBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult value) { - if (resultsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureResultsIsMutable(); - results_.add(index, value); - onChanged(); - } else { - resultsBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addResults( - int index, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder builderForValue) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.add(index, builderForValue.build()); - onChanged(); - } else { - resultsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder addAllResults( - java.lang.Iterable values) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, results_); - onChanged(); - } else { - resultsBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder clearResults() { - if (resultsBuilder_ == null) { - results_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - resultsBuilder_.clear(); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public Builder removeResults(int index) { - if (resultsBuilder_ == null) { - ensureResultsIsMutable(); - results_.remove(index); - onChanged(); - } else { - resultsBuilder_.remove(index); - } - return this; - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder getResultsBuilder( - int index) { - return getResultsFieldBuilder().getBuilder(index); - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index) { - if (resultsBuilder_ == null) { - return results_.get(index); } else { - return resultsBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public java.util.List - getResultsOrBuilderList() { - if (resultsBuilder_ != null) { - return resultsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(results_); - } - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder addResultsBuilder() { - return getResultsFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.getDefaultInstance()); - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder addResultsBuilder( - int index) { - return getResultsFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.getDefaultInstance()); - } - /** - *
-     * This repeated list contains zero or more results that
-     * correspond to consecutive portions of the audio currently being processed.
-     * It contains zero or one `is_final=true` result (the newly settled portion),
-     * followed by zero or more `is_final=false` results (the interim results).
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - public java.util.List - getResultsBuilderList() { - return getResultsFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder> - getResultsFieldBuilder() { - if (resultsBuilder_ == null) { - resultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult.Builder, com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder>( - results_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - results_ = null; - } - return resultsBuilder_; - } - - private int speechEventType_ = 0; - /** - *
-     * Indicates the type of speech event.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return The enum numeric value on the wire for speechEventType. - */ - @java.lang.Override public int getSpeechEventTypeValue() { - return speechEventType_; - } - /** - *
-     * Indicates the type of speech event.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @param value The enum numeric value on the wire for speechEventType to set. - * @return This builder for chaining. - */ - public Builder setSpeechEventTypeValue(int value) { - - speechEventType_ = value; - onChanged(); - return this; - } - /** - *
-     * Indicates the type of speech event.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return The speechEventType. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType() { - @SuppressWarnings("deprecation") - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType result = com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.valueOf(speechEventType_); - return result == null ? com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType.UNRECOGNIZED : result; - } - /** - *
-     * Indicates the type of speech event.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @param value The speechEventType to set. - * @return This builder for chaining. - */ - public Builder setSpeechEventType(com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType value) { - if (value == null) { - throw new NullPointerException(); - } - - speechEventType_ = value.getNumber(); - onChanged(); - return this; - } - /** - *
-     * Indicates the type of speech event.
-     * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return This builder for chaining. - */ - public Builder clearSpeechEventType() { - - speechEventType_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Duration totalBilledTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> totalBilledTimeBuilder_; - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - * @return Whether the totalBilledTime field is set. - */ - public boolean hasTotalBilledTime() { - return totalBilledTimeBuilder_ != null || totalBilledTime_ != null; - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - * @return The totalBilledTime. - */ - public com.google.protobuf.Duration getTotalBilledTime() { - if (totalBilledTimeBuilder_ == null) { - return totalBilledTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } else { - return totalBilledTimeBuilder_.getMessage(); - } - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - public Builder setTotalBilledTime(com.google.protobuf.Duration value) { - if (totalBilledTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - totalBilledTime_ = value; - onChanged(); - } else { - totalBilledTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - public Builder setTotalBilledTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = builderForValue.build(); - onChanged(); - } else { - totalBilledTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - public Builder mergeTotalBilledTime(com.google.protobuf.Duration value) { - if (totalBilledTimeBuilder_ == null) { - if (totalBilledTime_ != null) { - totalBilledTime_ = - com.google.protobuf.Duration.newBuilder(totalBilledTime_).mergeFrom(value).buildPartial(); - } else { - totalBilledTime_ = value; - } - onChanged(); - } else { - totalBilledTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - public Builder clearTotalBilledTime() { - if (totalBilledTimeBuilder_ == null) { - totalBilledTime_ = null; - onChanged(); - } else { - totalBilledTime_ = null; - totalBilledTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - public com.google.protobuf.Duration.Builder getTotalBilledTimeBuilder() { - - onChanged(); - return getTotalBilledTimeFieldBuilder().getBuilder(); - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - public com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder() { - if (totalBilledTimeBuilder_ != null) { - return totalBilledTimeBuilder_.getMessageOrBuilder(); - } else { - return totalBilledTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : totalBilledTime_; - } - } - /** - *
-     * When available, billed audio seconds for the stream.
-     * Set only if this is the last response in the stream.
-     * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getTotalBilledTimeFieldBuilder() { - if (totalBilledTimeBuilder_ == null) { - totalBilledTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getTotalBilledTime(), - getParentForChildren(), - isClean()); - totalBilledTime_ = null; - } - return totalBilledTimeBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) - private static final com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse(); - } - - public static com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public StreamingRecognizeResponse parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new StreamingRecognizeResponse(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java deleted file mode 100644 index f8b30e4274ea..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/StreamingRecognizeResponseOrBuilder.java +++ /dev/null @@ -1,147 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface StreamingRecognizeResponseOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * @return Whether the error field is set. - */ - boolean hasError(); - /** - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - * @return The error. - */ - com.google.rpc.Status getError(); - /** - *
-   * If set, returns a [google.rpc.Status][google.rpc.Status] message that
-   * specifies the error for the operation.
-   * 
- * - * .google.rpc.Status error = 1; - */ - com.google.rpc.StatusOrBuilder getErrorOrBuilder(); - - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - java.util.List - getResultsList(); - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResult getResults(int index); - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - int getResultsCount(); - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - java.util.List - getResultsOrBuilderList(); - /** - *
-   * This repeated list contains zero or more results that
-   * correspond to consecutive portions of the audio currently being processed.
-   * It contains zero or one `is_final=true` result (the newly settled portion),
-   * followed by zero or more `is_final=false` results (the interim results).
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.StreamingRecognitionResult results = 2; - */ - com.google.cloud.speech.v1p1beta1.StreamingRecognitionResultOrBuilder getResultsOrBuilder( - int index); - - /** - *
-   * Indicates the type of speech event.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return The enum numeric value on the wire for speechEventType. - */ - int getSpeechEventTypeValue(); - /** - *
-   * Indicates the type of speech event.
-   * 
- * - * .google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType speech_event_type = 4; - * @return The speechEventType. - */ - com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType getSpeechEventType(); - - /** - *
-   * When available, billed audio seconds for the stream.
-   * Set only if this is the last response in the stream.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 5; - * @return Whether the totalBilledTime field is set. - */ - boolean hasTotalBilledTime(); - /** - *
-   * When available, billed audio seconds for the stream.
-   * Set only if this is the last response in the stream.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 5; - * @return The totalBilledTime. - */ - com.google.protobuf.Duration getTotalBilledTime(); - /** - *
-   * When available, billed audio seconds for the stream.
-   * Set only if this is the last response in the stream.
-   * 
- * - * .google.protobuf.Duration total_billed_time = 5; - */ - com.google.protobuf.DurationOrBuilder getTotalBilledTimeOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalization.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalization.java deleted file mode 100644 index 1f54a67cb8e7..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalization.java +++ /dev/null @@ -1,1838 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Transcription normalization configuration. Use transcription normalization
- * to automatically replace parts of the transcript with phrases of your
- * choosing. For StreamingRecognize, this normalization only applies to stable
- * partial transcripts (stability > 0.8) and final transcripts.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.TranscriptNormalization} - */ -public final class TranscriptNormalization extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.TranscriptNormalization) - TranscriptNormalizationOrBuilder { -private static final long serialVersionUID = 0L; - // Use TranscriptNormalization.newBuilder() to construct. - private TranscriptNormalization(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TranscriptNormalization() { - entries_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TranscriptNormalization(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TranscriptNormalization( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - entries_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - entries_.add( - input.readMessage(com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.parser(), extensionRegistry)); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - entries_ = java.util.Collections.unmodifiableList(entries_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.class, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder.class); - } - - public interface EntryOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) - com.google.protobuf.MessageOrBuilder { - - /** - *
-     * What to replace. Max length is 100 characters.
-     * 
- * - * string search = 1; - * @return The search. - */ - java.lang.String getSearch(); - /** - *
-     * What to replace. Max length is 100 characters.
-     * 
- * - * string search = 1; - * @return The bytes for search. - */ - com.google.protobuf.ByteString - getSearchBytes(); - - /** - *
-     * What to replace with. Max length is 100 characters.
-     * 
- * - * string replace = 2; - * @return The replace. - */ - java.lang.String getReplace(); - /** - *
-     * What to replace with. Max length is 100 characters.
-     * 
- * - * string replace = 2; - * @return The bytes for replace. - */ - com.google.protobuf.ByteString - getReplaceBytes(); - - /** - *
-     * Whether the search is case sensitive.
-     * 
- * - * bool case_sensitive = 3; - * @return The caseSensitive. - */ - boolean getCaseSensitive(); - } - /** - *
-   * A single replacement configuration.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} - */ - public static final class Entry extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) - EntryOrBuilder { - private static final long serialVersionUID = 0L; - // Use Entry.newBuilder() to construct. - private Entry(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Entry() { - search_ = ""; - replace_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Entry(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Entry( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - - search_ = s; - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - replace_ = s; - break; - } - case 24: { - - caseSensitive_ = input.readBool(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.class, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder.class); - } - - public static final int SEARCH_FIELD_NUMBER = 1; - private volatile java.lang.Object search_; - /** - *
-     * What to replace. Max length is 100 characters.
-     * 
- * - * string search = 1; - * @return The search. - */ - @java.lang.Override - public java.lang.String getSearch() { - java.lang.Object ref = search_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - search_ = s; - return s; - } - } - /** - *
-     * What to replace. Max length is 100 characters.
-     * 
- * - * string search = 1; - * @return The bytes for search. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getSearchBytes() { - java.lang.Object ref = search_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - search_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int REPLACE_FIELD_NUMBER = 2; - private volatile java.lang.Object replace_; - /** - *
-     * What to replace with. Max length is 100 characters.
-     * 
- * - * string replace = 2; - * @return The replace. - */ - @java.lang.Override - public java.lang.String getReplace() { - java.lang.Object ref = replace_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - replace_ = s; - return s; - } - } - /** - *
-     * What to replace with. Max length is 100 characters.
-     * 
- * - * string replace = 2; - * @return The bytes for replace. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getReplaceBytes() { - java.lang.Object ref = replace_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - replace_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CASE_SENSITIVE_FIELD_NUMBER = 3; - private boolean caseSensitive_; - /** - *
-     * Whether the search is case sensitive.
-     * 
- * - * bool case_sensitive = 3; - * @return The caseSensitive. - */ - @java.lang.Override - public boolean getCaseSensitive() { - return caseSensitive_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(search_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, search_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replace_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, replace_); - } - if (caseSensitive_ != false) { - output.writeBool(3, caseSensitive_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(search_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, search_); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replace_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, replace_); - } - if (caseSensitive_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, caseSensitive_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry other = (com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) obj; - - if (!getSearch() - .equals(other.getSearch())) return false; - if (!getReplace() - .equals(other.getReplace())) return false; - if (getCaseSensitive() - != other.getCaseSensitive()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + SEARCH_FIELD_NUMBER; - hash = (53 * hash) + getSearch().hashCode(); - hash = (37 * hash) + REPLACE_FIELD_NUMBER; - hash = (53 * hash) + getReplace().hashCode(); - hash = (37 * hash) + CASE_SENSITIVE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getCaseSensitive()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-     * A single replacement configuration.
-     * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.class, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - search_ = ""; - - replace_ = ""; - - caseSensitive_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_Entry_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry build() { - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry buildPartial() { - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry result = new com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry(this); - result.search_ = search_; - result.replace_ = replace_; - result.caseSensitive_ = caseSensitive_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry other) { - if (other == com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.getDefaultInstance()) return this; - if (!other.getSearch().isEmpty()) { - search_ = other.search_; - onChanged(); - } - if (!other.getReplace().isEmpty()) { - replace_ = other.replace_; - onChanged(); - } - if (other.getCaseSensitive() != false) { - setCaseSensitive(other.getCaseSensitive()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object search_ = ""; - /** - *
-       * What to replace. Max length is 100 characters.
-       * 
- * - * string search = 1; - * @return The search. - */ - public java.lang.String getSearch() { - java.lang.Object ref = search_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - search_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * What to replace. Max length is 100 characters.
-       * 
- * - * string search = 1; - * @return The bytes for search. - */ - public com.google.protobuf.ByteString - getSearchBytes() { - java.lang.Object ref = search_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - search_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * What to replace. Max length is 100 characters.
-       * 
- * - * string search = 1; - * @param value The search to set. - * @return This builder for chaining. - */ - public Builder setSearch( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - search_ = value; - onChanged(); - return this; - } - /** - *
-       * What to replace. Max length is 100 characters.
-       * 
- * - * string search = 1; - * @return This builder for chaining. - */ - public Builder clearSearch() { - - search_ = getDefaultInstance().getSearch(); - onChanged(); - return this; - } - /** - *
-       * What to replace. Max length is 100 characters.
-       * 
- * - * string search = 1; - * @param value The bytes for search to set. - * @return This builder for chaining. - */ - public Builder setSearchBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - search_ = value; - onChanged(); - return this; - } - - private java.lang.Object replace_ = ""; - /** - *
-       * What to replace with. Max length is 100 characters.
-       * 
- * - * string replace = 2; - * @return The replace. - */ - public java.lang.String getReplace() { - java.lang.Object ref = replace_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - replace_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-       * What to replace with. Max length is 100 characters.
-       * 
- * - * string replace = 2; - * @return The bytes for replace. - */ - public com.google.protobuf.ByteString - getReplaceBytes() { - java.lang.Object ref = replace_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - replace_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-       * What to replace with. Max length is 100 characters.
-       * 
- * - * string replace = 2; - * @param value The replace to set. - * @return This builder for chaining. - */ - public Builder setReplace( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - replace_ = value; - onChanged(); - return this; - } - /** - *
-       * What to replace with. Max length is 100 characters.
-       * 
- * - * string replace = 2; - * @return This builder for chaining. - */ - public Builder clearReplace() { - - replace_ = getDefaultInstance().getReplace(); - onChanged(); - return this; - } - /** - *
-       * What to replace with. Max length is 100 characters.
-       * 
- * - * string replace = 2; - * @param value The bytes for replace to set. - * @return This builder for chaining. - */ - public Builder setReplaceBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - replace_ = value; - onChanged(); - return this; - } - - private boolean caseSensitive_ ; - /** - *
-       * Whether the search is case sensitive.
-       * 
- * - * bool case_sensitive = 3; - * @return The caseSensitive. - */ - @java.lang.Override - public boolean getCaseSensitive() { - return caseSensitive_; - } - /** - *
-       * Whether the search is case sensitive.
-       * 
- * - * bool case_sensitive = 3; - * @param value The caseSensitive to set. - * @return This builder for chaining. - */ - public Builder setCaseSensitive(boolean value) { - - caseSensitive_ = value; - onChanged(); - return this; - } - /** - *
-       * Whether the search is case sensitive.
-       * 
- * - * bool case_sensitive = 3; - * @return This builder for chaining. - */ - public Builder clearCaseSensitive() { - - caseSensitive_ = false; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry) - private static final com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry(); - } - - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Entry parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Entry(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - - } - - public static final int ENTRIES_FIELD_NUMBER = 1; - private java.util.List entries_; - /** - *
-   * A list of replacement entries. We will perform replacement with one entry
-   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-   * => "mountain dog"] will never be applied because we will always process the
-   * first entry before it. At most 100 entries.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - @java.lang.Override - public java.util.List getEntriesList() { - return entries_; - } - /** - *
-   * A list of replacement entries. We will perform replacement with one entry
-   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-   * => "mountain dog"] will never be applied because we will always process the
-   * first entry before it. At most 100 entries.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - @java.lang.Override - public java.util.List - getEntriesOrBuilderList() { - return entries_; - } - /** - *
-   * A list of replacement entries. We will perform replacement with one entry
-   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-   * => "mountain dog"] will never be applied because we will always process the
-   * first entry before it. At most 100 entries.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - @java.lang.Override - public int getEntriesCount() { - return entries_.size(); - } - /** - *
-   * A list of replacement entries. We will perform replacement with one entry
-   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-   * => "mountain dog"] will never be applied because we will always process the
-   * first entry before it. At most 100 entries.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry getEntries(int index) { - return entries_.get(index); - } - /** - *
-   * A list of replacement entries. We will perform replacement with one entry
-   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-   * => "mountain dog"] will never be applied because we will always process the
-   * first entry before it. At most 100 entries.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder getEntriesOrBuilder( - int index) { - return entries_.get(index); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < entries_.size(); i++) { - output.writeMessage(1, entries_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < entries_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, entries_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.TranscriptNormalization)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.TranscriptNormalization other = (com.google.cloud.speech.v1p1beta1.TranscriptNormalization) obj; - - if (!getEntriesList() - .equals(other.getEntriesList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getEntriesCount() > 0) { - hash = (37 * hash) + ENTRIES_FIELD_NUMBER; - hash = (53 * hash) + getEntriesList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.TranscriptNormalization prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Transcription normalization configuration. Use transcription normalization
-   * to automatically replace parts of the transcript with phrases of your
-   * choosing. For StreamingRecognize, this normalization only applies to stable
-   * partial transcripts (stability > 0.8) and final transcripts.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.TranscriptNormalization} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.TranscriptNormalization) - com.google.cloud.speech.v1p1beta1.TranscriptNormalizationOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.class, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.TranscriptNormalization.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getEntriesFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (entriesBuilder_ == null) { - entries_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - entriesBuilder_.clear(); - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechResourceProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptNormalization_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.TranscriptNormalization.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization build() { - com.google.cloud.speech.v1p1beta1.TranscriptNormalization result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization buildPartial() { - com.google.cloud.speech.v1p1beta1.TranscriptNormalization result = new com.google.cloud.speech.v1p1beta1.TranscriptNormalization(this); - int from_bitField0_ = bitField0_; - if (entriesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - entries_ = java.util.Collections.unmodifiableList(entries_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.entries_ = entries_; - } else { - result.entries_ = entriesBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.TranscriptNormalization) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.TranscriptNormalization)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.TranscriptNormalization other) { - if (other == com.google.cloud.speech.v1p1beta1.TranscriptNormalization.getDefaultInstance()) return this; - if (entriesBuilder_ == null) { - if (!other.entries_.isEmpty()) { - if (entries_.isEmpty()) { - entries_ = other.entries_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureEntriesIsMutable(); - entries_.addAll(other.entries_); - } - onChanged(); - } - } else { - if (!other.entries_.isEmpty()) { - if (entriesBuilder_.isEmpty()) { - entriesBuilder_.dispose(); - entriesBuilder_ = null; - entries_ = other.entries_; - bitField0_ = (bitField0_ & ~0x00000001); - entriesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getEntriesFieldBuilder() : null; - } else { - entriesBuilder_.addAllMessages(other.entries_); - } - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.TranscriptNormalization parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.TranscriptNormalization) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List entries_ = - java.util.Collections.emptyList(); - private void ensureEntriesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - entries_ = new java.util.ArrayList(entries_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder> entriesBuilder_; - - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public java.util.List getEntriesList() { - if (entriesBuilder_ == null) { - return java.util.Collections.unmodifiableList(entries_); - } else { - return entriesBuilder_.getMessageList(); - } - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public int getEntriesCount() { - if (entriesBuilder_ == null) { - return entries_.size(); - } else { - return entriesBuilder_.getCount(); - } - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry getEntries(int index) { - if (entriesBuilder_ == null) { - return entries_.get(index); - } else { - return entriesBuilder_.getMessage(index); - } - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public Builder setEntries( - int index, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntriesIsMutable(); - entries_.set(index, value); - onChanged(); - } else { - entriesBuilder_.setMessage(index, value); - } - return this; - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public Builder setEntries( - int index, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder builderForValue) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.set(index, builderForValue.build()); - onChanged(); - } else { - entriesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public Builder addEntries(com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntriesIsMutable(); - entries_.add(value); - onChanged(); - } else { - entriesBuilder_.addMessage(value); - } - return this; - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public Builder addEntries( - int index, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry value) { - if (entriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureEntriesIsMutable(); - entries_.add(index, value); - onChanged(); - } else { - entriesBuilder_.addMessage(index, value); - } - return this; - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public Builder addEntries( - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder builderForValue) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.add(builderForValue.build()); - onChanged(); - } else { - entriesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public Builder addEntries( - int index, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder builderForValue) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.add(index, builderForValue.build()); - onChanged(); - } else { - entriesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public Builder addAllEntries( - java.lang.Iterable values) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, entries_); - onChanged(); - } else { - entriesBuilder_.addAllMessages(values); - } - return this; - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public Builder clearEntries() { - if (entriesBuilder_ == null) { - entries_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - entriesBuilder_.clear(); - } - return this; - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public Builder removeEntries(int index) { - if (entriesBuilder_ == null) { - ensureEntriesIsMutable(); - entries_.remove(index); - onChanged(); - } else { - entriesBuilder_.remove(index); - } - return this; - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder getEntriesBuilder( - int index) { - return getEntriesFieldBuilder().getBuilder(index); - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder getEntriesOrBuilder( - int index) { - if (entriesBuilder_ == null) { - return entries_.get(index); } else { - return entriesBuilder_.getMessageOrBuilder(index); - } - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public java.util.List - getEntriesOrBuilderList() { - if (entriesBuilder_ != null) { - return entriesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(entries_); - } - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder addEntriesBuilder() { - return getEntriesFieldBuilder().addBuilder( - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.getDefaultInstance()); - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder addEntriesBuilder( - int index) { - return getEntriesFieldBuilder().addBuilder( - index, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.getDefaultInstance()); - } - /** - *
-     * A list of replacement entries. We will perform replacement with one entry
-     * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-     * => "mountain dog"] will never be applied because we will always process the
-     * first entry before it. At most 100 entries.
-     * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - public java.util.List - getEntriesBuilderList() { - return getEntriesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder> - getEntriesFieldBuilder() { - if (entriesBuilder_ == null) { - entriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry.Builder, com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder>( - entries_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - entries_ = null; - } - return entriesBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.TranscriptNormalization) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.TranscriptNormalization) - private static final com.google.cloud.speech.v1p1beta1.TranscriptNormalization DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.TranscriptNormalization(); - } - - public static com.google.cloud.speech.v1p1beta1.TranscriptNormalization getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TranscriptNormalization parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TranscriptNormalization(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptNormalization getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalizationOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalizationOrBuilder.java deleted file mode 100644 index fa51b40b7003..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptNormalizationOrBuilder.java +++ /dev/null @@ -1,68 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/resource.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface TranscriptNormalizationOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.TranscriptNormalization) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * A list of replacement entries. We will perform replacement with one entry
-   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-   * => "mountain dog"] will never be applied because we will always process the
-   * first entry before it. At most 100 entries.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - java.util.List - getEntriesList(); - /** - *
-   * A list of replacement entries. We will perform replacement with one entry
-   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-   * => "mountain dog"] will never be applied because we will always process the
-   * first entry before it. At most 100 entries.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry getEntries(int index); - /** - *
-   * A list of replacement entries. We will perform replacement with one entry
-   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-   * => "mountain dog"] will never be applied because we will always process the
-   * first entry before it. At most 100 entries.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - int getEntriesCount(); - /** - *
-   * A list of replacement entries. We will perform replacement with one entry
-   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-   * => "mountain dog"] will never be applied because we will always process the
-   * first entry before it. At most 100 entries.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - java.util.List - getEntriesOrBuilderList(); - /** - *
-   * A list of replacement entries. We will perform replacement with one entry
-   * at a time. For example, the second entry in ["cat" => "dog", "mountain cat"
-   * => "mountain dog"] will never be applied because we will always process the
-   * first entry before it. At most 100 entries.
-   * 
- * - * repeated .google.cloud.speech.v1p1beta1.TranscriptNormalization.Entry entries = 1; - */ - com.google.cloud.speech.v1p1beta1.TranscriptNormalization.EntryOrBuilder getEntriesOrBuilder( - int index); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfig.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfig.java deleted file mode 100644 index 25b03d6ffdc1..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfig.java +++ /dev/null @@ -1,732 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Specifies an optional destination for the recognition results.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.TranscriptOutputConfig} - */ -public final class TranscriptOutputConfig extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.TranscriptOutputConfig) - TranscriptOutputConfigOrBuilder { -private static final long serialVersionUID = 0L; - // Use TranscriptOutputConfig.newBuilder() to construct. - private TranscriptOutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private TranscriptOutputConfig() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new TranscriptOutputConfig(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private TranscriptOutputConfig( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - java.lang.String s = input.readStringRequireUtf8(); - outputTypeCase_ = 1; - outputType_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.class, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder.class); - } - - private int outputTypeCase_ = 0; - private java.lang.Object outputType_; - public enum OutputTypeCase - implements com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - GCS_URI(1), - OUTPUTTYPE_NOT_SET(0); - private final int value; - private OutputTypeCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static OutputTypeCase valueOf(int value) { - return forNumber(value); - } - - public static OutputTypeCase forNumber(int value) { - switch (value) { - case 1: return GCS_URI; - case 0: return OUTPUTTYPE_NOT_SET; - default: return null; - } - } - public int getNumber() { - return this.value; - } - }; - - public OutputTypeCase - getOutputTypeCase() { - return OutputTypeCase.forNumber( - outputTypeCase_); - } - - public static final int GCS_URI_FIELD_NUMBER = 1; - /** - *
-   * Specifies a Cloud Storage URI for the recognition results. Must be
-   * specified in the format: `gs://bucket_name/object_name`, and the bucket
-   * must already exist.
-   * 
- * - * string gcs_uri = 1; - * @return Whether the gcsUri field is set. - */ - public boolean hasGcsUri() { - return outputTypeCase_ == 1; - } - /** - *
-   * Specifies a Cloud Storage URI for the recognition results. Must be
-   * specified in the format: `gs://bucket_name/object_name`, and the bucket
-   * must already exist.
-   * 
- * - * string gcs_uri = 1; - * @return The gcsUri. - */ - public java.lang.String getGcsUri() { - java.lang.Object ref = ""; - if (outputTypeCase_ == 1) { - ref = outputType_; - } - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (outputTypeCase_ == 1) { - outputType_ = s; - } - return s; - } - } - /** - *
-   * Specifies a Cloud Storage URI for the recognition results. Must be
-   * specified in the format: `gs://bucket_name/object_name`, and the bucket
-   * must already exist.
-   * 
- * - * string gcs_uri = 1; - * @return The bytes for gcsUri. - */ - public com.google.protobuf.ByteString - getGcsUriBytes() { - java.lang.Object ref = ""; - if (outputTypeCase_ == 1) { - ref = outputType_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (outputTypeCase_ == 1) { - outputType_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (outputTypeCase_ == 1) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputType_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (outputTypeCase_ == 1) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputType_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig other = (com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig) obj; - - if (!getOutputTypeCase().equals(other.getOutputTypeCase())) return false; - switch (outputTypeCase_) { - case 1: - if (!getGcsUri() - .equals(other.getGcsUri())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - switch (outputTypeCase_) { - case 1: - hash = (37 * hash) + GCS_URI_FIELD_NUMBER; - hash = (53 * hash) + getGcsUri().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Specifies an optional destination for the recognition results.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.TranscriptOutputConfig} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.TranscriptOutputConfig) - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfigOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.class, com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - outputTypeCase_ = 0; - outputType_ = null; - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_TranscriptOutputConfig_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig build() { - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig buildPartial() { - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig result = new com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig(this); - if (outputTypeCase_ == 1) { - result.outputType_ = outputType_; - } - result.outputTypeCase_ = outputTypeCase_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig other) { - if (other == com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.getDefaultInstance()) return this; - switch (other.getOutputTypeCase()) { - case GCS_URI: { - outputTypeCase_ = 1; - outputType_ = other.outputType_; - onChanged(); - break; - } - case OUTPUTTYPE_NOT_SET: { - break; - } - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int outputTypeCase_ = 0; - private java.lang.Object outputType_; - public OutputTypeCase - getOutputTypeCase() { - return OutputTypeCase.forNumber( - outputTypeCase_); - } - - public Builder clearOutputType() { - outputTypeCase_ = 0; - outputType_ = null; - onChanged(); - return this; - } - - - /** - *
-     * Specifies a Cloud Storage URI for the recognition results. Must be
-     * specified in the format: `gs://bucket_name/object_name`, and the bucket
-     * must already exist.
-     * 
- * - * string gcs_uri = 1; - * @return Whether the gcsUri field is set. - */ - @java.lang.Override - public boolean hasGcsUri() { - return outputTypeCase_ == 1; - } - /** - *
-     * Specifies a Cloud Storage URI for the recognition results. Must be
-     * specified in the format: `gs://bucket_name/object_name`, and the bucket
-     * must already exist.
-     * 
- * - * string gcs_uri = 1; - * @return The gcsUri. - */ - @java.lang.Override - public java.lang.String getGcsUri() { - java.lang.Object ref = ""; - if (outputTypeCase_ == 1) { - ref = outputType_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (outputTypeCase_ == 1) { - outputType_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * Specifies a Cloud Storage URI for the recognition results. Must be
-     * specified in the format: `gs://bucket_name/object_name`, and the bucket
-     * must already exist.
-     * 
- * - * string gcs_uri = 1; - * @return The bytes for gcsUri. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getGcsUriBytes() { - java.lang.Object ref = ""; - if (outputTypeCase_ == 1) { - ref = outputType_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - if (outputTypeCase_ == 1) { - outputType_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * Specifies a Cloud Storage URI for the recognition results. Must be
-     * specified in the format: `gs://bucket_name/object_name`, and the bucket
-     * must already exist.
-     * 
- * - * string gcs_uri = 1; - * @param value The gcsUri to set. - * @return This builder for chaining. - */ - public Builder setGcsUri( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - outputTypeCase_ = 1; - outputType_ = value; - onChanged(); - return this; - } - /** - *
-     * Specifies a Cloud Storage URI for the recognition results. Must be
-     * specified in the format: `gs://bucket_name/object_name`, and the bucket
-     * must already exist.
-     * 
- * - * string gcs_uri = 1; - * @return This builder for chaining. - */ - public Builder clearGcsUri() { - if (outputTypeCase_ == 1) { - outputTypeCase_ = 0; - outputType_ = null; - onChanged(); - } - return this; - } - /** - *
-     * Specifies a Cloud Storage URI for the recognition results. Must be
-     * specified in the format: `gs://bucket_name/object_name`, and the bucket
-     * must already exist.
-     * 
- * - * string gcs_uri = 1; - * @param value The bytes for gcsUri to set. - * @return This builder for chaining. - */ - public Builder setGcsUriBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - outputTypeCase_ = 1; - outputType_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.TranscriptOutputConfig) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.TranscriptOutputConfig) - private static final com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig(); - } - - public static com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public TranscriptOutputConfig parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new TranscriptOutputConfig(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfigOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfigOrBuilder.java deleted file mode 100644 index 3733fac7b5f9..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/TranscriptOutputConfigOrBuilder.java +++ /dev/null @@ -1,46 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface TranscriptOutputConfigOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.TranscriptOutputConfig) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Specifies a Cloud Storage URI for the recognition results. Must be
-   * specified in the format: `gs://bucket_name/object_name`, and the bucket
-   * must already exist.
-   * 
- * - * string gcs_uri = 1; - * @return Whether the gcsUri field is set. - */ - boolean hasGcsUri(); - /** - *
-   * Specifies a Cloud Storage URI for the recognition results. Must be
-   * specified in the format: `gs://bucket_name/object_name`, and the bucket
-   * must already exist.
-   * 
- * - * string gcs_uri = 1; - * @return The gcsUri. - */ - java.lang.String getGcsUri(); - /** - *
-   * Specifies a Cloud Storage URI for the recognition results. Must be
-   * specified in the format: `gs://bucket_name/object_name`, and the bucket
-   * must already exist.
-   * 
- * - * string gcs_uri = 1; - * @return The bytes for gcsUri. - */ - com.google.protobuf.ByteString - getGcsUriBytes(); - - public com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig.OutputTypeCase getOutputTypeCase(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java deleted file mode 100644 index 7ed5cddc895e..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequest.java +++ /dev/null @@ -1,997 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Message sent by the client for the `UpdateCustomClass` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} - */ -public final class UpdateCustomClassRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) - UpdateCustomClassRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use UpdateCustomClassRequest.newBuilder() to construct. - private UpdateCustomClassRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private UpdateCustomClassRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new UpdateCustomClassRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private UpdateCustomClassRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.cloud.speech.v1p1beta1.CustomClass.Builder subBuilder = null; - if (customClass_ != null) { - subBuilder = customClass_.toBuilder(); - } - customClass_ = input.readMessage(com.google.cloud.speech.v1p1beta1.CustomClass.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(customClass_); - customClass_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.Builder.class); - } - - public static final int CUSTOM_CLASS_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1p1beta1.CustomClass customClass_; - /** - *
-   * Required. The custom class to update.
-   * The custom class's `name` field is used to identify the custom class to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the customClass field is set. - */ - @java.lang.Override - public boolean hasCustomClass() { - return customClass_ != null; - } - /** - *
-   * Required. The custom class to update.
-   * The custom class's `name` field is used to identify the custom class to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClass. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass() { - return customClass_ == null ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() : customClass_; - } - /** - *
-   * Required. The custom class to update.
-   * The custom class's `name` field is used to identify the custom class to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder() { - return getCustomClass(); - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 2; - private com.google.protobuf.FieldMask updateMask_; - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (customClass_ != null) { - output.writeMessage(1, getCustomClass()); - } - if (updateMask_ != null) { - output.writeMessage(2, getUpdateMask()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (customClass_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getCustomClass()); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getUpdateMask()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest other = (com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) obj; - - if (hasCustomClass() != other.hasCustomClass()) return false; - if (hasCustomClass()) { - if (!getCustomClass() - .equals(other.getCustomClass())) return false; - } - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask() - .equals(other.getUpdateMask())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasCustomClass()) { - hash = (37 * hash) + CUSTOM_CLASS_FIELD_NUMBER; - hash = (53 * hash) + getCustomClass().hashCode(); - } - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `UpdateCustomClass` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.UpdateCustomClassRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) - com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.class, com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (customClassBuilder_ == null) { - customClass_ = null; - } else { - customClass_ = null; - customClassBuilder_ = null; - } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdateCustomClassRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest build() { - com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest result = new com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest(this); - if (customClassBuilder_ == null) { - result.customClass_ = customClass_; - } else { - result.customClass_ = customClassBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest.getDefaultInstance()) return this; - if (other.hasCustomClass()) { - mergeCustomClass(other.getCustomClass()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1p1beta1.CustomClass customClass_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> customClassBuilder_; - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the customClass field is set. - */ - public boolean hasCustomClass() { - return customClassBuilder_ != null || customClass_ != null; - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClass. - */ - public com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass() { - if (customClassBuilder_ == null) { - return customClass_ == null ? com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() : customClass_; - } else { - return customClassBuilder_.getMessage(); - } - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setCustomClass(com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - customClass_ = value; - onChanged(); - } else { - customClassBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setCustomClass( - com.google.cloud.speech.v1p1beta1.CustomClass.Builder builderForValue) { - if (customClassBuilder_ == null) { - customClass_ = builderForValue.build(); - onChanged(); - } else { - customClassBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergeCustomClass(com.google.cloud.speech.v1p1beta1.CustomClass value) { - if (customClassBuilder_ == null) { - if (customClass_ != null) { - customClass_ = - com.google.cloud.speech.v1p1beta1.CustomClass.newBuilder(customClass_).mergeFrom(value).buildPartial(); - } else { - customClass_ = value; - } - onChanged(); - } else { - customClassBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearCustomClass() { - if (customClassBuilder_ == null) { - customClass_ = null; - onChanged(); - } else { - customClass_ = null; - customClassBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.CustomClass.Builder getCustomClassBuilder() { - - onChanged(); - return getCustomClassFieldBuilder().getBuilder(); - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder() { - if (customClassBuilder_ != null) { - return customClassBuilder_.getMessageOrBuilder(); - } else { - return customClass_ == null ? - com.google.cloud.speech.v1p1beta1.CustomClass.getDefaultInstance() : customClass_; - } - } - /** - *
-     * Required. The custom class to update.
-     * The custom class's `name` field is used to identify the custom class to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder> - getCustomClassFieldBuilder() { - if (customClassBuilder_ == null) { - customClassBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.CustomClass, com.google.cloud.speech.v1p1beta1.CustomClass.Builder, com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder>( - getCustomClass(), - getParentForChildren(), - isClean()); - customClass_ = null; - } - return customClassBuilder_; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - onChanged(); - } else { - updateMaskBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask( - com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - onChanged(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); - } else { - updateMask_ = value; - } - onChanged(); - } else { - updateMaskBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null ? - com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), - getParentForChildren(), - isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) - private static final com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdateCustomClassRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateCustomClassRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java deleted file mode 100644 index 5ffdf4623cc2..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdateCustomClassRequestOrBuilder.java +++ /dev/null @@ -1,87 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface UpdateCustomClassRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.UpdateCustomClassRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The custom class to update.
-   * The custom class's `name` field is used to identify the custom class to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the customClass field is set. - */ - boolean hasCustomClass(); - /** - *
-   * Required. The custom class to update.
-   * The custom class's `name` field is used to identify the custom class to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The customClass. - */ - com.google.cloud.speech.v1p1beta1.CustomClass getCustomClass(); - /** - *
-   * Required. The custom class to update.
-   * The custom class's `name` field is used to identify the custom class to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/customClasses/{custom_class}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1p1beta1.CustomClass custom_class = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1p1beta1.CustomClassOrBuilder getCustomClassOrBuilder(); - - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java deleted file mode 100644 index 3c5a6f5250e8..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequest.java +++ /dev/null @@ -1,997 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Message sent by the client for the `UpdatePhraseSet` method.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} - */ -public final class UpdatePhraseSetRequest extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) - UpdatePhraseSetRequestOrBuilder { -private static final long serialVersionUID = 0L; - // Use UpdatePhraseSetRequest.newBuilder() to construct. - private UpdatePhraseSetRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private UpdatePhraseSetRequest() { - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new UpdatePhraseSetRequest(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private UpdatePhraseSetRequest( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.cloud.speech.v1p1beta1.PhraseSet.Builder subBuilder = null; - if (phraseSet_ != null) { - subBuilder = phraseSet_.toBuilder(); - } - phraseSet_ = input.readMessage(com.google.cloud.speech.v1p1beta1.PhraseSet.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(phraseSet_); - phraseSet_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.protobuf.FieldMask.Builder subBuilder = null; - if (updateMask_ != null) { - subBuilder = updateMask_.toBuilder(); - } - updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(updateMask_); - updateMask_ = subBuilder.buildPartial(); - } - - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.Builder.class); - } - - public static final int PHRASE_SET_FIELD_NUMBER = 1; - private com.google.cloud.speech.v1p1beta1.PhraseSet phraseSet_; - /** - *
-   * Required. The phrase set to update.
-   * The phrase set's `name` field is used to identify the set to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the phraseSet field is set. - */ - @java.lang.Override - public boolean hasPhraseSet() { - return phraseSet_ != null; - } - /** - *
-   * Required. The phrase set to update.
-   * The phrase set's `name` field is used to identify the set to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSet. - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet() { - return phraseSet_ == null ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() : phraseSet_; - } - /** - *
-   * Required. The phrase set to update.
-   * The phrase set's `name` field is used to identify the set to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder() { - return getPhraseSet(); - } - - public static final int UPDATE_MASK_FIELD_NUMBER = 2; - private com.google.protobuf.FieldMask updateMask_; - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - @java.lang.Override - public boolean hasUpdateMask() { - return updateMask_ != null; - } - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - @java.lang.Override - public com.google.protobuf.FieldMask getUpdateMask() { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - @java.lang.Override - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - return getUpdateMask(); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (phraseSet_ != null) { - output.writeMessage(1, getPhraseSet()); - } - if (updateMask_ != null) { - output.writeMessage(2, getUpdateMask()); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (phraseSet_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getPhraseSet()); - } - if (updateMask_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getUpdateMask()); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest other = (com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) obj; - - if (hasPhraseSet() != other.hasPhraseSet()) return false; - if (hasPhraseSet()) { - if (!getPhraseSet() - .equals(other.getPhraseSet())) return false; - } - if (hasUpdateMask() != other.hasUpdateMask()) return false; - if (hasUpdateMask()) { - if (!getUpdateMask() - .equals(other.getUpdateMask())) return false; - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasPhraseSet()) { - hash = (37 * hash) + PHRASE_SET_FIELD_NUMBER; - hash = (53 * hash) + getPhraseSet().hashCode(); - } - if (hasUpdateMask()) { - hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; - hash = (53 * hash) + getUpdateMask().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Message sent by the client for the `UpdatePhraseSet` method.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) - com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequestOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.class, com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (phraseSetBuilder_ == null) { - phraseSet_ = null; - } else { - phraseSet_ = null; - phraseSetBuilder_ = null; - } - if (updateMaskBuilder_ == null) { - updateMask_ = null; - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechAdaptationProto.internal_static_google_cloud_speech_v1p1beta1_UpdatePhraseSetRequest_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest build() { - com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest buildPartial() { - com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest result = new com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest(this); - if (phraseSetBuilder_ == null) { - result.phraseSet_ = phraseSet_; - } else { - result.phraseSet_ = phraseSetBuilder_.build(); - } - if (updateMaskBuilder_ == null) { - result.updateMask_ = updateMask_; - } else { - result.updateMask_ = updateMaskBuilder_.build(); - } - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest other) { - if (other == com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest.getDefaultInstance()) return this; - if (other.hasPhraseSet()) { - mergePhraseSet(other.getPhraseSet()); - } - if (other.hasUpdateMask()) { - mergeUpdateMask(other.getUpdateMask()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.cloud.speech.v1p1beta1.PhraseSet phraseSet_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> phraseSetBuilder_; - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the phraseSet field is set. - */ - public boolean hasPhraseSet() { - return phraseSetBuilder_ != null || phraseSet_ != null; - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSet. - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet() { - if (phraseSetBuilder_ == null) { - return phraseSet_ == null ? com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() : phraseSet_; - } else { - return phraseSetBuilder_.getMessage(); - } - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setPhraseSet(com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - phraseSet_ = value; - onChanged(); - } else { - phraseSetBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder setPhraseSet( - com.google.cloud.speech.v1p1beta1.PhraseSet.Builder builderForValue) { - if (phraseSetBuilder_ == null) { - phraseSet_ = builderForValue.build(); - onChanged(); - } else { - phraseSetBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder mergePhraseSet(com.google.cloud.speech.v1p1beta1.PhraseSet value) { - if (phraseSetBuilder_ == null) { - if (phraseSet_ != null) { - phraseSet_ = - com.google.cloud.speech.v1p1beta1.PhraseSet.newBuilder(phraseSet_).mergeFrom(value).buildPartial(); - } else { - phraseSet_ = value; - } - onChanged(); - } else { - phraseSetBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public Builder clearPhraseSet() { - if (phraseSetBuilder_ == null) { - phraseSet_ = null; - onChanged(); - } else { - phraseSet_ = null; - phraseSetBuilder_ = null; - } - - return this; - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSet.Builder getPhraseSetBuilder() { - - onChanged(); - return getPhraseSetFieldBuilder().getBuilder(); - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - public com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder() { - if (phraseSetBuilder_ != null) { - return phraseSetBuilder_.getMessageOrBuilder(); - } else { - return phraseSet_ == null ? - com.google.cloud.speech.v1p1beta1.PhraseSet.getDefaultInstance() : phraseSet_; - } - } - /** - *
-     * Required. The phrase set to update.
-     * The phrase set's `name` field is used to identify the set to be
-     * updated. Format:
-     * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-     * Speech-to-Text supports three locations: `global`, `us` (US North America),
-     * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-     * endpoint, use the `global` location. To specify a region, use a
-     * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-     * with matching `us` or `eu` location value.
-     * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder> - getPhraseSetFieldBuilder() { - if (phraseSetBuilder_ == null) { - phraseSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.cloud.speech.v1p1beta1.PhraseSet, com.google.cloud.speech.v1p1beta1.PhraseSet.Builder, com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder>( - getPhraseSet(), - getParentForChildren(), - isClean()); - phraseSet_ = null; - } - return phraseSetBuilder_; - } - - private com.google.protobuf.FieldMask updateMask_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - public boolean hasUpdateMask() { - return updateMaskBuilder_ != null || updateMask_ != null; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - public com.google.protobuf.FieldMask getUpdateMask() { - if (updateMaskBuilder_ == null) { - return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } else { - return updateMaskBuilder_.getMessage(); - } - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - updateMask_ = value; - onChanged(); - } else { - updateMaskBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder setUpdateMask( - com.google.protobuf.FieldMask.Builder builderForValue) { - if (updateMaskBuilder_ == null) { - updateMask_ = builderForValue.build(); - onChanged(); - } else { - updateMaskBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { - if (updateMaskBuilder_ == null) { - if (updateMask_ != null) { - updateMask_ = - com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); - } else { - updateMask_ = value; - } - onChanged(); - } else { - updateMaskBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public Builder clearUpdateMask() { - if (updateMaskBuilder_ == null) { - updateMask_ = null; - onChanged(); - } else { - updateMask_ = null; - updateMaskBuilder_ = null; - } - - return this; - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { - - onChanged(); - return getUpdateMaskFieldBuilder().getBuilder(); - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { - if (updateMaskBuilder_ != null) { - return updateMaskBuilder_.getMessageOrBuilder(); - } else { - return updateMask_ == null ? - com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; - } - } - /** - *
-     * The list of fields to be updated.
-     * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> - getUpdateMaskFieldBuilder() { - if (updateMaskBuilder_ == null) { - updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( - getUpdateMask(), - getParentForChildren(), - isClean()); - updateMask_ = null; - } - return updateMaskBuilder_; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) - private static final com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest(); - } - - public static com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public UpdatePhraseSetRequest parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdatePhraseSetRequest(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java deleted file mode 100644 index ae3c2a999eb0..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/UpdatePhraseSetRequestOrBuilder.java +++ /dev/null @@ -1,87 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface UpdatePhraseSetRequestOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Required. The phrase set to update.
-   * The phrase set's `name` field is used to identify the set to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return Whether the phraseSet field is set. - */ - boolean hasPhraseSet(); - /** - *
-   * Required. The phrase set to update.
-   * The phrase set's `name` field is used to identify the set to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return The phraseSet. - */ - com.google.cloud.speech.v1p1beta1.PhraseSet getPhraseSet(); - /** - *
-   * Required. The phrase set to update.
-   * The phrase set's `name` field is used to identify the set to be
-   * updated. Format:
-   * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
-   * Speech-to-Text supports three locations: `global`, `us` (US North America),
-   * and `eu` (Europe). If you are calling the `speech.googleapis.com`
-   * endpoint, use the `global` location. To specify a region, use a
-   * [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints)
-   * with matching `us` or `eu` location value.
-   * 
- * - * .google.cloud.speech.v1p1beta1.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - com.google.cloud.speech.v1p1beta1.PhraseSetOrBuilder getPhraseSetOrBuilder(); - - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return Whether the updateMask field is set. - */ - boolean hasUpdateMask(); - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - * @return The updateMask. - */ - com.google.protobuf.FieldMask getUpdateMask(); - /** - *
-   * The list of fields to be updated.
-   * 
- * - * .google.protobuf.FieldMask update_mask = 2; - */ - com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java deleted file mode 100644 index 57c082189d6f..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfo.java +++ /dev/null @@ -1,1389 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -/** - *
- * Word-specific information for recognized words.
- * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.WordInfo} - */ -public final class WordInfo extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1p1beta1.WordInfo) - WordInfoOrBuilder { -private static final long serialVersionUID = 0L; - // Use WordInfo.newBuilder() to construct. - private WordInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private WordInfo() { - word_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new WordInfo(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private WordInfo( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (startTime_ != null) { - subBuilder = startTime_.toBuilder(); - } - startTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(startTime_); - startTime_ = subBuilder.buildPartial(); - } - - break; - } - case 18: { - com.google.protobuf.Duration.Builder subBuilder = null; - if (endTime_ != null) { - subBuilder = endTime_.toBuilder(); - } - endTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(endTime_); - endTime_ = subBuilder.buildPartial(); - } - - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - word_ = s; - break; - } - case 37: { - - confidence_ = input.readFloat(); - break; - } - case 40: { - - speakerTag_ = input.readInt32(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.WordInfo.class, com.google.cloud.speech.v1p1beta1.WordInfo.Builder.class); - } - - public static final int START_TIME_FIELD_NUMBER = 1; - private com.google.protobuf.Duration startTime_; - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * @return Whether the startTime field is set. - */ - @java.lang.Override - public boolean hasStartTime() { - return startTime_ != null; - } - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * @return The startTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getStartTime() { - return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; - } - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { - return getStartTime(); - } - - public static final int END_TIME_FIELD_NUMBER = 2; - private com.google.protobuf.Duration endTime_; - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * @return Whether the endTime field is set. - */ - @java.lang.Override - public boolean hasEndTime() { - return endTime_ != null; - } - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * @return The endTime. - */ - @java.lang.Override - public com.google.protobuf.Duration getEndTime() { - return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; - } - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - */ - @java.lang.Override - public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { - return getEndTime(); - } - - public static final int WORD_FIELD_NUMBER = 3; - private volatile java.lang.Object word_; - /** - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * @return The word. - */ - @java.lang.Override - public java.lang.String getWord() { - java.lang.Object ref = word_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - word_ = s; - return s; - } - } - /** - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * @return The bytes for word. - */ - @java.lang.Override - public com.google.protobuf.ByteString - getWordBytes() { - java.lang.Object ref = word_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - word_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CONFIDENCE_FIELD_NUMBER = 4; - private float confidence_; - /** - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 4; - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - - public static final int SPEAKER_TAG_FIELD_NUMBER = 5; - private int speakerTag_; - /** - *
-   * Output only. A distinct integer value is assigned for every speaker within
-   * the audio. This field specifies which one of those speakers was detected to
-   * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-   * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-   * top alternative.
-   * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The speakerTag. - */ - @java.lang.Override - public int getSpeakerTag() { - return speakerTag_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (startTime_ != null) { - output.writeMessage(1, getStartTime()); - } - if (endTime_ != null) { - output.writeMessage(2, getEndTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(word_)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, word_); - } - if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { - output.writeFloat(4, confidence_); - } - if (speakerTag_ != 0) { - output.writeInt32(5, speakerTag_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (startTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getStartTime()); - } - if (endTime_ != null) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getEndTime()); - } - if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(word_)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, word_); - } - if (java.lang.Float.floatToRawIntBits(confidence_) != 0) { - size += com.google.protobuf.CodedOutputStream - .computeFloatSize(4, confidence_); - } - if (speakerTag_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, speakerTag_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.speech.v1p1beta1.WordInfo)) { - return super.equals(obj); - } - com.google.cloud.speech.v1p1beta1.WordInfo other = (com.google.cloud.speech.v1p1beta1.WordInfo) obj; - - if (hasStartTime() != other.hasStartTime()) return false; - if (hasStartTime()) { - if (!getStartTime() - .equals(other.getStartTime())) return false; - } - if (hasEndTime() != other.hasEndTime()) return false; - if (hasEndTime()) { - if (!getEndTime() - .equals(other.getEndTime())) return false; - } - if (!getWord() - .equals(other.getWord())) return false; - if (java.lang.Float.floatToIntBits(getConfidence()) - != java.lang.Float.floatToIntBits( - other.getConfidence())) return false; - if (getSpeakerTag() - != other.getSpeakerTag()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasStartTime()) { - hash = (37 * hash) + START_TIME_FIELD_NUMBER; - hash = (53 * hash) + getStartTime().hashCode(); - } - if (hasEndTime()) { - hash = (37 * hash) + END_TIME_FIELD_NUMBER; - hash = (53 * hash) + getEndTime().hashCode(); - } - hash = (37 * hash) + WORD_FIELD_NUMBER; - hash = (53 * hash) + getWord().hashCode(); - hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; - hash = (53 * hash) + java.lang.Float.floatToIntBits( - getConfidence()); - hash = (37 * hash) + SPEAKER_TAG_FIELD_NUMBER; - hash = (53 * hash) + getSpeakerTag(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.WordInfo parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.WordInfo parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static com.google.cloud.speech.v1p1beta1.WordInfo parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(com.google.cloud.speech.v1p1beta1.WordInfo prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Word-specific information for recognized words.
-   * 
- * - * Protobuf type {@code google.cloud.speech.v1p1beta1.WordInfo} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.speech.v1p1beta1.WordInfo) - com.google.cloud.speech.v1p1beta1.WordInfoOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_WordInfo_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.speech.v1p1beta1.WordInfo.class, com.google.cloud.speech.v1p1beta1.WordInfo.Builder.class); - } - - // Construct using com.google.cloud.speech.v1p1beta1.WordInfo.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (startTimeBuilder_ == null) { - startTime_ = null; - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - if (endTimeBuilder_ == null) { - endTime_ = null; - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - word_ = ""; - - confidence_ = 0F; - - speakerTag_ = 0; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.cloud.speech.v1p1beta1.SpeechProto.internal_static_google_cloud_speech_v1p1beta1_WordInfo_descriptor; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.WordInfo getDefaultInstanceForType() { - return com.google.cloud.speech.v1p1beta1.WordInfo.getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.WordInfo build() { - com.google.cloud.speech.v1p1beta1.WordInfo result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.WordInfo buildPartial() { - com.google.cloud.speech.v1p1beta1.WordInfo result = new com.google.cloud.speech.v1p1beta1.WordInfo(this); - if (startTimeBuilder_ == null) { - result.startTime_ = startTime_; - } else { - result.startTime_ = startTimeBuilder_.build(); - } - if (endTimeBuilder_ == null) { - result.endTime_ = endTime_; - } else { - result.endTime_ = endTimeBuilder_.build(); - } - result.word_ = word_; - result.confidence_ = confidence_; - result.speakerTag_ = speakerTag_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.speech.v1p1beta1.WordInfo) { - return mergeFrom((com.google.cloud.speech.v1p1beta1.WordInfo)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.cloud.speech.v1p1beta1.WordInfo other) { - if (other == com.google.cloud.speech.v1p1beta1.WordInfo.getDefaultInstance()) return this; - if (other.hasStartTime()) { - mergeStartTime(other.getStartTime()); - } - if (other.hasEndTime()) { - mergeEndTime(other.getEndTime()); - } - if (!other.getWord().isEmpty()) { - word_ = other.word_; - onChanged(); - } - if (other.getConfidence() != 0F) { - setConfidence(other.getConfidence()); - } - if (other.getSpeakerTag() != 0) { - setSpeakerTag(other.getSpeakerTag()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.speech.v1p1beta1.WordInfo parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (com.google.cloud.speech.v1p1beta1.WordInfo) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private com.google.protobuf.Duration startTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> startTimeBuilder_; - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - * @return Whether the startTime field is set. - */ - public boolean hasStartTime() { - return startTimeBuilder_ != null || startTime_ != null; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - * @return The startTime. - */ - public com.google.protobuf.Duration getStartTime() { - if (startTimeBuilder_ == null) { - return startTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTime_; - } else { - return startTimeBuilder_.getMessage(); - } - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder setStartTime(com.google.protobuf.Duration value) { - if (startTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - startTime_ = value; - onChanged(); - } else { - startTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder setStartTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (startTimeBuilder_ == null) { - startTime_ = builderForValue.build(); - onChanged(); - } else { - startTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder mergeStartTime(com.google.protobuf.Duration value) { - if (startTimeBuilder_ == null) { - if (startTime_ != null) { - startTime_ = - com.google.protobuf.Duration.newBuilder(startTime_).mergeFrom(value).buildPartial(); - } else { - startTime_ = value; - } - onChanged(); - } else { - startTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public Builder clearStartTime() { - if (startTimeBuilder_ == null) { - startTime_ = null; - onChanged(); - } else { - startTime_ = null; - startTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public com.google.protobuf.Duration.Builder getStartTimeBuilder() { - - onChanged(); - return getStartTimeFieldBuilder().getBuilder(); - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - public com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder() { - if (startTimeBuilder_ != null) { - return startTimeBuilder_.getMessageOrBuilder(); - } else { - return startTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : startTime_; - } - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the start of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration start_time = 1; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getStartTimeFieldBuilder() { - if (startTimeBuilder_ == null) { - startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getStartTime(), - getParentForChildren(), - isClean()); - startTime_ = null; - } - return startTimeBuilder_; - } - - private com.google.protobuf.Duration endTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> endTimeBuilder_; - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - * @return Whether the endTime field is set. - */ - public boolean hasEndTime() { - return endTimeBuilder_ != null || endTime_ != null; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - * @return The endTime. - */ - public com.google.protobuf.Duration getEndTime() { - if (endTimeBuilder_ == null) { - return endTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTime_; - } else { - return endTimeBuilder_.getMessage(); - } - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder setEndTime(com.google.protobuf.Duration value) { - if (endTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - endTime_ = value; - onChanged(); - } else { - endTimeBuilder_.setMessage(value); - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder setEndTime( - com.google.protobuf.Duration.Builder builderForValue) { - if (endTimeBuilder_ == null) { - endTime_ = builderForValue.build(); - onChanged(); - } else { - endTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder mergeEndTime(com.google.protobuf.Duration value) { - if (endTimeBuilder_ == null) { - if (endTime_ != null) { - endTime_ = - com.google.protobuf.Duration.newBuilder(endTime_).mergeFrom(value).buildPartial(); - } else { - endTime_ = value; - } - onChanged(); - } else { - endTimeBuilder_.mergeFrom(value); - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public Builder clearEndTime() { - if (endTimeBuilder_ == null) { - endTime_ = null; - onChanged(); - } else { - endTime_ = null; - endTimeBuilder_ = null; - } - - return this; - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public com.google.protobuf.Duration.Builder getEndTimeBuilder() { - - onChanged(); - return getEndTimeFieldBuilder().getBuilder(); - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - public com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder() { - if (endTimeBuilder_ != null) { - return endTimeBuilder_.getMessageOrBuilder(); - } else { - return endTime_ == null ? - com.google.protobuf.Duration.getDefaultInstance() : endTime_; - } - } - /** - *
-     * Time offset relative to the beginning of the audio,
-     * and corresponding to the end of the spoken word.
-     * This field is only set if `enable_word_time_offsets=true` and only
-     * in the top hypothesis.
-     * This is an experimental feature and the accuracy of the time offset can
-     * vary.
-     * 
- * - * .google.protobuf.Duration end_time = 2; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> - getEndTimeFieldBuilder() { - if (endTimeBuilder_ == null) { - endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( - getEndTime(), - getParentForChildren(), - isClean()); - endTime_ = null; - } - return endTimeBuilder_; - } - - private java.lang.Object word_ = ""; - /** - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * @return The word. - */ - public java.lang.String getWord() { - java.lang.Object ref = word_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - word_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * @return The bytes for word. - */ - public com.google.protobuf.ByteString - getWordBytes() { - java.lang.Object ref = word_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - word_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * @param value The word to set. - * @return This builder for chaining. - */ - public Builder setWord( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - word_ = value; - onChanged(); - return this; - } - /** - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * @return This builder for chaining. - */ - public Builder clearWord() { - - word_ = getDefaultInstance().getWord(); - onChanged(); - return this; - } - /** - *
-     * The word corresponding to this set of information.
-     * 
- * - * string word = 3; - * @param value The bytes for word to set. - * @return This builder for chaining. - */ - public Builder setWordBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - word_ = value; - onChanged(); - return this; - } - - private float confidence_ ; - /** - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 4; - * @return The confidence. - */ - @java.lang.Override - public float getConfidence() { - return confidence_; - } - /** - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 4; - * @param value The confidence to set. - * @return This builder for chaining. - */ - public Builder setConfidence(float value) { - - confidence_ = value; - onChanged(); - return this; - } - /** - *
-     * The confidence estimate between 0.0 and 1.0. A higher number
-     * indicates an estimated greater likelihood that the recognized words are
-     * correct. This field is set only for the top alternative of a non-streaming
-     * result or, of a streaming result where `is_final=true`.
-     * This field is not guaranteed to be accurate and users should not rely on it
-     * to be always provided.
-     * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-     * 
- * - * float confidence = 4; - * @return This builder for chaining. - */ - public Builder clearConfidence() { - - confidence_ = 0F; - onChanged(); - return this; - } - - private int speakerTag_ ; - /** - *
-     * Output only. A distinct integer value is assigned for every speaker within
-     * the audio. This field specifies which one of those speakers was detected to
-     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-     * top alternative.
-     * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The speakerTag. - */ - @java.lang.Override - public int getSpeakerTag() { - return speakerTag_; - } - /** - *
-     * Output only. A distinct integer value is assigned for every speaker within
-     * the audio. This field specifies which one of those speakers was detected to
-     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-     * top alternative.
-     * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param value The speakerTag to set. - * @return This builder for chaining. - */ - public Builder setSpeakerTag(int value) { - - speakerTag_ = value; - onChanged(); - return this; - } - /** - *
-     * Output only. A distinct integer value is assigned for every speaker within
-     * the audio. This field specifies which one of those speakers was detected to
-     * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-     * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-     * top alternative.
-     * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return This builder for chaining. - */ - public Builder clearSpeakerTag() { - - speakerTag_ = 0; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:google.cloud.speech.v1p1beta1.WordInfo) - } - - // @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.WordInfo) - private static final com.google.cloud.speech.v1p1beta1.WordInfo DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.google.cloud.speech.v1p1beta1.WordInfo(); - } - - public static com.google.cloud.speech.v1p1beta1.WordInfo getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WordInfo parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WordInfo(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.speech.v1p1beta1.WordInfo getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java deleted file mode 100644 index b811f0f3088d..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/java/com/google/cloud/speech/v1p1beta1/WordInfoOrBuilder.java +++ /dev/null @@ -1,143 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/cloud/speech/v1p1beta1/cloud_speech.proto - -package com.google.cloud.speech.v1p1beta1; - -public interface WordInfoOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.speech.v1p1beta1.WordInfo) - com.google.protobuf.MessageOrBuilder { - - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * @return Whether the startTime field is set. - */ - boolean hasStartTime(); - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - * @return The startTime. - */ - com.google.protobuf.Duration getStartTime(); - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the start of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration start_time = 1; - */ - com.google.protobuf.DurationOrBuilder getStartTimeOrBuilder(); - - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * @return Whether the endTime field is set. - */ - boolean hasEndTime(); - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - * @return The endTime. - */ - com.google.protobuf.Duration getEndTime(); - /** - *
-   * Time offset relative to the beginning of the audio,
-   * and corresponding to the end of the spoken word.
-   * This field is only set if `enable_word_time_offsets=true` and only
-   * in the top hypothesis.
-   * This is an experimental feature and the accuracy of the time offset can
-   * vary.
-   * 
- * - * .google.protobuf.Duration end_time = 2; - */ - com.google.protobuf.DurationOrBuilder getEndTimeOrBuilder(); - - /** - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * @return The word. - */ - java.lang.String getWord(); - /** - *
-   * The word corresponding to this set of information.
-   * 
- * - * string word = 3; - * @return The bytes for word. - */ - com.google.protobuf.ByteString - getWordBytes(); - - /** - *
-   * The confidence estimate between 0.0 and 1.0. A higher number
-   * indicates an estimated greater likelihood that the recognized words are
-   * correct. This field is set only for the top alternative of a non-streaming
-   * result or, of a streaming result where `is_final=true`.
-   * This field is not guaranteed to be accurate and users should not rely on it
-   * to be always provided.
-   * The default of 0.0 is a sentinel value indicating `confidence` was not set.
-   * 
- * - * float confidence = 4; - * @return The confidence. - */ - float getConfidence(); - - /** - *
-   * Output only. A distinct integer value is assigned for every speaker within
-   * the audio. This field specifies which one of those speakers was detected to
-   * have spoken this word. Value ranges from '1' to diarization_speaker_count.
-   * speaker_tag is set if enable_speaker_diarization = 'true' and only in the
-   * top alternative.
-   * 
- * - * int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return The speakerTag. - */ - int getSpeakerTag(); -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto deleted file mode 100644 index 9bf36fccf208..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech.proto +++ /dev/null @@ -1,929 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.speech.v1p1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/cloud/speech/v1p1beta1/resource.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/rpc/status.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech"; -option java_multiple_files = true; -option java_outer_classname = "SpeechProto"; -option java_package = "com.google.cloud.speech.v1p1beta1"; -option objc_class_prefix = "GCS"; - -// Service that implements Google Cloud Speech API. -service Speech { - option (google.api.default_host) = "speech.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Performs synchronous speech recognition: receive results after all audio - // has been sent and processed. - rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { - option (google.api.http) = { - post: "/v1p1beta1/speech:recognize" - body: "*" - }; - option (google.api.method_signature) = "config,audio"; - } - - // Performs asynchronous speech recognition: receive results via the - // google.longrunning.Operations interface. Returns either an - // `Operation.error` or an `Operation.response` which contains - // a `LongRunningRecognizeResponse` message. - // For more information on asynchronous speech recognition, see the - // [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - rpc LongRunningRecognize(LongRunningRecognizeRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p1beta1/speech:longrunningrecognize" - body: "*" - }; - option (google.api.method_signature) = "config,audio"; - option (google.longrunning.operation_info) = { - response_type: "LongRunningRecognizeResponse" - metadata_type: "LongRunningRecognizeMetadata" - }; - } - - // Performs bidirectional streaming speech recognition: receive results while - // sending audio. This method is only available via the gRPC API (not REST). - rpc StreamingRecognize(stream StreamingRecognizeRequest) returns (stream StreamingRecognizeResponse) { - } -} - -// The top-level message sent by the client for the `Recognize` method. -message RecognizeRequest { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The audio data to be recognized. - RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The top-level message sent by the client for the `LongRunningRecognize` -// method. -message LongRunningRecognizeRequest { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The audio data to be recognized. - RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Specifies an optional destination for the recognition results. - TranscriptOutputConfig output_config = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Specifies an optional destination for the recognition results. -message TranscriptOutputConfig { - oneof output_type { - // Specifies a Cloud Storage URI for the recognition results. Must be - // specified in the format: `gs://bucket_name/object_name`, and the bucket - // must already exist. - string gcs_uri = 1; - } -} - -// The top-level message sent by the client for the `StreamingRecognize` method. -// Multiple `StreamingRecognizeRequest` messages are sent. The first message -// must contain a `streaming_config` message and must not contain -// `audio_content`. All subsequent messages must contain `audio_content` and -// must not contain a `streaming_config` message. -message StreamingRecognizeRequest { - // The streaming request, which is either a streaming config or audio content. - oneof streaming_request { - // Provides information to the recognizer that specifies how to process the - // request. The first `StreamingRecognizeRequest` message must contain a - // `streaming_config` message. - StreamingRecognitionConfig streaming_config = 1; - - // The audio data to be recognized. Sequential chunks of audio data are sent - // in sequential `StreamingRecognizeRequest` messages. The first - // `StreamingRecognizeRequest` message must not contain `audio_content` data - // and all subsequent `StreamingRecognizeRequest` messages must contain - // `audio_content` data. The audio bytes must be encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - // pure binary representation (not base64). See - // [content limits](https://cloud.google.com/speech-to-text/quotas#content). - bytes audio_content = 2; - } -} - -// Provides information to the recognizer that specifies how to process the -// request. -message StreamingRecognitionConfig { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // If `false` or omitted, the recognizer will perform continuous - // recognition (continuing to wait for and process audio even if the user - // pauses speaking) until the client closes the input stream (gRPC API) or - // until the maximum time limit has been reached. May return multiple - // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. - // - // If `true`, the recognizer will detect a single spoken utterance. When it - // detects that the user has paused or stopped speaking, it will return an - // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no - // more than one `StreamingRecognitionResult` with the `is_final` flag set to - // `true`. - // - // The `single_utterance` field can only be used with specified models, - // otherwise an error is thrown. The `model` field in [`RecognitionConfig`][] - // must be set to: - // - // * `command_and_search` - // * `phone_call` AND additional field `useEnhanced`=`true` - // * The `model` field is left undefined. In this case the API auto-selects - // a model based on any other parameters that you set in - // `RecognitionConfig`. - bool single_utterance = 2; - - // If `true`, interim results (tentative hypotheses) may be - // returned as they become available (these interim results are indicated with - // the `is_final=false` flag). - // If `false` or omitted, only `is_final=true` result(s) are returned. - bool interim_results = 3; -} - -// Provides information to the recognizer that specifies how to process the -// request. -message RecognitionConfig { - // The encoding of the audio data sent in the request. - // - // All encodings support only 1 channel (mono) audio, unless the - // `audio_channel_count` and `enable_separate_recognition_per_channel` fields - // are set. - // - // For best results, the audio source should be captured and transmitted using - // a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech - // recognition can be reduced if lossy codecs are used to capture or transmit - // audio, particularly if background noise is present. Lossy codecs include - // `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`, - // and `WEBM_OPUS`. - // - // The `FLAC` and `WAV` audio file formats include a header that describes the - // included audio content. You can request recognition for `WAV` files that - // contain either `LINEAR16` or `MULAW` encoded audio. - // If you send `FLAC` or `WAV` audio file format in - // your request, you do not need to specify an `AudioEncoding`; the audio - // encoding format is determined from the file header. If you specify - // an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the - // encoding configuration must match the encoding described in the audio - // header; otherwise the request returns an - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code. - enum AudioEncoding { - // Not specified. - ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - LINEAR16 = 1; - - // `FLAC` (Free Lossless Audio - // Codec) is the recommended encoding because it is - // lossless--therefore recognition is not compromised--and - // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream - // encoding supports 16-bit and 24-bit samples, however, not all fields in - // `STREAMINFO` are supported. - FLAC = 2; - - // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - MULAW = 3; - - // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. - AMR = 4; - - // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. - AMR_WB = 5; - - // Opus encoded audio frames in Ogg container - // ([OggOpus](https://wiki.xiph.org/OggOpus)). - // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. - OGG_OPUS = 6; - - // Although the use of lossy encodings is not recommended, if a very low - // bitrate encoding is required, `OGG_OPUS` is highly preferred over - // Speex encoding. The [Speex](https://speex.org/) encoding supported by - // Cloud Speech API has a header byte in each block, as in MIME type - // `audio/x-speex-with-header-byte`. - // It is a variant of the RTP Speex encoding defined in - // [RFC 5574](https://tools.ietf.org/html/rfc5574). - // The stream is a sequence of blocks, one block per RTP packet. Each block - // starts with a byte containing the length of the block, in bytes, followed - // by one or more frames of Speex data, padded to an integral number of - // bytes (octets) as specified in RFC 5574. In other words, each RTP header - // is replaced with a single byte containing the block length. Only Speex - // wideband is supported. `sample_rate_hertz` must be 16000. - SPEEX_WITH_HEADER_BYTE = 7; - - // MP3 audio. MP3 encoding is a Beta feature and only available in - // v1p1beta1. Support all standard MP3 bitrates (which range from 32-320 - // kbps). When using this encoding, `sample_rate_hertz` has to match the - // sample rate of the file being used. - MP3 = 8; - - // Opus encoded audio frames in WebM container - // ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be - // one of 8000, 12000, 16000, 24000, or 48000. - WEBM_OPUS = 9; - } - - // Encoding of audio data sent in all `RecognitionAudio` messages. - // This field is optional for `FLAC` and `WAV` audio files and required - // for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding]. - AudioEncoding encoding = 1; - - // Sample rate in Hertz of the audio data sent in all - // `RecognitionAudio` messages. Valid values are: 8000-48000. - // 16000 is optimal. For best results, set the sampling rate of the audio - // source to 16000 Hz. If that's not possible, use the native sample rate of - // the audio source (instead of re-sampling). - // This field is optional for FLAC and WAV audio files, but is - // required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding]. - int32 sample_rate_hertz = 2; - - // The number of channels in the input audio data. - // ONLY set this for MULTI-CHANNEL recognition. - // Valid values for LINEAR16 and FLAC are `1`-`8`. - // Valid values for OGG_OPUS are '1'-'254'. - // Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. - // If `0` or omitted, defaults to one channel (mono). - // Note: We only recognize the first channel by default. - // To perform independent recognition on each channel set - // `enable_separate_recognition_per_channel` to 'true'. - int32 audio_channel_count = 7; - - // This needs to be set to `true` explicitly and `audio_channel_count` > 1 - // to get each channel recognized separately. The recognition result will - // contain a `channel_tag` field to state which channel that result belongs - // to. If this is not true, we will only recognize the first channel. The - // request is billed cumulatively for all channels recognized: - // `audio_channel_count` multiplied by the length of the audio. - bool enable_separate_recognition_per_channel = 12; - - // Required. The language of the supplied audio as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - // Example: "en-US". - // See [Language - // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - // of the currently supported language codes. - string language_code = 3 [(google.api.field_behavior) = REQUIRED]; - - // A list of up to 3 additional - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, - // listing possible alternative languages of the supplied audio. - // See [Language - // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - // of the currently supported language codes. If alternative languages are - // listed, recognition result will contain recognition in the most likely - // language detected including the main language_code. The recognition result - // will include the language tag of the language detected in the audio. Note: - // This feature is only supported for Voice Command and Voice Search use cases - // and performance may vary for other use cases (e.g., phone call - // transcription). - repeated string alternative_language_codes = 18; - - // Maximum number of recognition hypotheses to be returned. - // Specifically, the maximum number of `SpeechRecognitionAlternative` messages - // within each `SpeechRecognitionResult`. - // The server may return fewer than `max_alternatives`. - // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of - // one. If omitted, will return a maximum of one. - int32 max_alternatives = 4; - - // If set to `true`, the server will attempt to filter out - // profanities, replacing all but the initial character in each filtered word - // with asterisks, e.g. "f***". If set to `false` or omitted, profanities - // won't be filtered out. - bool profanity_filter = 5; - - // Speech adaptation configuration improves the accuracy of speech - // recognition. For more information, see the [speech - // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation) - // documentation. - // When speech adaptation is set it supersedes the `speech_contexts` field. - SpeechAdaptation adaptation = 20; - - // Use transcription normalization to automatically replace parts of the - // transcript with phrases of your choosing. For StreamingRecognize, this - // normalization only applies to stable partial transcripts (stability > 0.8) - // and final transcripts. - TranscriptNormalization transcript_normalization = 24; - - // Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext]. - // A means to provide context to assist the speech recognition. For more - // information, see - // [speech - // adaptation](https://cloud.google.com/speech-to-text/docs/adaptation). - repeated SpeechContext speech_contexts = 6; - - // If `true`, the top result includes a list of words and - // the start and end time offsets (timestamps) for those words. If - // `false`, no word-level time offset information is returned. The default is - // `false`. - bool enable_word_time_offsets = 8; - - // If `true`, the top result includes a list of words and the - // confidence for those words. If `false`, no word-level confidence - // information is returned. The default is `false`. - bool enable_word_confidence = 15; - - // If 'true', adds punctuation to recognition result hypotheses. - // This feature is only available in select languages. Setting this for - // requests in other languages has no effect at all. - // The default 'false' value does not add punctuation to result hypotheses. - bool enable_automatic_punctuation = 11; - - // The spoken punctuation behavior for the call - // If not set, uses default behavior based on model of choice - // e.g. command_and_search will enable spoken punctuation by default - // If 'true', replaces spoken punctuation with the corresponding symbols in - // the request. For example, "how are you question mark" becomes "how are - // you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation - // for support. If 'false', spoken punctuation is not replaced. - google.protobuf.BoolValue enable_spoken_punctuation = 22; - - // The spoken emoji behavior for the call - // If not set, uses default behavior based on model of choice - // If 'true', adds spoken emoji formatting for the request. This will replace - // spoken emojis with the corresponding Unicode symbols in the final - // transcript. If 'false', spoken emojis are not replaced. - google.protobuf.BoolValue enable_spoken_emojis = 23; - - // If 'true', enables speaker detection for each recognized word in - // the top alternative of the recognition result using a speaker_tag provided - // in the WordInfo. - // Note: Use diarization_config instead. - bool enable_speaker_diarization = 16 [deprecated = true]; - - // If set, specifies the estimated number of speakers in the conversation. - // Defaults to '2'. Ignored unless enable_speaker_diarization is set to true. - // Note: Use diarization_config instead. - int32 diarization_speaker_count = 17 [deprecated = true]; - - // Config to enable speaker diarization and set additional - // parameters to make diarization better suited for your application. - // Note: When this is enabled, we send all the words from the beginning of the - // audio for the top alternative in every consecutive STREAMING responses. - // This is done in order to improve our speaker tags as our models learn to - // identify the speakers in the conversation over time. - // For non-streaming requests, the diarization results will be provided only - // in the top alternative of the FINAL SpeechRecognitionResult. - SpeakerDiarizationConfig diarization_config = 19; - - // Metadata regarding this request. - RecognitionMetadata metadata = 9; - - // Which model to select for the given request. Select the model - // best suited to your domain to get best results. If a model is not - // explicitly specified, then we auto-select a model based on the parameters - // in the RecognitionConfig. - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - //
ModelDescription
latest_longBest for long form content like media or conversation.
latest_shortBest for short form content like commands or single shot directed - // speech.
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically - // recorded at an 8khz sampling rate).
videoBest for audio that originated from video or includes multiple - // speakers. Ideally the audio is recorded at a 16khz or greater - // sampling rate. This is a premium model that costs more than the - // standard rate.
defaultBest for audio that is not one of the specific audio models. - // For example, long-form audio. Ideally the audio is high-fidelity, - // recorded at a 16khz or greater sampling rate.
medical_conversationBest for audio that originated from a conversation between a - // medical provider and patient.
medical_dictationBest for audio that originated from dictation notes by a medical - // provider.
- string model = 13; - - // Set to true to use an enhanced model for speech recognition. - // If `use_enhanced` is set to true and the `model` field is not set, then - // an appropriate enhanced model is chosen if an enhanced model exists for - // the audio. - // - // If `use_enhanced` is true and an enhanced version of the specified model - // does not exist, then the speech is recognized using the standard version - // of the specified model. - bool use_enhanced = 14; -} - -// Config to enable speaker diarization. -message SpeakerDiarizationConfig { - // If 'true', enables speaker detection for each recognized word in - // the top alternative of the recognition result using a speaker_tag provided - // in the WordInfo. - bool enable_speaker_diarization = 1; - - // Minimum number of speakers in the conversation. This range gives you more - // flexibility by allowing the system to automatically determine the correct - // number of speakers. If not set, the default value is 2. - int32 min_speaker_count = 2; - - // Maximum number of speakers in the conversation. This range gives you more - // flexibility by allowing the system to automatically determine the correct - // number of speakers. If not set, the default value is 6. - int32 max_speaker_count = 3; - - // Output only. Unused. - int32 speaker_tag = 5 [ - deprecated = true, - (google.api.field_behavior) = OUTPUT_ONLY - ]; -} - -// Description of audio data to be recognized. -message RecognitionMetadata { - option deprecated = true; - - // Use case categories that the audio recognition request can be described - // by. - enum InteractionType { - // Use case is either unknown or is something other than one of the other - // values below. - INTERACTION_TYPE_UNSPECIFIED = 0; - - // Multiple people in a conversation or discussion. For example in a - // meeting with two or more people actively participating. Typically - // all the primary people speaking would be in the same room (if not, - // see PHONE_CALL) - DISCUSSION = 1; - - // One or more persons lecturing or presenting to others, mostly - // uninterrupted. - PRESENTATION = 2; - - // A phone-call or video-conference in which two or more people, who are - // not in the same room, are actively participating. - PHONE_CALL = 3; - - // A recorded message intended for another person to listen to. - VOICEMAIL = 4; - - // Professionally produced audio (eg. TV Show, Podcast). - PROFESSIONALLY_PRODUCED = 5; - - // Transcribe spoken questions and queries into text. - VOICE_SEARCH = 6; - - // Transcribe voice commands, such as for controlling a device. - VOICE_COMMAND = 7; - - // Transcribe speech to text to create a written document, such as a - // text-message, email or report. - DICTATION = 8; - } - - // Enumerates the types of capture settings describing an audio file. - enum MicrophoneDistance { - // Audio type is not known. - MICROPHONE_DISTANCE_UNSPECIFIED = 0; - - // The audio was captured from a closely placed microphone. Eg. phone, - // dictaphone, or handheld microphone. Generally if there speaker is within - // 1 meter of the microphone. - NEARFIELD = 1; - - // The speaker if within 3 meters of the microphone. - MIDFIELD = 2; - - // The speaker is more than 3 meters away from the microphone. - FARFIELD = 3; - } - - // The original media the speech was recorded on. - enum OriginalMediaType { - // Unknown original media type. - ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - - // The speech data is an audio recording. - AUDIO = 1; - - // The speech data originally recorded on a video. - VIDEO = 2; - } - - // The type of device the speech was recorded with. - enum RecordingDeviceType { - // The recording device is unknown. - RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - - // Speech was recorded on a smartphone. - SMARTPHONE = 1; - - // Speech was recorded using a personal computer or tablet. - PC = 2; - - // Speech was recorded over a phone line. - PHONE_LINE = 3; - - // Speech was recorded in a vehicle. - VEHICLE = 4; - - // Speech was recorded outdoors. - OTHER_OUTDOOR_DEVICE = 5; - - // Speech was recorded indoors. - OTHER_INDOOR_DEVICE = 6; - } - - // The use case most closely describing the audio content to be recognized. - InteractionType interaction_type = 1; - - // The industry vertical to which this speech recognition request most - // closely applies. This is most indicative of the topics contained - // in the audio. Use the 6-digit NAICS code to identify the industry - // vertical - see https://www.naics.com/search/. - uint32 industry_naics_code_of_audio = 3; - - // The audio type that most closely describes the audio being recognized. - MicrophoneDistance microphone_distance = 4; - - // The original media the speech was recorded on. - OriginalMediaType original_media_type = 5; - - // The type of device the speech was recorded with. - RecordingDeviceType recording_device_type = 6; - - // The device used to make the recording. Examples 'Nexus 5X' or - // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or - // 'Cardioid Microphone'. - string recording_device_name = 7; - - // Mime type of the original audio file. For example `audio/m4a`, - // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. - // A list of possible audio mime types is maintained at - // http://www.iana.org/assignments/media-types/media-types.xhtml#audio - string original_mime_type = 8; - - // Obfuscated (privacy-protected) ID of the user, to identify number of - // unique users using the service. - int64 obfuscated_id = 9 [deprecated = true]; - - // Description of the content. Eg. "Recordings of federal supreme court - // hearings from 2012". - string audio_topic = 10; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message SpeechContext { - // A list of strings containing words and phrases "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - // - // List items can also be set to classes for groups of words that represent - // common concepts that occur in natural language. For example, rather than - // providing phrase hints for every month of the year, using the $MONTH class - // improves the likelihood of correctly transcribing audio that includes - // months. - repeated string phrases = 1; - - // Hint Boost. Positive value will increase the probability that a specific - // phrase will be recognized over other similar sounding phrases. The higher - // the boost, the higher the chance of false positive recognition as well. - // Negative boost values would correspond to anti-biasing. Anti-biasing is not - // enabled, so negative boost will simply be ignored. Though `boost` can - // accept a wide range of positive values, most use cases are best served with - // values between 0 and 20. We recommend using a binary search approach to - // finding the optimal value for your use case. - float boost = 4; -} - -// Contains audio data in the encoding specified in the `RecognitionConfig`. -// Either `content` or `uri` must be supplied. Supplying both or neither -// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See -// [content limits](https://cloud.google.com/speech-to-text/quotas#content). -message RecognitionAudio { - // The audio source, which is either inline content or a Google Cloud - // Storage uri. - oneof audio_source { - // The audio data bytes encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - // pure binary representation, whereas JSON representations use base64. - bytes content = 1; - - // URI that points to a file that contains audio data bytes as specified in - // `RecognitionConfig`. The file must not be compressed (for example, gzip). - // Currently, only Google Cloud Storage URIs are - // supported, which must be specified in the following format: - // `gs://bucket_name/object_name` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see - // [Request URIs](https://cloud.google.com/storage/docs/reference-uris). - string uri = 2; - } -} - -// The only message returned to the client by the `Recognize` method. It -// contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. -message RecognizeResponse { - // Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; - - // When available, billed audio seconds for the corresponding request. - google.protobuf.Duration total_billed_time = 3; -} - -// The only message returned to the client by the `LongRunningRecognize` method. -// It contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. It is included in the `result.response` field of the `Operation` -// returned by the `GetOperation` call of the `google::longrunning::Operations` -// service. -message LongRunningRecognizeResponse { - // Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; - - // When available, billed audio seconds for the corresponding request. - google.protobuf.Duration total_billed_time = 3; - - // Original output config if present in the request. - TranscriptOutputConfig output_config = 6; - - // If the transcript output fails this field contains the relevant error. - google.rpc.Status output_error = 7; -} - -// Describes the progress of a long-running `LongRunningRecognize` call. It is -// included in the `metadata` field of the `Operation` returned by the -// `GetOperation` call of the `google::longrunning::Operations` service. -message LongRunningRecognizeMetadata { - // Approximate percentage of audio processed thus far. Guaranteed to be 100 - // when the audio is fully processed and the results are available. - int32 progress_percent = 1; - - // Time when the request was received. - google.protobuf.Timestamp start_time = 2; - - // Time of the most recent processing update. - google.protobuf.Timestamp last_update_time = 3; - - // Output only. The URI of the audio file being transcribed. Empty if the audio was sent - // as byte content. - string uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A copy of the TranscriptOutputConfig if it was set in the request. - TranscriptOutputConfig output_config = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// `StreamingRecognizeResponse` is the only message returned to the client by -// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` -// messages are streamed back to the client. If there is no recognizable -// audio, and `single_utterance` is set to false, then no messages are streamed -// back to the client. -// -// Here's an example of a series of `StreamingRecognizeResponse`s that might be -// returned while processing audio: -// -// 1. results { alternatives { transcript: "tube" } stability: 0.01 } -// -// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } -// -// 3. results { alternatives { transcript: "to be" } stability: 0.9 } -// results { alternatives { transcript: " or not to be" } stability: 0.01 } -// -// 4. results { alternatives { transcript: "to be or not to be" -// confidence: 0.92 } -// alternatives { transcript: "to bee or not to bee" } -// is_final: true } -// -// 5. results { alternatives { transcript: " that's" } stability: 0.01 } -// -// 6. results { alternatives { transcript: " that is" } stability: 0.9 } -// results { alternatives { transcript: " the question" } stability: 0.01 } -// -// 7. results { alternatives { transcript: " that is the question" -// confidence: 0.98 } -// alternatives { transcript: " that was the question" } -// is_final: true } -// -// Notes: -// -// - Only two of the above responses #4 and #7 contain final results; they are -// indicated by `is_final: true`. Concatenating these together generates the -// full transcript: "to be or not to be that is the question". -// -// - The others contain interim `results`. #3 and #6 contain two interim -// `results`: the first portion has a high stability and is less likely to -// change; the second portion has a low stability and is very likely to -// change. A UI designer might choose to show only high stability `results`. -// -// - The specific `stability` and `confidence` values shown above are only for -// illustrative purposes. Actual values may vary. -// -// - In each response, only one of these fields will be set: -// `error`, -// `speech_event_type`, or -// one or more (repeated) `results`. -message StreamingRecognizeResponse { - // Indicates the type of speech event. - enum SpeechEventType { - // No speech event specified. - SPEECH_EVENT_UNSPECIFIED = 0; - - // This event indicates that the server has detected the end of the user's - // speech utterance and expects no additional speech. Therefore, the server - // will not process additional audio (although it may subsequently return - // additional results). The client should stop sending additional audio - // data, half-close the gRPC connection, and wait for any additional results - // until the server closes the gRPC connection. This event is only sent if - // `single_utterance` was set to `true`, and is not used otherwise. - END_OF_SINGLE_UTTERANCE = 1; - } - - // If set, returns a [google.rpc.Status][google.rpc.Status] message that - // specifies the error for the operation. - google.rpc.Status error = 1; - - // This repeated list contains zero or more results that - // correspond to consecutive portions of the audio currently being processed. - // It contains zero or one `is_final=true` result (the newly settled portion), - // followed by zero or more `is_final=false` results (the interim results). - repeated StreamingRecognitionResult results = 2; - - // Indicates the type of speech event. - SpeechEventType speech_event_type = 4; - - // When available, billed audio seconds for the stream. - // Set only if this is the last response in the stream. - google.protobuf.Duration total_billed_time = 5; -} - -// A streaming speech recognition result corresponding to a portion of the audio -// that is currently being processed. -message StreamingRecognitionResult { - // May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // If `false`, this `StreamingRecognitionResult` represents an - // interim result that may change. If `true`, this is the final time the - // speech service will return this particular `StreamingRecognitionResult`, - // the recognizer will not return any further hypotheses for this portion of - // the transcript and corresponding audio. - bool is_final = 2; - - // An estimate of the likelihood that the recognizer will not - // change its guess about this interim result. Values range from 0.0 - // (completely unstable) to 1.0 (completely stable). - // This field is only provided for interim results (`is_final=false`). - // The default of 0.0 is a sentinel value indicating `stability` was not set. - float stability = 3; - - // Time offset of the end of this result relative to the - // beginning of the audio. - google.protobuf.Duration result_end_time = 4; - - // For multi-channel audio, this is the channel number corresponding to the - // recognized result for the audio from that channel. - // For audio_channel_count = N, its output values can range from '1' to 'N'. - int32 channel_tag = 5; - - // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag - // of the language in this result. This language code was detected to have - // the most likelihood of being spoken in the audio. - string language_code = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A speech recognition result corresponding to a portion of the audio. -message SpeechRecognitionResult { - // May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // For multi-channel audio, this is the channel number corresponding to the - // recognized result for the audio from that channel. - // For audio_channel_count = N, its output values can range from '1' to 'N'. - int32 channel_tag = 2; - - // Time offset of the end of this result relative to the - // beginning of the audio. - google.protobuf.Duration result_end_time = 4; - - // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag - // of the language in this result. This language code was detected to have - // the most likelihood of being spoken in the audio. - string language_code = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Alternative hypotheses (a.k.a. n-best list). -message SpeechRecognitionAlternative { - // Transcript text representing the words that the user spoke. - // In languages that use spaces to separate words, the transcript might have a - // leading space if it isn't the first result. You can concatenate each result - // to obtain the full transcript without using a separator. - string transcript = 1; - - // The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative of a non-streaming - // result or, of a streaming result where `is_final=true`. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 2; - - // A list of word-specific information for each recognized word. - // Note: When `enable_speaker_diarization` is true, you will see all the words - // from the beginning of the audio. - repeated WordInfo words = 3; -} - -// Word-specific information for recognized words. -message WordInfo { - // Time offset relative to the beginning of the audio, - // and corresponding to the start of the spoken word. - // This field is only set if `enable_word_time_offsets=true` and only - // in the top hypothesis. - // This is an experimental feature and the accuracy of the time offset can - // vary. - google.protobuf.Duration start_time = 1; - - // Time offset relative to the beginning of the audio, - // and corresponding to the end of the spoken word. - // This field is only set if `enable_word_time_offsets=true` and only - // in the top hypothesis. - // This is an experimental feature and the accuracy of the time offset can - // vary. - google.protobuf.Duration end_time = 2; - - // The word corresponding to this set of information. - string word = 3; - - // The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative of a non-streaming - // result or, of a streaming result where `is_final=true`. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 4; - - // Output only. A distinct integer value is assigned for every speaker within - // the audio. This field specifies which one of those speakers was detected to - // have spoken this word. Value ranges from '1' to diarization_speaker_count. - // speaker_tag is set if enable_speaker_diarization = 'true' and only in the - // top alternative. - int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto deleted file mode 100644 index 45ca97f2d13a..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto +++ /dev/null @@ -1,370 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.speech.v1p1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/speech/v1p1beta1/resource.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech"; -option java_multiple_files = true; -option java_outer_classname = "SpeechAdaptationProto"; -option java_package = "com.google.cloud.speech.v1p1beta1"; -option objc_class_prefix = "GCS"; - -// Service that implements Google Cloud Speech Adaptation API. -service Adaptation { - option (google.api.default_host) = "speech.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Create a set of phrase hints. Each item in the set can be a single word or - // a multi-word phrase. The items in the PhraseSet are favored by the - // recognition model when you send a call that includes the PhraseSet. - rpc CreatePhraseSet(CreatePhraseSetRequest) returns (PhraseSet) { - option (google.api.http) = { - post: "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets" - body: "*" - }; - option (google.api.method_signature) = "parent,phrase_set,phrase_set_id"; - } - - // Get a phrase set. - rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) { - option (google.api.http) = { - get: "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List phrase sets. - rpc ListPhraseSet(ListPhraseSetRequest) returns (ListPhraseSetResponse) { - option (google.api.http) = { - get: "/v1p1beta1/{parent=projects/*/locations/*}/phraseSets" - }; - option (google.api.method_signature) = "parent"; - } - - // Update a phrase set. - rpc UpdatePhraseSet(UpdatePhraseSetRequest) returns (PhraseSet) { - option (google.api.http) = { - patch: "/v1p1beta1/{phrase_set.name=projects/*/locations/*/phraseSets/*}" - body: "phrase_set" - }; - option (google.api.method_signature) = "phrase_set,update_mask"; - } - - // Delete a phrase set. - rpc DeletePhraseSet(DeletePhraseSetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p1beta1/{name=projects/*/locations/*/phraseSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Create a custom class. - rpc CreateCustomClass(CreateCustomClassRequest) returns (CustomClass) { - option (google.api.http) = { - post: "/v1p1beta1/{parent=projects/*/locations/*}/customClasses" - body: "*" - }; - option (google.api.method_signature) = "parent,custom_class,custom_class_id"; - } - - // Get a custom class. - rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) { - option (google.api.http) = { - get: "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}" - }; - option (google.api.method_signature) = "name"; - } - - // List custom classes. - rpc ListCustomClasses(ListCustomClassesRequest) returns (ListCustomClassesResponse) { - option (google.api.http) = { - get: "/v1p1beta1/{parent=projects/*/locations/*}/customClasses" - }; - option (google.api.method_signature) = "parent"; - } - - // Update a custom class. - rpc UpdateCustomClass(UpdateCustomClassRequest) returns (CustomClass) { - option (google.api.http) = { - patch: "/v1p1beta1/{custom_class.name=projects/*/locations/*/customClasses/*}" - body: "custom_class" - }; - option (google.api.method_signature) = "custom_class,update_mask"; - } - - // Delete a custom class. - rpc DeleteCustomClass(DeleteCustomClassRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p1beta1/{name=projects/*/locations/*/customClasses/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// Message sent by the client for the `CreatePhraseSet` method. -message CreatePhraseSetRequest { - // Required. The parent resource where this phrase set will be created. Format: - // - // `projects/{project}/locations/{location}/phraseSets` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "speech.googleapis.com/PhraseSet" - } - ]; - - // Required. The ID to use for the phrase set, which will become the final - // component of the phrase set's resource name. - // - // This value should restrict to letters, numbers, and hyphens, with the first - // character a letter, the last a letter or a number, and be 4-63 characters. - string phrase_set_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The phrase set to create. - PhraseSet phrase_set = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Message sent by the client for the `UpdatePhraseSet` method. -message UpdatePhraseSetRequest { - // Required. The phrase set to update. - // - // The phrase set's `name` field is used to identify the set to be - // updated. Format: - // - // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - PhraseSet phrase_set = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// Message sent by the client for the `GetPhraseSet` method. -message GetPhraseSetRequest { - // Required. The name of the phrase set to retrieve. Format: - // - // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "speech.googleapis.com/PhraseSet" - } - ]; -} - -// Message sent by the client for the `ListPhraseSet` method. -message ListPhraseSetRequest { - // Required. The parent, which owns this collection of phrase set. Format: - // - // `projects/{project}/locations/{location}` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "speech.googleapis.com/PhraseSet" - } - ]; - - // The maximum number of phrase sets to return. The service may return - // fewer than this value. If unspecified, at most 50 phrase sets will be - // returned. The maximum value is 1000; values above 1000 will be coerced to - // 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListPhraseSet` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListPhraseSet` must - // match the call that provided the page token. - string page_token = 3; -} - -// Message returned to the client by the `ListPhraseSet` method. -message ListPhraseSetResponse { - // The phrase set. - repeated PhraseSet phrase_sets = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Message sent by the client for the `DeletePhraseSet` method. -message DeletePhraseSetRequest { - // Required. The name of the phrase set to delete. Format: - // - // `projects/{project}/locations/{location}/phraseSets/{phrase_set}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "speech.googleapis.com/PhraseSet" - } - ]; -} - -// Message sent by the client for the `CreateCustomClass` method. -message CreateCustomClassRequest { - // Required. The parent resource where this custom class will be created. Format: - // - // `projects/{project}/locations/{location}/customClasses` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "speech.googleapis.com/CustomClass" - } - ]; - - // Required. The ID to use for the custom class, which will become the final - // component of the custom class' resource name. - // - // This value should restrict to letters, numbers, and hyphens, with the first - // character a letter, the last a letter or a number, and be 4-63 characters. - string custom_class_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The custom class to create. - CustomClass custom_class = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Message sent by the client for the `UpdateCustomClass` method. -message UpdateCustomClassRequest { - // Required. The custom class to update. - // - // The custom class's `name` field is used to identify the custom class to be - // updated. Format: - // - // `projects/{project}/locations/{location}/customClasses/{custom_class}` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - CustomClass custom_class = 1 [(google.api.field_behavior) = REQUIRED]; - - // The list of fields to be updated. - google.protobuf.FieldMask update_mask = 2; -} - -// Message sent by the client for the `GetCustomClass` method. -message GetCustomClassRequest { - // Required. The name of the custom class to retrieve. Format: - // - // `projects/{project}/locations/{location}/customClasses/{custom_class}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "speech.googleapis.com/CustomClass" - } - ]; -} - -// Message sent by the client for the `ListCustomClasses` method. -message ListCustomClassesRequest { - // Required. The parent, which owns this collection of custom classes. Format: - // - // `projects/{project}/locations/{location}/customClasses` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "speech.googleapis.com/CustomClass" - } - ]; - - // The maximum number of custom classes to return. The service may return - // fewer than this value. If unspecified, at most 50 custom classes will be - // returned. The maximum value is 1000; values above 1000 will be coerced to - // 1000. - int32 page_size = 2; - - // A page token, received from a previous `ListCustomClass` call. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to `ListCustomClass` must - // match the call that provided the page token. - string page_token = 3; -} - -// Message returned to the client by the `ListCustomClasses` method. -message ListCustomClassesResponse { - // The custom classes. - repeated CustomClass custom_classes = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// Message sent by the client for the `DeleteCustomClass` method. -message DeleteCustomClassRequest { - // Required. The name of the custom class to delete. Format: - // - // `projects/{project}/locations/{location}/customClasses/{custom_class}` - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) - // with matching `us` or `eu` location value. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "speech.googleapis.com/CustomClass" - } - ]; -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto b/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto deleted file mode 100644 index 0323b19e22e9..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/proto-google-cloud-speech-v1p1beta1/src/main/proto/google/cloud/speech/v1p1beta1/resource.proto +++ /dev/null @@ -1,162 +0,0 @@ -// 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. - -syntax = "proto3"; - -package google.cloud.speech.v1p1beta1; - -import "google/api/resource.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech"; -option java_multiple_files = true; -option java_outer_classname = "SpeechResourceProto"; -option java_package = "com.google.cloud.speech.v1p1beta1"; -option objc_class_prefix = "GCS"; - -// A set of words or phrases that represents a common concept likely to appear -// in your audio, for example a list of passenger ship names. CustomClass items -// can be substituted into placeholders that you set in PhraseSet phrases. -message CustomClass { - option (google.api.resource) = { - type: "speech.googleapis.com/CustomClass" - pattern: "projects/{project}/locations/{location}/customClasses/{custom_class}" - }; - - // An item of the class. - message ClassItem { - // The class item's value. - string value = 1; - } - - // The resource name of the custom class. - string name = 1; - - // If this custom class is a resource, the custom_class_id is the resource id - // of the CustomClass. Case sensitive. - string custom_class_id = 2; - - // A collection of class items. - repeated ClassItem items = 3; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message PhraseSet { - option (google.api.resource) = { - type: "speech.googleapis.com/PhraseSet" - pattern: "projects/{project}/locations/{location}/phraseSets/{phrase_set}" - }; - - // A phrases containing words and phrase "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - // - // List items can also include pre-built or custom classes containing groups - // of words that represent common concepts that occur in natural language. For - // example, rather than providing a phrase hint for every month of the - // year (e.g. "i was born in january", "i was born in febuary", ...), use the - // pre-built `$MONTH` class improves the likelihood of correctly transcribing - // audio that includes months (e.g. "i was born in $month"). - // To refer to pre-built classes, use the class' symbol prepended with `$` - // e.g. `$MONTH`. To refer to custom classes that were defined inline in the - // request, set the class's `custom_class_id` to a string unique to all class - // resources and inline classes. Then use the class' id wrapped in $`{...}` - // e.g. "${my-months}". To refer to custom classes resources, use the class' - // id wrapped in `${}` (e.g. `${my-months}`). - // - // Speech-to-Text supports three locations: `global`, `us` (US North America), - // and `eu` (Europe). If you are calling the `speech.googleapis.com` - // endpoint, use the `global` location. To specify a region, use a - // [regional endpoint](/speech-to-text/docs/endpoints) with matching `us` or - // `eu` location value. - message Phrase { - // The phrase itself. - string value = 1; - - // Hint Boost. Overrides the boost set at the phrase set level. - // Positive value will increase the probability that a specific phrase will - // be recognized over other similar sounding phrases. The higher the boost, - // the higher the chance of false positive recognition as well. Negative - // boost will simply be ignored. Though `boost` can accept a wide range of - // positive values, most use cases are best served - // with values between 0 and 20. We recommend using a binary search approach - // to finding the optimal value for your use case. Speech recognition - // will skip PhraseSets with a boost value of 0. - float boost = 2; - } - - // The resource name of the phrase set. - string name = 1; - - // A list of word and phrases. - repeated Phrase phrases = 2; - - // Hint Boost. Positive value will increase the probability that a specific - // phrase will be recognized over other similar sounding phrases. The higher - // the boost, the higher the chance of false positive recognition as well. - // Negative boost values would correspond to anti-biasing. Anti-biasing is not - // enabled, so negative boost will simply be ignored. Though `boost` can - // accept a wide range of positive values, most use cases are best served with - // values between 0 (exclusive) and 20. We recommend using a binary search - // approach to finding the optimal value for your use case. Speech recognition - // will skip PhraseSets with a boost value of 0. - float boost = 4; -} - -// Speech adaptation configuration. -message SpeechAdaptation { - // A collection of phrase sets. To specify the hints inline, leave the - // phrase set's `name` blank and fill in the rest of its fields. Any - // phrase set can use any custom class. - repeated PhraseSet phrase_sets = 1; - - // A collection of phrase set resource names to use. - repeated string phrase_set_references = 2 [(google.api.resource_reference) = { - type: "speech.googleapis.com/PhraseSet" - }]; - - // A collection of custom classes. To specify the classes inline, leave the - // class' `name` blank and fill in the rest of its fields, giving it a unique - // `custom_class_id`. Refer to the inline defined class in phrase hints by its - // `custom_class_id`. - repeated CustomClass custom_classes = 3; -} - -// Transcription normalization configuration. Use transcription normalization -// to automatically replace parts of the transcript with phrases of your -// choosing. For StreamingRecognize, this normalization only applies to stable -// partial transcripts (stability > 0.8) and final transcripts. -message TranscriptNormalization { - // A single replacement configuration. - message Entry { - // What to replace. Max length is 100 characters. - string search = 1; - - // What to replace with. Max length is 100 characters. - string replace = 2; - - // Whether the search is case sensitive. - bool case_sensitive = 3; - } - - // A list of replacement entries. We will perform replacement with one entry - // at a time. For example, the second entry in ["cat" => "dog", "mountain cat" - // => "mountain dog"] will never be applied because we will always process the - // first entry before it. At most 100 entries. - repeated Entry entries = 1; -} diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index bd56643098c5..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_create_setcredentialsprovider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.AdaptationSettings; -import com.google.cloud.speech.v1p1beta1.myCredentials; - -public class SyncCreateSetCredentialsProvider { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider(); - } - - public static void syncCreateSetCredentialsProvider() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - AdaptationSettings adaptationSettings = - AdaptationSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings); - } -} -// [END speech_v1p1beta1_generated_adaptationclient_create_setcredentialsprovider_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index 40dc533c48fd..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_create_setcredentialsprovider1_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.AdaptationSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - AdaptationSettings adaptationSettings = - AdaptationSettings.newBuilder() - .setTransportChannelProvider( - AdaptationSettings.defaultHttpJsonTransportProviderBuilder().build()) - .build(); - AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings); - } -} -// [END speech_v1p1beta1_generated_adaptationclient_create_setcredentialsprovider1_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetEndpoint.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetEndpoint.java deleted file mode 100644 index 7e99d78cb982..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_create_setendpoint_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.AdaptationSettings; -import com.google.cloud.speech.v1p1beta1.myEndpoint; - -public class SyncCreateSetEndpoint { - - public static void main(String[] args) throws Exception { - syncCreateSetEndpoint(); - } - - public static void syncCreateSetEndpoint() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - AdaptationSettings adaptationSettings = - AdaptationSettings.newBuilder().setEndpoint(myEndpoint).build(); - AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings); - } -} -// [END speech_v1p1beta1_generated_adaptationclient_create_setendpoint_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java deleted file mode 100644 index 1a57cc82156b..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/AsyncCreateCustomClass.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_createcustomclass_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.LocationName; - -public class AsyncCreateCustomClass { - - public static void main(String[] args) throws Exception { - asyncCreateCustomClass(); - } - - public static void asyncCreateCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CreateCustomClassRequest request = - CreateCustomClassRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setCustomClassId("customClassId1871032322") - .setCustomClass(CustomClass.newBuilder().build()) - .build(); - ApiFuture future = - adaptationClient.createCustomClassCallable().futureCall(request); - // Do something. - CustomClass response = future.get(); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_createcustomclass_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClass.java deleted file mode 100644 index 2be35900c160..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClass.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_createcustomclass_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CreateCustomClassRequest; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.LocationName; - -public class SyncCreateCustomClass { - - public static void main(String[] args) throws Exception { - syncCreateCustomClass(); - } - - public static void syncCreateCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CreateCustomClassRequest request = - CreateCustomClassRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setCustomClassId("customClassId1871032322") - .setCustomClass(CustomClass.newBuilder().build()) - .build(); - CustomClass response = adaptationClient.createCustomClass(request); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_createcustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java deleted file mode 100644 index 8ed1a4df7997..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassLocationnameCustomclassString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_createcustomclass_locationnamecustomclassstring_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.LocationName; - -public class SyncCreateCustomClassLocationnameCustomclassString { - - public static void main(String[] args) throws Exception { - syncCreateCustomClassLocationnameCustomclassString(); - } - - public static void syncCreateCustomClassLocationnameCustomclassString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_createcustomclass_locationnamecustomclassstring_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java deleted file mode 100644 index 590bb5f11c91..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createcustomclass/SyncCreateCustomClassStringCustomclassString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_createcustomclass_stringcustomclassstring_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.LocationName; - -public class SyncCreateCustomClassStringCustomclassString { - - public static void main(String[] args) throws Exception { - syncCreateCustomClassStringCustomclassString(); - } - - public static void syncCreateCustomClassStringCustomclassString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - CustomClass customClass = CustomClass.newBuilder().build(); - String customClassId = "customClassId1871032322"; - CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_createcustomclass_stringcustomclassstring_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java deleted file mode 100644 index 57803528152b..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/AsyncCreatePhraseSet.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_createphraseset_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.LocationName; -import com.google.cloud.speech.v1p1beta1.PhraseSet; - -public class AsyncCreatePhraseSet { - - public static void main(String[] args) throws Exception { - asyncCreatePhraseSet(); - } - - public static void asyncCreatePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CreatePhraseSetRequest request = - CreatePhraseSetRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPhraseSetId("phraseSetId959902180") - .setPhraseSet(PhraseSet.newBuilder().build()) - .build(); - ApiFuture future = adaptationClient.createPhraseSetCallable().futureCall(request); - // Do something. - PhraseSet response = future.get(); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_createphraseset_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSet.java deleted file mode 100644 index c2f19902a694..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSet.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_createphraseset_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CreatePhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.LocationName; -import com.google.cloud.speech.v1p1beta1.PhraseSet; - -public class SyncCreatePhraseSet { - - public static void main(String[] args) throws Exception { - syncCreatePhraseSet(); - } - - public static void syncCreatePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CreatePhraseSetRequest request = - CreatePhraseSetRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPhraseSetId("phraseSetId959902180") - .setPhraseSet(PhraseSet.newBuilder().build()) - .build(); - PhraseSet response = adaptationClient.createPhraseSet(request); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_createphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java deleted file mode 100644 index 112bc429067a..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetLocationnamePhrasesetString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_createphraseset_locationnamephrasesetstring_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.LocationName; -import com.google.cloud.speech.v1p1beta1.PhraseSet; - -public class SyncCreatePhraseSetLocationnamePhrasesetString { - - public static void main(String[] args) throws Exception { - syncCreatePhraseSetLocationnamePhrasesetString(); - } - - public static void syncCreatePhraseSetLocationnamePhrasesetString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_createphraseset_locationnamephrasesetstring_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java deleted file mode 100644 index affa84e49e19..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/createphraseset/SyncCreatePhraseSetStringPhrasesetString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_createphraseset_stringphrasesetstring_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.LocationName; -import com.google.cloud.speech.v1p1beta1.PhraseSet; - -public class SyncCreatePhraseSetStringPhrasesetString { - - public static void main(String[] args) throws Exception { - syncCreatePhraseSetStringPhrasesetString(); - } - - public static void syncCreatePhraseSetStringPhrasesetString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - String phraseSetId = "phraseSetId959902180"; - PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_createphraseset_stringphrasesetstring_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java deleted file mode 100644 index dc0d07516a46..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/AsyncDeleteCustomClass.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_deletecustomclass_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClassName; -import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; -import com.google.protobuf.Empty; - -public class AsyncDeleteCustomClass { - - public static void main(String[] args) throws Exception { - asyncDeleteCustomClass(); - } - - public static void asyncDeleteCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - DeleteCustomClassRequest request = - DeleteCustomClassRequest.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .build(); - ApiFuture future = adaptationClient.deleteCustomClassCallable().futureCall(request); - // Do something. - future.get(); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_deletecustomclass_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java deleted file mode 100644 index 5df45e9c584a..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClass.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_deletecustomclass_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClassName; -import com.google.cloud.speech.v1p1beta1.DeleteCustomClassRequest; -import com.google.protobuf.Empty; - -public class SyncDeleteCustomClass { - - public static void main(String[] args) throws Exception { - syncDeleteCustomClass(); - } - - public static void syncDeleteCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - DeleteCustomClassRequest request = - DeleteCustomClassRequest.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .build(); - adaptationClient.deleteCustomClass(request); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_deletecustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java deleted file mode 100644 index 72435684800e..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassCustomclassname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_deletecustomclass_customclassname_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClassName; -import com.google.protobuf.Empty; - -public class SyncDeleteCustomClassCustomclassname { - - public static void main(String[] args) throws Exception { - syncDeleteCustomClassCustomclassname(); - } - - public static void syncDeleteCustomClassCustomclassname() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - adaptationClient.deleteCustomClass(name); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_deletecustomclass_customclassname_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java deleted file mode 100644 index 7e7156e465d0..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletecustomclass/SyncDeleteCustomClassString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_deletecustomclass_string_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClassName; -import com.google.protobuf.Empty; - -public class SyncDeleteCustomClassString { - - public static void main(String[] args) throws Exception { - syncDeleteCustomClassString(); - } - - public static void syncDeleteCustomClassString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString(); - adaptationClient.deleteCustomClass(name); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_deletecustomclass_string_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java deleted file mode 100644 index 1f2090dd100e..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/AsyncDeletePhraseSet.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_deletephraseset_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.PhraseSetName; -import com.google.protobuf.Empty; - -public class AsyncDeletePhraseSet { - - public static void main(String[] args) throws Exception { - asyncDeletePhraseSet(); - } - - public static void asyncDeletePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - DeletePhraseSetRequest request = - DeletePhraseSetRequest.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .build(); - ApiFuture future = adaptationClient.deletePhraseSetCallable().futureCall(request); - // Do something. - future.get(); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_deletephraseset_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java deleted file mode 100644 index ad1e94c7c5fd..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSet.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_deletephraseset_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.DeletePhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.PhraseSetName; -import com.google.protobuf.Empty; - -public class SyncDeletePhraseSet { - - public static void main(String[] args) throws Exception { - syncDeletePhraseSet(); - } - - public static void syncDeletePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - DeletePhraseSetRequest request = - DeletePhraseSetRequest.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .build(); - adaptationClient.deletePhraseSet(request); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_deletephraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java deleted file mode 100644 index 8ce8766e5751..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetPhrasesetname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_deletephraseset_phrasesetname_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.PhraseSetName; -import com.google.protobuf.Empty; - -public class SyncDeletePhraseSetPhrasesetname { - - public static void main(String[] args) throws Exception { - syncDeletePhraseSetPhrasesetname(); - } - - public static void syncDeletePhraseSetPhrasesetname() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - adaptationClient.deletePhraseSet(name); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_deletephraseset_phrasesetname_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java deleted file mode 100644 index b4f5722e1e10..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/deletephraseset/SyncDeletePhraseSetString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_deletephraseset_string_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.PhraseSetName; -import com.google.protobuf.Empty; - -public class SyncDeletePhraseSetString { - - public static void main(String[] args) throws Exception { - syncDeletePhraseSetString(); - } - - public static void syncDeletePhraseSetString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString(); - adaptationClient.deletePhraseSet(name); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_deletephraseset_string_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/AsyncGetCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/AsyncGetCustomClass.java deleted file mode 100644 index 2ed74756b1bb..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/AsyncGetCustomClass.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_getcustomclass_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.CustomClassName; -import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; - -public class AsyncGetCustomClass { - - public static void main(String[] args) throws Exception { - asyncGetCustomClass(); - } - - public static void asyncGetCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - GetCustomClassRequest request = - GetCustomClassRequest.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .build(); - ApiFuture future = adaptationClient.getCustomClassCallable().futureCall(request); - // Do something. - CustomClass response = future.get(); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_getcustomclass_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClass.java deleted file mode 100644 index c64a6bef5189..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClass.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_getcustomclass_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.CustomClassName; -import com.google.cloud.speech.v1p1beta1.GetCustomClassRequest; - -public class SyncGetCustomClass { - - public static void main(String[] args) throws Exception { - syncGetCustomClass(); - } - - public static void syncGetCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - GetCustomClassRequest request = - GetCustomClassRequest.newBuilder() - .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString()) - .build(); - CustomClass response = adaptationClient.getCustomClass(request); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_getcustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java deleted file mode 100644 index a755bb8d2a11..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassCustomclassname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_getcustomclass_customclassname_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.CustomClassName; - -public class SyncGetCustomClassCustomclassname { - - public static void main(String[] args) throws Exception { - syncGetCustomClassCustomclassname(); - } - - public static void syncGetCustomClassCustomclassname() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]"); - CustomClass response = adaptationClient.getCustomClass(name); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_getcustomclass_customclassname_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassString.java deleted file mode 100644 index e4b6e750001c..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getcustomclass/SyncGetCustomClassString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_getcustomclass_string_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.CustomClassName; - -public class SyncGetCustomClassString { - - public static void main(String[] args) throws Exception { - syncGetCustomClassString(); - } - - public static void syncGetCustomClassString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString(); - CustomClass response = adaptationClient.getCustomClass(name); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_getcustomclass_string_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/AsyncGetPhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/AsyncGetPhraseSet.java deleted file mode 100644 index 7c39172024d7..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/AsyncGetPhraseSet.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_getphraseset_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.PhraseSet; -import com.google.cloud.speech.v1p1beta1.PhraseSetName; - -public class AsyncGetPhraseSet { - - public static void main(String[] args) throws Exception { - asyncGetPhraseSet(); - } - - public static void asyncGetPhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - GetPhraseSetRequest request = - GetPhraseSetRequest.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .build(); - ApiFuture future = adaptationClient.getPhraseSetCallable().futureCall(request); - // Do something. - PhraseSet response = future.get(); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_getphraseset_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSet.java deleted file mode 100644 index 5a74538b1781..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSet.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_getphraseset_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.GetPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.PhraseSet; -import com.google.cloud.speech.v1p1beta1.PhraseSetName; - -public class SyncGetPhraseSet { - - public static void main(String[] args) throws Exception { - syncGetPhraseSet(); - } - - public static void syncGetPhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - GetPhraseSetRequest request = - GetPhraseSetRequest.newBuilder() - .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString()) - .build(); - PhraseSet response = adaptationClient.getPhraseSet(request); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_getphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java deleted file mode 100644 index f441e0cb1feb..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetPhrasesetname.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_getphraseset_phrasesetname_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.PhraseSet; -import com.google.cloud.speech.v1p1beta1.PhraseSetName; - -public class SyncGetPhraseSetPhrasesetname { - - public static void main(String[] args) throws Exception { - syncGetPhraseSetPhrasesetname(); - } - - public static void syncGetPhraseSetPhrasesetname() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]"); - PhraseSet response = adaptationClient.getPhraseSet(name); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_getphraseset_phrasesetname_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetString.java deleted file mode 100644 index 19b5e9a5e0f1..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/getphraseset/SyncGetPhraseSetString.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_getphraseset_string_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.PhraseSet; -import com.google.cloud.speech.v1p1beta1.PhraseSetName; - -public class SyncGetPhraseSetString { - - public static void main(String[] args) throws Exception { - syncGetPhraseSetString(); - } - - public static void syncGetPhraseSetString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString(); - PhraseSet response = adaptationClient.getPhraseSet(name); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_getphraseset_string_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java deleted file mode 100644 index 064a5e84c973..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClasses.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_listcustomclasses_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; -import com.google.cloud.speech.v1p1beta1.LocationName; - -public class AsyncListCustomClasses { - - public static void main(String[] args) throws Exception { - asyncListCustomClasses(); - } - - public static void asyncListCustomClasses() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - ListCustomClassesRequest request = - ListCustomClassesRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - ApiFuture future = - adaptationClient.listCustomClassesPagedCallable().futureCall(request); - // Do something. - for (CustomClass element : future.get().iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_listcustomclasses_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java deleted file mode 100644 index 8c3746eb2d89..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/AsyncListCustomClassesPaged.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_listcustomclasses_paged_async] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; -import com.google.cloud.speech.v1p1beta1.ListCustomClassesResponse; -import com.google.cloud.speech.v1p1beta1.LocationName; -import com.google.common.base.Strings; - -public class AsyncListCustomClassesPaged { - - public static void main(String[] args) throws Exception { - asyncListCustomClassesPaged(); - } - - public static void asyncListCustomClassesPaged() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - ListCustomClassesRequest request = - ListCustomClassesRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - while (true) { - ListCustomClassesResponse response = - adaptationClient.listCustomClassesCallable().call(request); - for (CustomClass element : response.getCustomClassesList()) { - // doThingsWith(element); - } - String nextPageToken = response.getNextPageToken(); - if (!Strings.isNullOrEmpty(nextPageToken)) { - request = request.toBuilder().setPageToken(nextPageToken).build(); - } else { - break; - } - } - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_listcustomclasses_paged_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClasses.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClasses.java deleted file mode 100644 index e27771c35830..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClasses.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_listcustomclasses_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.ListCustomClassesRequest; -import com.google.cloud.speech.v1p1beta1.LocationName; - -public class SyncListCustomClasses { - - public static void main(String[] args) throws Exception { - syncListCustomClasses(); - } - - public static void syncListCustomClasses() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - ListCustomClassesRequest request = - ListCustomClassesRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - for (CustomClass element : adaptationClient.listCustomClasses(request).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_listcustomclasses_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java deleted file mode 100644 index c3713e7649d1..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesLocationname.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_listcustomclasses_locationname_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.LocationName; - -public class SyncListCustomClassesLocationname { - - public static void main(String[] args) throws Exception { - syncListCustomClassesLocationname(); - } - - public static void syncListCustomClassesLocationname() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_listcustomclasses_locationname_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java deleted file mode 100644 index b562359e71d1..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listcustomclasses/SyncListCustomClassesString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_listcustomclasses_string_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.LocationName; - -public class SyncListCustomClassesString { - - public static void main(String[] args) throws Exception { - syncListCustomClassesString(); - } - - public static void syncListCustomClassesString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_listcustomclasses_string_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSet.java deleted file mode 100644 index ddd8ac9c5a6e..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSet.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_listphraseset_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.LocationName; -import com.google.cloud.speech.v1p1beta1.PhraseSet; - -public class AsyncListPhraseSet { - - public static void main(String[] args) throws Exception { - asyncListPhraseSet(); - } - - public static void asyncListPhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - ListPhraseSetRequest request = - ListPhraseSetRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - ApiFuture future = - adaptationClient.listPhraseSetPagedCallable().futureCall(request); - // Do something. - for (PhraseSet element : future.get().iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_listphraseset_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java deleted file mode 100644 index fdce15bfc4e7..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/AsyncListPhraseSetPaged.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_listphraseset_paged_async] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.ListPhraseSetResponse; -import com.google.cloud.speech.v1p1beta1.LocationName; -import com.google.cloud.speech.v1p1beta1.PhraseSet; -import com.google.common.base.Strings; - -public class AsyncListPhraseSetPaged { - - public static void main(String[] args) throws Exception { - asyncListPhraseSetPaged(); - } - - public static void asyncListPhraseSetPaged() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - ListPhraseSetRequest request = - ListPhraseSetRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - while (true) { - ListPhraseSetResponse response = adaptationClient.listPhraseSetCallable().call(request); - for (PhraseSet element : response.getPhraseSetsList()) { - // doThingsWith(element); - } - String nextPageToken = response.getNextPageToken(); - if (!Strings.isNullOrEmpty(nextPageToken)) { - request = request.toBuilder().setPageToken(nextPageToken).build(); - } else { - break; - } - } - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_listphraseset_paged_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSet.java deleted file mode 100644 index aece2277d57d..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSet.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_listphraseset_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.ListPhraseSetRequest; -import com.google.cloud.speech.v1p1beta1.LocationName; -import com.google.cloud.speech.v1p1beta1.PhraseSet; - -public class SyncListPhraseSet { - - public static void main(String[] args) throws Exception { - syncListPhraseSet(); - } - - public static void syncListPhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - ListPhraseSetRequest request = - ListPhraseSetRequest.newBuilder() - .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) - .setPageSize(883849137) - .setPageToken("pageToken873572522") - .build(); - for (PhraseSet element : adaptationClient.listPhraseSet(request).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_listphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java deleted file mode 100644 index c420799768e8..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetLocationname.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_listphraseset_locationname_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.LocationName; -import com.google.cloud.speech.v1p1beta1.PhraseSet; - -public class SyncListPhraseSetLocationname { - - public static void main(String[] args) throws Exception { - syncListPhraseSetLocationname(); - } - - public static void syncListPhraseSetLocationname() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); - for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_listphraseset_locationname_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetString.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetString.java deleted file mode 100644 index 19588c874862..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/listphraseset/SyncListPhraseSetString.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_listphraseset_string_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.LocationName; -import com.google.cloud.speech.v1p1beta1.PhraseSet; - -public class SyncListPhraseSetString { - - public static void main(String[] args) throws Exception { - syncListPhraseSetString(); - } - - public static void syncListPhraseSetString() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); - for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) { - // doThingsWith(element); - } - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_listphraseset_string_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java deleted file mode 100644 index eff9cbd66cc1..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/AsyncUpdateCustomClass.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_updatecustomclass_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; -import com.google.protobuf.FieldMask; - -public class AsyncUpdateCustomClass { - - public static void main(String[] args) throws Exception { - asyncUpdateCustomClass(); - } - - public static void asyncUpdateCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - UpdateCustomClassRequest request = - UpdateCustomClassRequest.newBuilder() - .setCustomClass(CustomClass.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - ApiFuture future = - adaptationClient.updateCustomClassCallable().futureCall(request); - // Do something. - CustomClass response = future.get(); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_updatecustomclass_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java deleted file mode 100644 index 5639710d7d67..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClass.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_updatecustomclass_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.cloud.speech.v1p1beta1.UpdateCustomClassRequest; -import com.google.protobuf.FieldMask; - -public class SyncUpdateCustomClass { - - public static void main(String[] args) throws Exception { - syncUpdateCustomClass(); - } - - public static void syncUpdateCustomClass() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - UpdateCustomClassRequest request = - UpdateCustomClassRequest.newBuilder() - .setCustomClass(CustomClass.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - CustomClass response = adaptationClient.updateCustomClass(request); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_updatecustomclass_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java deleted file mode 100644 index ca713b4d0f53..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatecustomclass/SyncUpdateCustomClassCustomclassFieldmask.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_updatecustomclass_customclassfieldmask_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.CustomClass; -import com.google.protobuf.FieldMask; - -public class SyncUpdateCustomClassCustomclassFieldmask { - - public static void main(String[] args) throws Exception { - syncUpdateCustomClassCustomclassFieldmask(); - } - - public static void syncUpdateCustomClassCustomclassFieldmask() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - CustomClass customClass = CustomClass.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - CustomClass response = adaptationClient.updateCustomClass(customClass, updateMask); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_updatecustomclass_customclassfieldmask_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java deleted file mode 100644 index 0aaa9f205846..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/AsyncUpdatePhraseSet.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_updatephraseset_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.PhraseSet; -import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; -import com.google.protobuf.FieldMask; - -public class AsyncUpdatePhraseSet { - - public static void main(String[] args) throws Exception { - asyncUpdatePhraseSet(); - } - - public static void asyncUpdatePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - UpdatePhraseSetRequest request = - UpdatePhraseSetRequest.newBuilder() - .setPhraseSet(PhraseSet.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - ApiFuture future = adaptationClient.updatePhraseSetCallable().futureCall(request); - // Do something. - PhraseSet response = future.get(); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_updatephraseset_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java deleted file mode 100644 index 0d825ca2e2d5..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSet.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_updatephraseset_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.PhraseSet; -import com.google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest; -import com.google.protobuf.FieldMask; - -public class SyncUpdatePhraseSet { - - public static void main(String[] args) throws Exception { - syncUpdatePhraseSet(); - } - - public static void syncUpdatePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - UpdatePhraseSetRequest request = - UpdatePhraseSetRequest.newBuilder() - .setPhraseSet(PhraseSet.newBuilder().build()) - .setUpdateMask(FieldMask.newBuilder().build()) - .build(); - PhraseSet response = adaptationClient.updatePhraseSet(request); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_updatephraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java deleted file mode 100644 index f28127f9920c..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationclient/updatephraseset/SyncUpdatePhraseSetPhrasesetFieldmask.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationclient_updatephraseset_phrasesetfieldmask_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationClient; -import com.google.cloud.speech.v1p1beta1.PhraseSet; -import com.google.protobuf.FieldMask; - -public class SyncUpdatePhraseSetPhrasesetFieldmask { - - public static void main(String[] args) throws Exception { - syncUpdatePhraseSetPhrasesetFieldmask(); - } - - public static void syncUpdatePhraseSetPhrasesetFieldmask() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (AdaptationClient adaptationClient = AdaptationClient.create()) { - PhraseSet phraseSet = PhraseSet.newBuilder().build(); - FieldMask updateMask = FieldMask.newBuilder().build(); - PhraseSet response = adaptationClient.updatePhraseSet(phraseSet, updateMask); - } - } -} -// [END speech_v1p1beta1_generated_adaptationclient_updatephraseset_phrasesetfieldmask_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java deleted file mode 100644 index c8667aa60ea9..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/adaptationsettings/createphraseset/SyncCreatePhraseSet.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_adaptationsettings_createphraseset_sync] -import com.google.cloud.speech.v1p1beta1.AdaptationSettings; -import java.time.Duration; - -public class SyncCreatePhraseSet { - - public static void main(String[] args) throws Exception { - syncCreatePhraseSet(); - } - - public static void syncCreatePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - AdaptationSettings.Builder adaptationSettingsBuilder = AdaptationSettings.newBuilder(); - adaptationSettingsBuilder - .createPhraseSetSettings() - .setRetrySettings( - adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - AdaptationSettings adaptationSettings = adaptationSettingsBuilder.build(); - } -} -// [END speech_v1p1beta1_generated_adaptationsettings_createphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider.java deleted file mode 100644 index 465bcd69e24b..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_speechclient_create_setcredentialsprovider_sync] -import com.google.api.gax.core.FixedCredentialsProvider; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechSettings; -import com.google.cloud.speech.v1p1beta1.myCredentials; - -public class SyncCreateSetCredentialsProvider { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider(); - } - - public static void syncCreateSetCredentialsProvider() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SpeechSettings speechSettings = - SpeechSettings.newBuilder() - .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) - .build(); - SpeechClient speechClient = SpeechClient.create(speechSettings); - } -} -// [END speech_v1p1beta1_generated_speechclient_create_setcredentialsprovider_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider1.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider1.java deleted file mode 100644 index 456dd01a4ba0..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetCredentialsProvider1.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_speechclient_create_setcredentialsprovider1_sync] -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechSettings; - -public class SyncCreateSetCredentialsProvider1 { - - public static void main(String[] args) throws Exception { - syncCreateSetCredentialsProvider1(); - } - - public static void syncCreateSetCredentialsProvider1() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SpeechSettings speechSettings = - SpeechSettings.newBuilder() - .setTransportChannelProvider( - SpeechSettings.defaultHttpJsonTransportProviderBuilder().build()) - .build(); - SpeechClient speechClient = SpeechClient.create(speechSettings); - } -} -// [END speech_v1p1beta1_generated_speechclient_create_setcredentialsprovider1_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetEndpoint.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetEndpoint.java deleted file mode 100644 index 2108d127e850..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/create/SyncCreateSetEndpoint.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_speechclient_create_setendpoint_sync] -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.SpeechSettings; -import com.google.cloud.speech.v1p1beta1.myEndpoint; - -public class SyncCreateSetEndpoint { - - public static void main(String[] args) throws Exception { - syncCreateSetEndpoint(); - } - - public static void syncCreateSetEndpoint() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build(); - SpeechClient speechClient = SpeechClient.create(speechSettings); - } -} -// [END speech_v1p1beta1_generated_speechclient_create_setendpoint_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java deleted file mode 100644 index 6fbb74bd893a..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognize.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_speechclient_longrunningrecognize_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig; -import com.google.longrunning.Operation; - -public class AsyncLongRunningRecognize { - - public static void main(String[] args) throws Exception { - asyncLongRunningRecognize(); - } - - public static void asyncLongRunningRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder() - .setConfig(RecognitionConfig.newBuilder().build()) - .setAudio(RecognitionAudio.newBuilder().build()) - .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) - .build(); - ApiFuture future = speechClient.longRunningRecognizeCallable().futureCall(request); - // Do something. - Operation response = future.get(); - } - } -} -// [END speech_v1p1beta1_generated_speechclient_longrunningrecognize_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java deleted file mode 100644 index 832a218aceb8..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/AsyncLongRunningRecognizeLRO.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_speechclient_longrunningrecognize_lro_async] -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig; - -public class AsyncLongRunningRecognizeLRO { - - public static void main(String[] args) throws Exception { - asyncLongRunningRecognizeLRO(); - } - - public static void asyncLongRunningRecognizeLRO() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder() - .setConfig(RecognitionConfig.newBuilder().build()) - .setAudio(RecognitionAudio.newBuilder().build()) - .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) - .build(); - OperationFuture future = - speechClient.longRunningRecognizeOperationCallable().futureCall(request); - // Do something. - LongRunningRecognizeResponse response = future.get(); - } - } -} -// [END speech_v1p1beta1_generated_speechclient_longrunningrecognize_lro_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java deleted file mode 100644 index 5884a7620500..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognize.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_speechclient_longrunningrecognize_sync] -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.TranscriptOutputConfig; - -public class SyncLongRunningRecognize { - - public static void main(String[] args) throws Exception { - syncLongRunningRecognize(); - } - - public static void syncLongRunningRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - LongRunningRecognizeRequest request = - LongRunningRecognizeRequest.newBuilder() - .setConfig(RecognitionConfig.newBuilder().build()) - .setAudio(RecognitionAudio.newBuilder().build()) - .setOutputConfig(TranscriptOutputConfig.newBuilder().build()) - .build(); - LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get(); - } - } -} -// [END speech_v1p1beta1_generated_speechclient_longrunningrecognize_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java deleted file mode 100644 index 1ddada3bfb44..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/longrunningrecognize/SyncLongRunningRecognizeRecognitionconfigRecognitionaudio.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_speechclient_longrunningrecognize_recognitionconfigrecognitionaudio_sync] -import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.SpeechClient; - -public class SyncLongRunningRecognizeRecognitionconfigRecognitionaudio { - - public static void main(String[] args) throws Exception { - syncLongRunningRecognizeRecognitionconfigRecognitionaudio(); - } - - public static void syncLongRunningRecognizeRecognitionconfigRecognitionaudio() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - LongRunningRecognizeResponse response = - speechClient.longRunningRecognizeAsync(config, audio).get(); - } - } -} -// [END speech_v1p1beta1_generated_speechclient_longrunningrecognize_recognitionconfigrecognitionaudio_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/AsyncRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/AsyncRecognize.java deleted file mode 100644 index c99be3b3ebdd..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/AsyncRecognize.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_speechclient_recognize_async] -import com.google.api.core.ApiFuture; -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.SpeechClient; - -public class AsyncRecognize { - - public static void main(String[] args) throws Exception { - asyncRecognize(); - } - - public static void asyncRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - RecognizeRequest request = - RecognizeRequest.newBuilder() - .setConfig(RecognitionConfig.newBuilder().build()) - .setAudio(RecognitionAudio.newBuilder().build()) - .build(); - ApiFuture future = speechClient.recognizeCallable().futureCall(request); - // Do something. - RecognizeResponse response = future.get(); - } - } -} -// [END speech_v1p1beta1_generated_speechclient_recognize_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognize.java deleted file mode 100644 index 3491c66b136a..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognize.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_speechclient_recognize_sync] -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.RecognizeRequest; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.SpeechClient; - -public class SyncRecognize { - - public static void main(String[] args) throws Exception { - syncRecognize(); - } - - public static void syncRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - RecognizeRequest request = - RecognizeRequest.newBuilder() - .setConfig(RecognitionConfig.newBuilder().build()) - .setAudio(RecognitionAudio.newBuilder().build()) - .build(); - RecognizeResponse response = speechClient.recognize(request); - } - } -} -// [END speech_v1p1beta1_generated_speechclient_recognize_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java deleted file mode 100644 index 02951bb47eb3..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/recognize/SyncRecognizeRecognitionconfigRecognitionaudio.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_speechclient_recognize_recognitionconfigrecognitionaudio_sync] -import com.google.cloud.speech.v1p1beta1.RecognitionAudio; -import com.google.cloud.speech.v1p1beta1.RecognitionConfig; -import com.google.cloud.speech.v1p1beta1.RecognizeResponse; -import com.google.cloud.speech.v1p1beta1.SpeechClient; - -public class SyncRecognizeRecognitionconfigRecognitionaudio { - - public static void main(String[] args) throws Exception { - syncRecognizeRecognitionconfigRecognitionaudio(); - } - - public static void syncRecognizeRecognitionconfigRecognitionaudio() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - RecognitionConfig config = RecognitionConfig.newBuilder().build(); - RecognitionAudio audio = RecognitionAudio.newBuilder().build(); - RecognizeResponse response = speechClient.recognize(config, audio); - } - } -} -// [END speech_v1p1beta1_generated_speechclient_recognize_recognitionconfigrecognitionaudio_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/streamingrecognize/AsyncStreamingRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/streamingrecognize/AsyncStreamingRecognize.java deleted file mode 100644 index b910bb2bd363..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechclient/streamingrecognize/AsyncStreamingRecognize.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_speechclient_streamingrecognize_async] -import com.google.api.gax.rpc.BidiStream; -import com.google.cloud.speech.v1p1beta1.SpeechClient; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; -import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; - -public class AsyncStreamingRecognize { - - public static void main(String[] args) throws Exception { - asyncStreamingRecognize(); - } - - public static void asyncStreamingRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - try (SpeechClient speechClient = SpeechClient.create()) { - BidiStream bidiStream = - speechClient.streamingRecognizeCallable().call(); - StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build(); - bidiStream.send(request); - for (StreamingRecognizeResponse response : bidiStream) { - // Do something when a response is received. - } - } - } -} -// [END speech_v1p1beta1_generated_speechclient_streamingrecognize_async] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechsettings/recognize/SyncRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechsettings/recognize/SyncRecognize.java deleted file mode 100644 index 7611b369a133..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/speechsettings/recognize/SyncRecognize.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.samples; - -// [START speech_v1p1beta1_generated_speechsettings_recognize_sync] -import com.google.cloud.speech.v1p1beta1.SpeechSettings; -import java.time.Duration; - -public class SyncRecognize { - - public static void main(String[] args) throws Exception { - syncRecognize(); - } - - public static void syncRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder(); - speechSettingsBuilder - .recognizeSettings() - .setRetrySettings( - speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - SpeechSettings speechSettings = speechSettingsBuilder.build(); - } -} -// [END speech_v1p1beta1_generated_speechsettings_recognize_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java deleted file mode 100644 index baa910f35a95..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/adaptationstubsettings/createphraseset/SyncCreatePhraseSet.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub.samples; - -// [START speech_v1p1beta1_generated_adaptationstubsettings_createphraseset_sync] -import com.google.cloud.speech.v1p1beta1.stub.AdaptationStubSettings; -import java.time.Duration; - -public class SyncCreatePhraseSet { - - public static void main(String[] args) throws Exception { - syncCreatePhraseSet(); - } - - public static void syncCreatePhraseSet() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - AdaptationStubSettings.Builder adaptationSettingsBuilder = AdaptationStubSettings.newBuilder(); - adaptationSettingsBuilder - .createPhraseSetSettings() - .setRetrySettings( - adaptationSettingsBuilder.createPhraseSetSettings().getRetrySettings().toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - AdaptationStubSettings adaptationSettings = adaptationSettingsBuilder.build(); - } -} -// [END speech_v1p1beta1_generated_adaptationstubsettings_createphraseset_sync] diff --git a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/speechstubsettings/recognize/SyncRecognize.java b/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/speechstubsettings/recognize/SyncRecognize.java deleted file mode 100644 index e045c1b25446..000000000000 --- a/owl-bot-staging/java-speech/v1p1beta1/samples/snippets/generated/com/google/cloud/speech/v1p1beta1/stub/speechstubsettings/recognize/SyncRecognize.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 - * - * https://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. - */ - -package com.google.cloud.speech.v1p1beta1.stub.samples; - -// [START speech_v1p1beta1_generated_speechstubsettings_recognize_sync] -import com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings; -import java.time.Duration; - -public class SyncRecognize { - - public static void main(String[] args) throws Exception { - syncRecognize(); - } - - public static void syncRecognize() throws Exception { - // 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://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library - SpeechStubSettings.Builder speechSettingsBuilder = SpeechStubSettings.newBuilder(); - speechSettingsBuilder - .recognizeSettings() - .setRetrySettings( - speechSettingsBuilder.recognizeSettings().getRetrySettings().toBuilder() - .setTotalTimeout(Duration.ofSeconds(30)) - .build()); - SpeechStubSettings speechSettings = speechSettingsBuilder.build(); - } -} -// [END speech_v1p1beta1_generated_speechstubsettings_recognize_sync]